/ Developers API v1Open workspace

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.

POST/api/v1/auth/register

Register a company

Creates a company workspace and emails a sign-in code. Available on the company hostname.

AccessPublic

Body fieldTypeDetails
namerequiredstringLength: 2 to 160.
legalNamerequiredstringLength: 2 to 200.
countryrequiredstring
timezonestring
websitestringFormat: uri
emailrequiredstringFormat: email

Success: 201 · Resource created.

OpenAPI operation and schemas
OpenAPI 3.1
{
  "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"
          ]
        }
      }
    }
  }
}
POST/api/v1/auth/request-code

Request a sign-in code

Requests a six-digit email code. The current hostname determines the company, administrator or beneficiary realm.

AccessPublic

Body fieldTypeDetails
emailrequiredstringFormat: email
companyIdstring

Success: 202 · Accepted for asynchronous processing. Read the operation for the confirmed provider outcome.

OpenAPI operation and schemas
OpenAPI 3.1
{
  "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"
          ]
        }
      }
    }
  }
}
POST/api/v1/auth/verify-code

Verify 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 fieldTypeDetails
challengeIdrequiredstring
coderequiredstring

Success: 200 · Request completed.

OpenAPI operation and schemas
OpenAPI 3.1
{
  "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"
          ]
        }
      }
    }
  }
}
GET/api/v1/auth/session

Read 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
OpenAPI 3.1
{
  "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"
    }
  ]
}
POST/api/v1/auth/sign-out

Sign out

Revokes the current session and clears the session cookie.

AccessAuthenticated session

Success: 200 · Request completed.

OpenAPI operation and schemas
OpenAPI 3.1
{
  "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": {}
        }
      }
    }
  }
}
GET/api/v1/auth/workspaces

List company memberships

Lists the active companies available to the signed-in user.

AccessCompany session

Success: 200 · Request completed.

OpenAPI operation and schemas
OpenAPI 3.1
{
  "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"
    }
  ]
}
POST/api/v1/auth/workspace

Switch company workspace

Creates a session scoped to the selected active membership.

AccessCompany session

Body fieldTypeDetails
companyIdrequiredstring

Success: 200 · Request completed.

OpenAPI operation and schemas
OpenAPI 3.1
{
  "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"
          ]
        }
      }
    }
  }
}

Search documentation

Use ↑ ↓ to navigate · Enter to open