Corbado Identifiers API

Manage login identifiers (email, phone, username) attached to a user.

OpenAPI Specification

corbado-identifiers-api-openapi.yml Raw ↑
openapi: 3.0.1
info:
  title: Corbado Backend ConnectTokens Identifiers API
  description: The Corbado Backend API is a server-to-server REST API for the Corbado passkey-first authentication platform. It manages users, login identifiers, sessions, passkeys (WebAuthn credentials), passkey events, Connect tokens, and project data exports. Requests authenticate with HTTP Basic auth using the project ID as username and the API secret as password (both obtained from the Corbado Developer Panel).
  termsOfService: https://www.corbado.com/legal/terms
  contact:
    name: Corbado Support
    url: https://docs.corbado.com
    email: support@corbado.com
  version: 2.0.0
servers:
- url: https://backendapi.corbado.io/v2
  description: Corbado Backend API v2
security:
- basicAuth: []
tags:
- name: Identifiers
  description: Manage login identifiers (email, phone, username) attached to a user.
paths:
  /users/{userID}/identifiers:
    parameters:
    - $ref: '#/components/parameters/UserID'
    post:
      operationId: identifierCreate
      tags:
      - Identifiers
      summary: Create login identifier
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/IdentifierCreateReq'
      responses:
        '200':
          description: The created login identifier.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Identifier'
        '400':
          $ref: '#/components/responses/ErrorRsp'
  /users/{userID}/identifiers/{identifierID}:
    parameters:
    - $ref: '#/components/parameters/UserID'
    - name: identifierID
      in: path
      required: true
      schema:
        type: string
    patch:
      operationId: identifierUpdate
      tags:
      - Identifiers
      summary: Update identifier
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/IdentifierUpdateReq'
      responses:
        '200':
          description: The updated identifier.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Identifier'
        '404':
          $ref: '#/components/responses/ErrorRsp'
    delete:
      operationId: identifierDelete
      tags:
      - Identifiers
      summary: Delete identifier
      responses:
        '200':
          description: The identifier was deleted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericRsp'
        '404':
          $ref: '#/components/responses/ErrorRsp'
  /identifiers:
    get:
      operationId: identifierList
      tags:
      - Identifiers
      summary: List all login identifiers
      parameters:
      - $ref: '#/components/parameters/Sort'
      - $ref: '#/components/parameters/Filter'
      - $ref: '#/components/parameters/Page'
      - $ref: '#/components/parameters/PageSize'
      responses:
        '200':
          description: A paged list of login identifiers.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IdentifierList'
        '401':
          $ref: '#/components/responses/ErrorRsp'
components:
  schemas:
    ErrorRsp:
      type: object
      required:
      - httpStatusCode
      - message
      properties:
        httpStatusCode:
          type: integer
          format: int32
        message:
          type: string
        requestData:
          $ref: '#/components/schemas/RequestData'
        runtime:
          type: number
          format: float
        error:
          type: object
          properties:
            type:
              type: string
            details:
              type: string
            validation:
              type: array
              items:
                type: object
                properties:
                  field:
                    type: string
                  message:
                    type: string
    GenericRsp:
      type: object
      properties:
        httpStatusCode:
          type: integer
          format: int32
        message:
          type: string
        requestData:
          $ref: '#/components/schemas/RequestData'
        runtime:
          type: number
          format: float
    Identifier:
      type: object
      required:
      - identifierID
      - userID
      - identifierType
      - identifierValue
      - status
      properties:
        identifierID:
          type: string
          example: emai-2398470283402934
        userID:
          type: string
        identifierType:
          type: string
          enum:
          - email
          - phone
          - username
        identifierValue:
          type: string
          example: jane.doe@example.com
        status:
          type: string
          enum:
          - primary
          - verified
          - pending
        created:
          type: string
          format: date-time
    RequestData:
      type: object
      properties:
        requestID:
          type: string
        link:
          type: string
    IdentifierCreateReq:
      type: object
      required:
      - identifierType
      - identifierValue
      - status
      properties:
        identifierType:
          type: string
          enum:
          - email
          - phone
          - username
        identifierValue:
          type: string
        status:
          type: string
          enum:
          - primary
          - verified
          - pending
    Paging:
      type: object
      properties:
        page:
          type: integer
          format: int32
        totalPages:
          type: integer
          format: int32
        totalItems:
          type: integer
          format: int32
    IdentifierList:
      type: object
      required:
      - identifiers
      - paging
      properties:
        identifiers:
          type: array
          items:
            $ref: '#/components/schemas/Identifier'
        paging:
          $ref: '#/components/schemas/Paging'
    IdentifierUpdateReq:
      type: object
      properties:
        status:
          type: string
          enum:
          - primary
          - verified
          - pending
  parameters:
    Sort:
      name: sort
      in: query
      required: false
      description: Field and direction to sort by, e.g. created:desc.
      schema:
        type: string
    UserID:
      name: userID
      in: path
      required: true
      description: The Corbado user ID (e.g. usr-4693224802260150919).
      schema:
        type: string
    PageSize:
      name: pageSize
      in: query
      required: false
      schema:
        type: integer
        format: int32
        default: 10
    Filter:
      name: filter
      in: query
      required: false
      description: Repeatable filter expressions, e.g. status:eq:active.
      schema:
        type: array
        items:
          type: string
    Page:
      name: page
      in: query
      required: false
      schema:
        type: integer
        format: int32
        default: 1
  responses:
    ErrorRsp:
      description: An error response.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorRsp'
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: HTTP Basic authentication. The username is the project ID (e.g. pro-1234567890) and the password is the API secret, both issued from the Corbado Developer Panel.