API reference
Authentication
Request fields, access rules and response contracts for authentication.
All endpoint paths include /api/v1. For protected writes, persist a stable idempotency key before making the request. Use the portal hostname and session described in each endpoint access rule.
/api/v1/auth/registerRegister a company
Creates a company workspace and emails a sign-in code. Available on the company hostname.
AccessPublic
| Body field | Type | Details |
|---|---|---|
namerequired | string | Length: 2 to 160. |
legalNamerequired | string | Length: 2 to 200. |
countryrequired | string | |
timezone | string | |
website | string | Format: uri |
emailrequired | string | Format: email |
Success: 201 · Resource created.
OpenAPI operation and schemas
{
"operationId": "post__api_v1_auth_register",
"tags": [
"Authentication"
],
"summary": "Register a company",
"description": "Creates a company workspace and emails a sign-in code. Available on the company hostname.\n\nAccess: Public",
"security": [],
"parameters": [],
"responses": {
"201": {
"description": "Successful response"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"409": {
"$ref": "#/components/responses/Conflict"
},
"422": {
"$ref": "#/components/responses/Invalid"
},
"429": {
"$ref": "#/components/responses/RateLimited"
},
"500": {
"$ref": "#/components/responses/Failed"
}
},
"servers": [
{
"url": "https://app.digitalcard.technology"
},
{
"url": "https://admin.digitalcard.technology"
},
{
"url": "https://card.digitalcard.technology"
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"name": {
"type": "string",
"minLength": 2,
"maxLength": 160
},
"legalName": {
"type": "string",
"minLength": 2,
"maxLength": 200
},
"country": {
"type": "string",
"pattern": "^[A-Z]{2}$"
},
"timezone": {
"default": "UTC",
"type": "string",
"maxLength": 80
},
"website": {
"type": "string",
"maxLength": 2048,
"format": "uri"
},
"email": {
"type": "string",
"maxLength": 254,
"format": "email",
"pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
}
},
"required": [
"name",
"legalName",
"country",
"email"
]
}
}
}
}
} /api/v1/auth/request-codeRequest a sign-in code
Requests a six-digit email code. The current hostname determines the company, administrator or beneficiary realm.
AccessPublic
| Body field | Type | Details |
|---|---|---|
emailrequired | string | Format: email |
companyId | string |
Success: 202 · Accepted for asynchronous processing. Read the operation for the confirmed provider outcome.
OpenAPI operation and schemas
{
"operationId": "post__api_v1_auth_request_code",
"tags": [
"Authentication"
],
"summary": "Request a sign-in code",
"description": "Requests a six-digit email code. The current hostname determines the company, administrator or beneficiary realm.\n\nAccess: Public",
"security": [],
"parameters": [],
"responses": {
"202": {
"description": "Accepted for asynchronous processing; inspect the operation status."
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"409": {
"$ref": "#/components/responses/Conflict"
},
"422": {
"$ref": "#/components/responses/Invalid"
},
"429": {
"$ref": "#/components/responses/RateLimited"
},
"500": {
"$ref": "#/components/responses/Failed"
}
},
"servers": [
{
"url": "https://app.digitalcard.technology"
},
{
"url": "https://admin.digitalcard.technology"
},
{
"url": "https://card.digitalcard.technology"
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"email": {
"type": "string",
"maxLength": 254,
"format": "email",
"pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
},
"companyId": {
"type": "string",
"pattern": "^[A-Za-z0-9_-]{12,100}$"
}
},
"required": [
"email"
]
}
}
}
}
} /api/v1/auth/verify-codeVerify a sign-in code
Consumes a valid challenge and creates a secure host-bound session. Codes expire after ten minutes and allow five attempts.
AccessPublic
| Body field | Type | Details |
|---|---|---|
challengeIdrequired | string | |
coderequired | string |
Success: 200 · Request completed.
OpenAPI operation and schemas
{
"operationId": "post__api_v1_auth_verify_code",
"tags": [
"Authentication"
],
"summary": "Verify a sign-in code",
"description": "Consumes a valid challenge and creates a secure host-bound session. Codes expire after ten minutes and allow five attempts.\n\nAccess: Public",
"security": [],
"parameters": [],
"responses": {
"200": {
"description": "Successful response"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"409": {
"$ref": "#/components/responses/Conflict"
},
"422": {
"$ref": "#/components/responses/Invalid"
},
"429": {
"$ref": "#/components/responses/RateLimited"
},
"500": {
"$ref": "#/components/responses/Failed"
}
},
"servers": [
{
"url": "https://app.digitalcard.technology"
},
{
"url": "https://admin.digitalcard.technology"
},
{
"url": "https://card.digitalcard.technology"
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"challengeId": {
"type": "string",
"pattern": "^[A-Za-z0-9_-]{12,100}$"
},
"code": {
"type": "string",
"pattern": "^\\d{6}$"
}
},
"required": [
"challengeId",
"code"
]
}
}
}
}
} /api/v1/auth/sessionRead the current session
Returns the authenticated principal and its company, program and beneficiary scope.
AccessAuthenticated session or API key
Success: 200 · Request completed.
OpenAPI operation and schemas
{
"operationId": "get__api_v1_auth_session",
"tags": [
"Authentication"
],
"summary": "Read the current session",
"description": "Returns the authenticated principal and its company, program and beneficiary scope.\n\nAccess: Authenticated session or API key",
"security": [
{
"session": []
},
{
"apiKey": []
}
],
"parameters": [],
"responses": {
"200": {
"description": "Successful response"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"409": {
"$ref": "#/components/responses/Conflict"
},
"422": {
"$ref": "#/components/responses/Invalid"
},
"429": {
"$ref": "#/components/responses/RateLimited"
},
"500": {
"$ref": "#/components/responses/Failed"
}
},
"servers": [
{
"url": "https://app.digitalcard.technology"
},
{
"url": "https://admin.digitalcard.technology"
},
{
"url": "https://card.digitalcard.technology"
}
]
} /api/v1/auth/sign-outSign out
Revokes the current session and clears the session cookie.
AccessAuthenticated session
Success: 200 · Request completed.
OpenAPI operation and schemas
{
"operationId": "post__api_v1_auth_sign_out",
"tags": [
"Authentication"
],
"summary": "Sign out",
"description": "Revokes the current session and clears the session cookie.\n\nAccess: Authenticated session",
"security": [
{
"session": []
},
{
"apiKey": []
}
],
"parameters": [],
"responses": {
"200": {
"description": "Successful response"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"409": {
"$ref": "#/components/responses/Conflict"
},
"422": {
"$ref": "#/components/responses/Invalid"
},
"429": {
"$ref": "#/components/responses/RateLimited"
},
"500": {
"$ref": "#/components/responses/Failed"
}
},
"servers": [
{
"url": "https://app.digitalcard.technology"
},
{
"url": "https://admin.digitalcard.technology"
},
{
"url": "https://card.digitalcard.technology"
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {}
}
}
}
}
} /api/v1/auth/workspacesList company memberships
Lists the active companies available to the signed-in user.
AccessCompany session
Success: 200 · Request completed.
OpenAPI operation and schemas
{
"operationId": "get__api_v1_auth_workspaces",
"tags": [
"Authentication"
],
"summary": "List company memberships",
"description": "Lists the active companies available to the signed-in user.\n\nAccess: Company session",
"security": [
{
"session": []
}
],
"parameters": [],
"responses": {
"200": {
"description": "Successful response"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"409": {
"$ref": "#/components/responses/Conflict"
},
"422": {
"$ref": "#/components/responses/Invalid"
},
"429": {
"$ref": "#/components/responses/RateLimited"
},
"500": {
"$ref": "#/components/responses/Failed"
}
},
"servers": [
{
"url": "https://app.digitalcard.technology"
},
{
"url": "https://admin.digitalcard.technology"
},
{
"url": "https://card.digitalcard.technology"
}
]
} /api/v1/auth/workspaceSwitch company workspace
Creates a session scoped to the selected active membership.
AccessCompany session
| Body field | Type | Details |
|---|---|---|
companyIdrequired | string |
Success: 200 · Request completed.
OpenAPI operation and schemas
{
"operationId": "post__api_v1_auth_workspace",
"tags": [
"Authentication"
],
"summary": "Switch company workspace",
"description": "Creates a session scoped to the selected active membership.\n\nAccess: Company session",
"security": [
{
"session": []
}
],
"parameters": [],
"responses": {
"200": {
"description": "Successful response"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"409": {
"$ref": "#/components/responses/Conflict"
},
"422": {
"$ref": "#/components/responses/Invalid"
},
"429": {
"$ref": "#/components/responses/RateLimited"
},
"500": {
"$ref": "#/components/responses/Failed"
}
},
"servers": [
{
"url": "https://app.digitalcard.technology"
},
{
"url": "https://admin.digitalcard.technology"
},
{
"url": "https://card.digitalcard.technology"
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"companyId": {
"type": "string",
"pattern": "^[A-Za-z0-9_-]{12,100}$"
}
},
"required": [
"companyId"
]
}
}
}
}
}