{
  "openapi": "3.0.3",
  "info": {
    "title": "WebAuthn Credentials",
    "description": "View and manage WebAuthn credentials that were registered for a given user. This does not apply to credentials registered via 'WebAuthn Hosted'.",
    "version": ""
  },
  "servers": [
    {
      "url": "https://api.sbx.transmitsecurity.io/cis",
      "description": "Sandbox environment"
    },
    {
      "url": "https://api.transmitsecurity.io/cis",
      "description": "US production environment"
    },
    {
      "url": "https://api.eu.transmitsecurity.io/cis",
      "description": "EU production environment"
    },
    {
      "url": "https://api.ca.transmitsecurity.io/cis",
      "description": "CA production environment"
    },
    {
      "url": "https://api.au.transmitsecurity.io/cis",
      "description": "AU production environment"
    },
    {
      "url": "https://api.gasne1-ts01.transmitsecurity.io/cis",
      "description": "JP production environment"
    }
  ],
  "security": [],
  "paths": {
    "/v1/users/me/webauthn-credentials": {
      "get": {
        "description": "Retrieves all WebAuthn credentials of the user that's currently logged in. Since this requires a logged-in user, it must be authorized using a valid **user access token** returned upon successful authentication.",
        "operationId": "getCurrentUserWebauthnCredentials",
        "parameters": [],
        "responses": {
          "200": {
            "description": "List of credentials",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/UserWebauthnCredentialDto"
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "UserAccessToken": []
          }
        ],
        "summary": "Get my credentials"
      }
    },
    "/v1/users/me/webauthn-credentials/{credentialId}": {
      "get": {
        "description": "Retrieves a specific WebAuthn credential of the user that's currently logged in. Since this requires a logged-in user, it must be authorized using a valid **user access token** returned upon successful authentication.",
        "operationId": "getCurrentUserWebauthnCredential",
        "parameters": [
          {
            "name": "credentialId",
            "required": true,
            "in": "path",
            "description": "Credential ID, returned upon WebAuthn login. Must be URI encoded",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Credential info",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserWebauthnCredentialDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "UserAccessToken": []
          }
        ],
        "summary": "Get my credential by ID"
      },
      "patch": {
        "description": "Updates specific fields of a specific WebAuthn credential of the user that's currently logged in. Since this requires a logged-in user, it must be authorized using a valid **user access token** returned upon successful authentication.",
        "operationId": "updateCurrentUserWebauthnCredential",
        "parameters": [
          {
            "name": "credentialId",
            "required": true,
            "in": "path",
            "description": "Credential ID, returned upon WebAuthn login. Must be URI encoded",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserUpdateCredentialDto"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Update credential"
          }
        },
        "security": [
          {
            "UserAccessToken": []
          }
        ],
        "summary": "Update my credential"
      },
      "delete": {
        "description": "Deletes a specific WebAuthn credential of the user that's currently logged in. Once deleted, the credential status will be 'removed'. Since this requires a logged-in user, it must be authorized using a valid **user access token** returned upon successful authentication.\"",
        "operationId": "deleteCurrentUserWebauthnCredential",
        "parameters": [
          {
            "name": "credentialId",
            "required": true,
            "in": "path",
            "description": "Credential ID, **Should be URI encoded**.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Credential deleted"
          }
        },
        "security": [
          {
            "UserAccessToken": []
          }
        ],
        "summary": "Delete my credential"
      }
    },
    "/v1/users/{userId}/webauthn-credentials": {
      "get": {
        "description": "Retrieves all WebAuthn credentials of the given user. This requires a **client access token** of the application, and must be called from the backend. <br><br>**Required permissions**: `apps:read`, `[appId]:read`, `authenticators:read`.",
        "operationId": "getUserWebauthnCredentials",
        "parameters": [
          {
            "name": "userId",
            "required": true,
            "in": "path",
            "description": "User ID",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of credentials",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/UserWebauthnCredentialDto"
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "ClientAccessToken": []
          }
        ],
        "summary": "Get credentials"
      }
    },
    "/v1/users/{userId}/webauthn-credentials/{credentialId}": {
      "get": {
        "description": "Retrieves a specific Webauthn credential of the given user. This requires a **client access token** of the application, and must be called from the backend. <br><br>**Required permissions**: `apps:read`, `[appId]:read`, `authenticators:read`.",
        "operationId": "getUserWebauthnCredential",
        "parameters": [
          {
            "name": "userId",
            "required": true,
            "in": "path",
            "description": "User ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "credentialId",
            "required": true,
            "in": "path",
            "description": "Credential ID, **Should be URI encoded**.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Credential info",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserWebauthnCredentialDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "ClientAccessToken": []
          }
        ],
        "summary": "Get credential by ID"
      },
      "patch": {
        "description": "Updates specific fields of a specific WebAuthn credential of given user. This requires a **client access token** of the application, and must be called from the backend. <br><br>**Required permissions**: `apps:edit`, `[appId]:edit`, `authenticators:edit`.",
        "operationId": "updateUserWebauthnCredential",
        "parameters": [
          {
            "name": "userId",
            "required": true,
            "in": "path",
            "description": "ID of the user whom the credentials belong to",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "credentialId",
            "required": true,
            "in": "path",
            "description": "Credential ID, returned upon WebAuthn login. Must be URI encoded",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserUpdateCredentialDto"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Update credential"
          }
        },
        "security": [
          {
            "ClientAccessToken": []
          }
        ],
        "summary": "Update credential"
      },
      "delete": {
        "description": "Deletes a specific Webauthn credential of the given user. Once deleted, the credential status will be 'removed'. This requires a **client access token** of the application, and must be called from the backend. <br><br>**Required permissions**: `apps:delete`, `[appId]:delete`, `authenticators:delete`.",
        "operationId": "deleteUserWebauthnCredential",
        "parameters": [
          {
            "name": "userId",
            "required": true,
            "in": "path",
            "description": "User ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "credentialId",
            "required": true,
            "in": "path",
            "description": "Credential ID, **Should be URI encoded**.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Credential deleted"
          }
        },
        "security": [
          {
            "ClientAccessToken": []
          }
        ],
        "summary": "Delete credentials by ID"
      }
    }
  },
  "components": {
    "schemas": {
      "UserWebauthnCredentialDto": {
        "type": "object",
        "properties": {
          "first_seen": {
            "type": "string",
            "description": "Date the credential was registered, in ISO 8601"
          },
          "last_seen": {
            "type": "string",
            "description": "Date the credential was last used, in ISO 8601"
          },
          "app_id": {
            "type": "string",
            "description": "App ID"
          },
          "tenant_id": {
            "type": "string",
            "description": "Tenant ID"
          },
          "id": {
            "type": "string",
            "description": "Credential ID"
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "removed"
            ],
            "description": "Status of the credential. Deleted credentials have a status of 'removed'."
          },
          "username": {
            "type": "string",
            "description": "Username tied to the credential, set upon credential registration",
            "maxLength": 64,
            "minLength": 1
          },
          "display_name": {
            "type": "string",
            "description": "Display name for the user account.",
            "maxLength": 64,
            "minLength": 1
          },
          "devices": {
            "description": "List of devices that used the credential. Can contain multiple devices only for passkeys.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiUserWebauthnDeviceMetadataDto"
            }
          },
          "aaguid_info": {
            "description": "The authenticator's AAGUID Information",
            "allOf": [
              {
                "$ref": "#/components/schemas/ApiUserWebauthnAAGUIDInfoDto"
              }
            ]
          },
          "passkey_type": {
            "type": "string",
            "enum": [
              "synced",
              "device_bound"
            ],
            "description": "Passkey type, synced across devices or bound to a single device"
          },
          "sync_status": {
            "type": "string",
            "enum": [
              "synced",
              "not_synced"
            ],
            "description": "Backup state of the passkey. Only present for synced passkeys."
          },
          "attestation_status": {
            "type": "string",
            "enum": [
              "attested",
              "unattested"
            ],
            "description": "Reflects certificate chain validation at registration and current FIDO MDS status verification"
          }
        },
        "required": [
          "first_seen",
          "last_seen",
          "app_id",
          "tenant_id",
          "id",
          "status",
          "username",
          "display_name",
          "devices"
        ]
      },
      "UserUpdateCredentialDto": {
        "type": "object",
        "properties": {
          "display_name": {
            "type": "string",
            "description": "Display name for the user account.",
            "maxLength": 64,
            "minLength": 1
          }
        },
        "required": [
          "display_name"
        ]
      },
      "ApiUserWebauthnDeviceMetadataDto": {
        "type": "object",
        "properties": {
          "os_type": {
            "type": "string",
            "description": "Device OS type"
          },
          "os_version": {
            "type": "string",
            "description": "Device OS version"
          },
          "browser": {
            "type": "string",
            "description": "Browser name"
          },
          "user_agent": {
            "type": "string",
            "description": "User agent"
          },
          "first_seen": {
            "type": "string",
            "description": "Date the credential was first used by this device, in ISO 8601"
          },
          "last_seen": {
            "type": "string",
            "description": "Date the credential was last used by this device, in ISO 8601"
          }
        },
        "required": [
          "os_type",
          "os_version",
          "browser",
          "user_agent",
          "first_seen",
          "last_seen"
        ]
      },
      "ApiUserWebauthnAAGUIDInfoDto": {
        "type": "object",
        "properties": {
          "aaguid": {
            "type": "string",
            "description": "The authenticator AAGUID"
          },
          "passkey_provider_name": {
            "type": "string",
            "description": "The authenticator name"
          },
          "status": {
            "type": "string",
            "description": "The authenticator certificate status"
          }
        }
      }
    },
    "securitySchemes": {
      "bearer": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "type": "http"
      },
      "UserAccessToken": {
        "type": "http",
        "description": "A token returned upon end-user authentication, which provides access to resources and data for the user and app for which it was generated",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      },
      "AdminAccessToken": {
        "type": "oauth2",
        "flows": {
          "clientCredentials": {
            "tokenUrl": "/oidc/token",
            "scopes": {}
          }
        },
        "description": "A token generated by a management application using the [token endpoint](/openapi/token.openapi/other/getaccesstoken). It provides access to all resources for the tenant and its apps"
      },
      "ClientAccessToken": {
        "type": "oauth2",
        "flows": {
          "clientCredentials": {
            "tokenUrl": "/oidc/token",
            "scopes": {}
          }
        },
        "description": "A token generated by an end-user application using the [token endpoint](/openapi/token.openapi/other/getaccesstoken). It provides access to resources and data on the tenant level or associated with the specific application (but not other apps in the tenant)"
      },
      "OrgAdminAccessToken": {
        "type": "oauth2",
        "flows": {
          "clientCredentials": {
            "tokenUrl": "/oidc/token",
            "scopes": {}
          }
        },
        "description": "A token returned upon B2B authentication for a user that has the organizationAdmin or organizationCreator role."
      }
    }
  }
}