Every API here is available over the APIs.io API and to AI agents over MCP.
openapi: 3.2.0
info:
title: Stytch B2B Authentication B2B Recovery Codes API
version: 2.0.0
description: Stytch's B2B API for multi-tenant authentication. Supports Organizations, Members, SSO (SAML/OIDC), Magic Links, OTP, OAuth, Discovery, Sessions, B2B RBAC, SCIM, TOTP, Recovery Codes, Passwords, Impersonation, and the B2B IDP.
contact:
name: Stytch
url: https://stytch.com/docs
license:
name: Proprietary
servers:
- url: https://api.stytch.com
description: Production
- url: https://test.stytch.com
description: Test
tags:
- name: B2B Recovery Codes
paths:
/v1/b2b/recovery_codes/recover:
post:
summary: Recover
operationId: api_b2b_recovery_codes_v1_Recover
tags:
- B2B Recovery Codes
description: Allows a Member to complete an MFA flow by consuming a recovery code. This consumes the recovery code and returns a session token that can be used to authenticate the Member.
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/api_b2b_recovery_codes_v1_RecoverRequest'
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/api_b2b_recovery_codes_v1_RecoverResponse'
'400':
description: Bad request
'401':
description: Unauthorized
content:
application/json:
example:
status_code: 401
request_id: request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141
error_type: unauthorized_credentials
error_message: Unauthorized credentials.
error_url: https://stytch.com/docs/api/errors/401
'429':
description: Too Many Requests
content:
application/json:
example:
status_code: 429
request_id: request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141
error_type: too_many_requests
error_message: Too many requests have been made.
error_url: https://stytch.com/docs/api/errors/429
'500':
description: Internal server error
content:
application/json:
example:
status_code: 500
request_id: request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141
error_type: internal_server_error
error_message: Oops, something seems to have gone wrong, please reach out to support@stytch.com to let us know what went wrong.
error_url: https://stytch.com/docs/api/errors/500
x-code-samples:
- lang: csharp
label: C#
source: "// POST /v1/b2b/recovery_codes/recover\nconst stytch = require('stytch');\n\nconst client = new stytch.B2BClient({\n project_id: '${projectId}',\n secret: '${secret}',\n});\n\nconst params = {\n organization_id: \"${organizationId}\",\n member_id: \"${memberId}\",\n recovery_code: \"${exampleTotpRecoveryCode}\",\n};\n\nclient.RecoveryCodes.Recover(params)\n .then(resp => { console.log(resp) })\n .catch(err => { console.log(err) });"
- lang: go
label: Go
source: "// POST /v1/b2b/recovery_codes/recover\npackage main\n\nimport (\n\t\"context\"\n\t\"log\"\n\n\t\"github.com/stytchauth/stytch-go/v17/stytch/b2b/b2bstytchapi\"\n\t\"github.com/stytchauth/stytch-go/v17/stytch/b2b/recoverycodes\"\n)\n\nfunc main() {\n\tclient, err := b2bstytchapi.NewClient(\n\t\t\"${projectId}\",\n\t\t\"${secret}\",\n\t)\n\tif err != nil {\n\t\tlog.Fatalf(\"error instantiating client: %v\", err)\n\t}\n\n\tparams := &recoverycodes.RecoverParams{\n\t\tOrganizationID: \"${organizationId}\",\n\t\tMemberID: \"${memberId}\",\n\t\tRecoveryCode: \"${exampleTotpRecoveryCode}\",\n\t}\n\n\tresp, err := client.RecoveryCodes.Recover(context.Background(), params)\n\tif err != nil {\n\t\tlog.Fatalf(\"error in method call: %v\", err)\n\t}\n\n\tlog.Println(resp)\n}\n"
- lang: java
label: Java
source: "// POST /v1/b2b/recovery_codes/recover\npackage com.example;\n\nimport com.stytch.java.b2b.models.recoverycodes.RecoverRequest;\nimport com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.StytchResult;\n\npublic class Main {\n public static void main(String[] args) {\n StytchB2BClient.configure(\"${projectId}\", \"${secret}\");\n\n RecoverRequest params = new RecoverRequest();\n params.setOrganizationId(\"${organizationId}\");\n params.setMemberId(\"${memberId}\");\n params.setRecoveryCode(\"${exampleTotpRecoveryCode}\");\n\n Object result = StytchB2BClient.getRecoveryCodes().recover(params);\n if (result instanceof StytchResult.Success) {\n System.out.println(((StytchResult.Success) result).getValue());\n } else {\n System.out.println(((StytchResult.Error) result).getException());\n }\n }\n}"
- lang: kotlin
label: Kotlin
source: "// POST /v1/b2b/recovery_codes/recover\npackage com.example\n\nimport com.stytch.java.b2b.StytchB2BClient\nimport com.stytch.java.b2b.models.recoverycodes.RecoverRequest\n\nfun main() {\n StytchB2BClient.configure(\n projectId = \"${projectId}\",\n secret = \"${secret}\",\n )\n\n when (\n val result =\n StytchB2BClient.recoveryCodes.recover(\n RecoverRequest(\n organizationId = \"${organizationId}\",\n memberId = \"${memberId}\",\n recoveryCode = \"${exampleTotpRecoveryCode}\",\n ),\n )\n ) {\n is StytchResult.Success -> println(result.value)\n is StytchResult.Error -> println(result.exception)\n }\n}\n"
- lang: javascript
label: Node.js
source: "// POST /v1/b2b/recovery_codes/recover\nconst stytch = require('stytch');\n\nconst client = new stytch.B2BClient({\n project_id: '${projectId}',\n secret: '${secret}',\n});\n\nconst params = {\n organization_id: \"${organizationId}\",\n member_id: \"${memberId}\",\n recovery_code: \"${exampleTotpRecoveryCode}\",\n};\n\nclient.recoveryCodes.recover(params)\n .then(resp => { console.log(resp) })\n .catch(err => { console.log(err) });"
- lang: php
label: PHP
source: "$response = $client->recovery_codes->recover([\n 'organization_id' => '${organizationId}',\n 'member_id' => '${memberId}',\n 'recovery_code' => '${exampleTotpRecoveryCode}',\n]);"
- lang: python
label: Python
source: "# POST /v1/b2b/recovery_codes/recover\nfrom stytch import B2BClient\n\nclient = B2BClient(\n project_id=\"${projectId}\",\n secret=\"${secret}\",\n)\n\nresp = client.recovery_codes.recover(\n organization_id=\"${organizationId}\",\n member_id=\"${memberId}\",\n recovery_code=\"${exampleTotpRecoveryCode}\",\n)\n\nprint(resp)\n"
- lang: ruby
label: Ruby
source: "# POST /v1/b2b/recovery_codes/recover\nrequire 'stytch'\n\nclient = StytchB2B::Client.new(\n project_id: \"${projectId}\",\n secret: \"${secret}\"\n)\n\nresp = client.recovery_codes.recover(\n organization_id: \"${organizationId}\",\n member_id: \"${memberId}\",\n recovery_code: \"${exampleTotpRecoveryCode}\"\n \n)\n\nputs resp"
- lang: rust
label: Rust
source: "// POST /v1/b2b/recovery_codes/recover\nuse stytch::b2b::client::Client;\nuse stytch::b2b::recovery_codes::RecoverRequest;\n\nfn main() {\n let client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n let resp = client.recovery_codes.recover(\n RecoverRequest{\n organization_id: \"${organizationId}\",\n member_id: \"${memberId}\",\n recovery_code: \"${exampleTotpRecoveryCode}\",\n ..Default::default()\n }\n ).await;\n println!(\"The response is {:?}\", resp);\n}"
- lang: bash
label: cURL
source: "# POST /v1/b2b/recovery_codes/recover\ncurl --request POST \\\n --url https://test.stytch.com/v1/b2b/recovery_codes/recover \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"organization_id\": \"${organizationId}\",\n \"member_id\": \"${memberId}\",\n \"recovery_code\": \"${exampleTotpRecoveryCode}\"\n }'"
/v1/b2b/recovery_codes/{organization_id}/{member_id}:
get:
summary: Get
operationId: api_b2b_recovery_codes_v1_Get
tags:
- B2B Recovery Codes
description: Returns a Member's full set of active recovery codes.
parameters:
- name: organization_id
in: path
required: true
schema:
type: string
description: Globally unique UUID that identifies a specific Organization. The `organization_id` is critical to perform operations on an Organization, so be sure to preserve this value. You may also use the organization_slug or organization_external_id here as a convenience.
description: Globally unique UUID that identifies a specific Organization. The `organization_id` is critical to perform operations on an Organization, so be sure to preserve this value. You may also use the organization_slug or organization_external_id here as a convenience.
- name: member_id
in: path
required: true
schema:
type: string
description: Globally unique UUID that identifies a specific Member. The `member_id` is critical to perform operations on a Member, so be sure to preserve this value. You may use an external_id here if one is set for the member.
description: Globally unique UUID that identifies a specific Member. The `member_id` is critical to perform operations on a Member, so be sure to preserve this value. You may use an external_id here if one is set for the member.
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/api_b2b_recovery_codes_v1_GetResponse'
'400':
description: Bad request
'401':
description: Unauthorized
content:
application/json:
example:
status_code: 401
request_id: request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141
error_type: unauthorized_credentials
error_message: Unauthorized credentials.
error_url: https://stytch.com/docs/api/errors/401
'429':
description: Too Many Requests
content:
application/json:
example:
status_code: 429
request_id: request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141
error_type: too_many_requests
error_message: Too many requests have been made.
error_url: https://stytch.com/docs/api/errors/429
'500':
description: Internal server error
content:
application/json:
example:
status_code: 500
request_id: request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141
error_type: internal_server_error
error_message: Oops, something seems to have gone wrong, please reach out to support@stytch.com to let us know what went wrong.
error_url: https://stytch.com/docs/api/errors/500
x-code-samples:
- lang: csharp
label: C#
source: "// GET /v1/b2b/recovery_codes/{organization_id}/{member_id}\nconst stytch = require('stytch');\n\nconst client = new stytch.B2BClient({\n project_id: '${projectId}',\n secret: '${secret}',\n});\n\nconst params = {\n organization_id: \"${organizationId}\",\n member_id: \"${memberId}\",\n};\n\nclient.RecoveryCodes.Get(params)\n .then(resp => { console.log(resp) })\n .catch(err => { console.log(err) });"
- lang: go
label: Go
source: "// GET /v1/b2b/recovery_codes/{organization_id}/{member_id}\npackage main\n\nimport (\n\t\"context\"\n\t\"log\"\n\n\t\"github.com/stytchauth/stytch-go/v17/stytch/b2b/b2bstytchapi\"\n\t\"github.com/stytchauth/stytch-go/v17/stytch/b2b/recoverycodes\"\n)\n\nfunc main() {\n\tclient, err := b2bstytchapi.NewClient(\n\t\t\"${projectId}\",\n\t\t\"${secret}\",\n\t)\n\tif err != nil {\n\t\tlog.Fatalf(\"error instantiating client: %v\", err)\n\t}\n\n\tparams := &recoverycodes.GetParams{\n\t\tOrganizationID: \"${organizationId}\",\n\t\tMemberID: \"${memberId}\",\n\t}\n\n\tresp, err := client.RecoveryCodes.Get(context.Background(), params)\n\tif err != nil {\n\t\tlog.Fatalf(\"error in method call: %v\", err)\n\t}\n\n\tlog.Println(resp)\n}\n"
- lang: java
label: Java
source: "// GET /v1/b2b/recovery_codes/{organization_id}/{member_id}\npackage com.example;\n\nimport com.stytch.java.b2b.models.recoverycodes.GetRequest;\nimport com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.StytchResult;\n\npublic class Main {\n public static void main(String[] args) {\n StytchB2BClient.configure(\"${projectId}\", \"${secret}\");\n\n GetRequest params = new GetRequest();\n params.setOrganizationId(\"${organizationId}\");\n params.setMemberId(\"${memberId}\");\n\n Object result = StytchB2BClient.getRecoveryCodes().get(params);\n if (result instanceof StytchResult.Success) {\n System.out.println(((StytchResult.Success) result).getValue());\n } else {\n System.out.println(((StytchResult.Error) result).getException());\n }\n }\n}"
- lang: kotlin
label: Kotlin
source: "// GET /v1/b2b/recovery_codes/{organization_id}/{member_id}\npackage com.example\n\nimport com.stytch.java.b2b.StytchB2BClient\nimport com.stytch.java.b2b.models.recoverycodes.GetRequest\n\nfun main() {\n StytchB2BClient.configure(\n projectId = \"${projectId}\",\n secret = \"${secret}\",\n )\n\n when (\n val result =\n StytchB2BClient.recoveryCodes.get(\n GetRequest(\n organizationId = \"${organizationId}\",\n memberId = \"${memberId}\",\n ),\n )\n ) {\n is StytchResult.Success -> println(result.value)\n is StytchResult.Error -> println(result.exception)\n }\n}\n"
- lang: javascript
label: Node.js
source: "// GET /v1/b2b/recovery_codes/{organization_id}/{member_id}\nconst stytch = require('stytch');\n\nconst client = new stytch.B2BClient({\n project_id: '${projectId}',\n secret: '${secret}',\n});\n\nconst params = {\n organization_id: \"${organizationId}\",\n member_id: \"${memberId}\",\n};\n\nclient.recoveryCodes.get(params)\n .then(resp => { console.log(resp) })\n .catch(err => { console.log(err) });"
- lang: php
label: PHP
source: "$response = $client->recovery_codes->get([\n 'organization_id' => '${organizationId}',\n 'member_id' => '${memberId}',\n]);"
- lang: python
label: Python
source: "# GET /v1/b2b/recovery_codes/{organization_id}/{member_id}\nfrom stytch import B2BClient\n\nclient = B2BClient(\n project_id=\"${projectId}\",\n secret=\"${secret}\",\n)\n\nresp = client.recovery_codes.get(\n organization_id=\"${organizationId}\",\n member_id=\"${memberId}\",\n)\n\nprint(resp)\n"
- lang: ruby
label: Ruby
source: "# GET /v1/b2b/recovery_codes/{organization_id}/{member_id}\nrequire 'stytch'\n\nclient = StytchB2B::Client.new(\n project_id: \"${projectId}\",\n secret: \"${secret}\"\n)\n\nresp = client.recovery_codes.get(\n organization_id: \"${organizationId}\",\n member_id: \"${memberId}\"\n \n)\n\nputs resp"
- lang: rust
label: Rust
source: "// GET /v1/b2b/recovery_codes/{organization_id}/{member_id}\nuse stytch::b2b::client::Client;\nuse stytch::b2b::recovery_codes::GetRequest;\n\nfn main() {\n let client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n let resp = client.recovery_codes.get(\n GetRequest{\n organization_id: \"${organizationId}\",\n member_id: \"${memberId}\",\n ..Default::default()\n }\n ).await;\n println!(\"The response is {:?}\", resp);\n}"
- lang: bash
label: cURL
source: "# GET /v1/b2b/recovery_codes/{organization_id}/{member_id}\ncurl --request GET \\\n --url https://test.stytch.com/v1/b2b/recovery_codes/${organizationId}/${memberId} \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json'"
/v1/b2b/recovery_codes/rotate:
post:
summary: Rotate
operationId: api_b2b_recovery_codes_v1_Rotate
tags:
- B2B Recovery Codes
description: Rotate a Member's recovery codes. This invalidates all existing recovery codes and generates a new set of recovery codes.
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/api_b2b_recovery_codes_v1_RotateRequest'
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/api_b2b_recovery_codes_v1_RotateResponse'
'400':
description: Bad request
'401':
description: Unauthorized
content:
application/json:
example:
status_code: 401
request_id: request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141
error_type: unauthorized_credentials
error_message: Unauthorized credentials.
error_url: https://stytch.com/docs/api/errors/401
'429':
description: Too Many Requests
content:
application/json:
example:
status_code: 429
request_id: request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141
error_type: too_many_requests
error_message: Too many requests have been made.
error_url: https://stytch.com/docs/api/errors/429
'500':
description: Internal server error
content:
application/json:
example:
status_code: 500
request_id: request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141
error_type: internal_server_error
error_message: Oops, something seems to have gone wrong, please reach out to support@stytch.com to let us know what went wrong.
error_url: https://stytch.com/docs/api/errors/500
x-code-samples:
- lang: csharp
label: C#
source: "// POST /v1/b2b/recovery_codes/rotate\nconst stytch = require('stytch');\n\nconst client = new stytch.B2BClient({\n project_id: '${projectId}',\n secret: '${secret}',\n});\n\nconst params = {\n organization_id: \"${organizationId}\",\n member_id: \"${memberId}\",\n};\n\nclient.RecoveryCodes.Rotate(params)\n .then(resp => { console.log(resp) })\n .catch(err => { console.log(err) });"
- lang: go
label: Go
source: "// POST /v1/b2b/recovery_codes/rotate\npackage main\n\nimport (\n\t\"context\"\n\t\"log\"\n\n\t\"github.com/stytchauth/stytch-go/v17/stytch/b2b/b2bstytchapi\"\n\t\"github.com/stytchauth/stytch-go/v17/stytch/b2b/recoverycodes\"\n)\n\nfunc main() {\n\tclient, err := b2bstytchapi.NewClient(\n\t\t\"${projectId}\",\n\t\t\"${secret}\",\n\t)\n\tif err != nil {\n\t\tlog.Fatalf(\"error instantiating client: %v\", err)\n\t}\n\n\tparams := &recoverycodes.RotateParams{\n\t\tOrganizationID: \"${organizationId}\",\n\t\tMemberID: \"${memberId}\",\n\t}\n\n\tresp, err := client.RecoveryCodes.Rotate(context.Background(), params)\n\tif err != nil {\n\t\tlog.Fatalf(\"error in method call: %v\", err)\n\t}\n\n\tlog.Println(resp)\n}\n"
- lang: java
label: Java
source: "// POST /v1/b2b/recovery_codes/rotate\npackage com.example;\n\nimport com.stytch.java.b2b.models.recoverycodes.RotateRequest;\nimport com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.StytchResult;\n\npublic class Main {\n public static void main(String[] args) {\n StytchB2BClient.configure(\"${projectId}\", \"${secret}\");\n\n RotateRequest params = new RotateRequest();\n params.setOrganizationId(\"${organizationId}\");\n params.setMemberId(\"${memberId}\");\n\n Object result = StytchB2BClient.getRecoveryCodes().rotate(params);\n if (result instanceof StytchResult.Success) {\n System.out.println(((StytchResult.Success) result).getValue());\n } else {\n System.out.println(((StytchResult.Error) result).getException());\n }\n }\n}"
- lang: kotlin
label: Kotlin
source: "// POST /v1/b2b/recovery_codes/rotate\npackage com.example\n\nimport com.stytch.java.b2b.StytchB2BClient\nimport com.stytch.java.b2b.models.recoverycodes.RotateRequest\n\nfun main() {\n StytchB2BClient.configure(\n projectId = \"${projectId}\",\n secret = \"${secret}\",\n )\n\n when (\n val result =\n StytchB2BClient.recoveryCodes.rotate(\n RotateRequest(\n organizationId = \"${organizationId}\",\n memberId = \"${memberId}\",\n ),\n )\n ) {\n is StytchResult.Success -> println(result.value)\n is StytchResult.Error -> println(result.exception)\n }\n}\n"
- lang: javascript
label: Node.js
source: "// POST /v1/b2b/recovery_codes/rotate\nconst stytch = require('stytch');\n\nconst client = new stytch.B2BClient({\n project_id: '${projectId}',\n secret: '${secret}',\n});\n\nconst params = {\n organization_id: \"${organizationId}\",\n member_id: \"${memberId}\",\n};\n\nclient.recoveryCodes.rotate(params)\n .then(resp => { console.log(resp) })\n .catch(err => { console.log(err) });"
- lang: php
label: PHP
source: "$response = $client->recovery_codes->rotate([\n 'organization_id' => '${organizationId}',\n 'member_id' => '${memberId}',\n]);"
- lang: python
label: Python
source: "# POST /v1/b2b/recovery_codes/rotate\nfrom stytch import B2BClient\n\nclient = B2BClient(\n project_id=\"${projectId}\",\n secret=\"${secret}\",\n)\n\nresp = client.recovery_codes.rotate(\n organization_id=\"${organizationId}\",\n member_id=\"${memberId}\",\n)\n\nprint(resp)\n"
- lang: ruby
label: Ruby
source: "# POST /v1/b2b/recovery_codes/rotate\nrequire 'stytch'\n\nclient = StytchB2B::Client.new(\n project_id: \"${projectId}\",\n secret: \"${secret}\"\n)\n\nresp = client.recovery_codes.rotate(\n organization_id: \"${organizationId}\",\n member_id: \"${memberId}\"\n \n)\n\nputs resp"
- lang: rust
label: Rust
source: "// POST /v1/b2b/recovery_codes/rotate\nuse stytch::b2b::client::Client;\nuse stytch::b2b::recovery_codes::RotateRequest;\n\nfn main() {\n let client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n let resp = client.recovery_codes.rotate(\n RotateRequest{\n organization_id: \"${organizationId}\",\n member_id: \"${memberId}\",\n ..Default::default()\n }\n ).await;\n println!(\"The response is {:?}\", resp);\n}"
- lang: bash
label: cURL
source: "# POST /v1/b2b/recovery_codes/rotate\ncurl --request POST \\\n --url https://test.stytch.com/v1/b2b/recovery_codes/rotate \\\n -u '${projectId}:${secret}' \\\n -H 'Content-Type: application/json' \\\n -d '{\n \"organization_id\": \"${organizationId}\",\n \"member_id\": \"${memberId}\"\n }'"
components:
schemas:
api_organization_v1_ActiveSSOConnection:
type: object
properties:
connection_id:
type: string
description: Globally unique UUID that identifies a specific SSO `connection_id` for a Member.
display_name:
type: string
description: A human-readable display name for the connection.
identity_provider:
type: string
required:
- connection_id
- display_name
- identity_provider
api_b2b_session_v1_MemberSession:
type: object
properties:
member_session_id:
type: string
description: Globally unique UUID that identifies a specific Session.
member_id:
type: string
description: Globally unique UUID that identifies a specific Member.
started_at:
type: string
description: The timestamp when the Session was created. Values conform to the RFC 3339 standard and are expressed in UTC, e.g. `2021-12-29T12:33:09Z`.
last_accessed_at:
type: string
description: The timestamp when the Session was last accessed. Values conform to the RFC 3339 standard and are expressed in UTC, e.g. `2021-12-29T12:33:09Z`.
expires_at:
type: string
description: The timestamp when the Session expires. Values conform to the RFC 3339 standard and are expressed in UTC, e.g. `2021-12-29T12:33:09Z`.
authentication_factors:
type: array
items:
$ref: '#/components/schemas/api_session_v1_AuthenticationFactor'
description: An array of different authentication factors that comprise a Session.
organization_id:
type: string
description: Globally unique UUID that identifies a specific Organization. The `organization_id` is critical to perform operations on an Organization, so be sure to preserve this value.
roles:
type: array
items:
type: string
organization_slug:
type: string
description: 'The unique URL slug of the Organization. The slug only accepts alphanumeric characters and the following reserved characters: `-` `.` `_` `~`. Must be between 2 and 128 characters in length. Wherever an organization_id is expected in a path or request parameter, you may also use the organization_slug as a convenience.'
custom_claims:
type: object
additionalProperties: true
description: The custom claims map for a Session. Claims can be added to a session during a Sessions authenticate call.
required:
- member_session_id
- member_id
- started_at
- last_accessed_at
- expires_at
- authentication_factors
- organization_id
- roles
- organization_slug
api_organization_v1_SSORegistration:
type: object
properties:
connection_id:
type: string
description: Globally unique UUID that identifies a specific SSO `connection_id` for a Member.
external_id:
type: string
description: The ID of the member given by the identity provider.
registration_id:
type: string
description: The unique ID of an SSO Registration.
sso_attributes:
type: object
additionalProperties: true
description: An object for storing SSO attributes brought over from the identity provider.
required:
- connection_id
- external_id
- registration_id
api_b2b_recovery_codes_v1_RecoverResponse:
type: object
properties:
request_id:
type: string
description: Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue.
member_id:
type: string
description: Globally unique UUID that identifies a specific Member.
member:
$ref: '#/components/schemas/api_organization_v1_Member'
description: The [Member object](https://stytch.com/docs/b2b/api/member-object)
organization:
$ref: '#/components/schemas/api_organization_v1_Organization'
description: The [Organization object](https://stytch.com/docs/b2b/api/organization-object).
session_token:
type: string
description: A secret token for a given Stytch Session.
session_jwt:
type: string
description: The JSON Web Token (JWT) for a given Stytch Session.
recovery_codes_remaining:
type: integer
format: int32
description: The number of recovery codes remaining for a Member.
status_code:
type: integer
format: int32
description: The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors.
member_session:
$ref: '#/components/schemas/api_b2b_session_v1_MemberSession'
description: The [Session object](https://stytch.com/docs/b2b/api/session-object).
member_device:
$ref: '#/components/schemas/api_device_history_v1_DeviceInfo'
description: If a valid `telemetry_id` was passed in the request and the [Fingerprint Lookup API](https://stytch.com/docs/fraud/api/fingerprint-lookup) returned results, the `member_device` response field will contain information about the member's device attributes.
required:
- request_id
- member_id
- member
- organization
- session_token
- session_jwt
- recovery_codes_remaining
- status_code
api_session_v1_LinkedInOAuthFactor:
type: object
properties:
id:
type: string
provider_subject:
type: string
email_id:
type: string
required:
- id
- provider_subject
api_b2b_scim_v1_Entitlement:
type: object
properties:
value:
type: string
type:
type: string
primary:
type: boolean
required:
- value
- type
- primary
api_session_v1_AppleOAuthFactor:
type: object
properties:
id:
type: string
provider_subject:
type: string
email_id:
type: string
required:
- id
- provider_subject
api_b2b_scim_v1_SCIMAttributes:
type: object
properties:
user_name:
type: string
id:
type: string
external_id:
type: string
active:
type: boolean
groups:
type: array
items:
$ref: '#/components/schemas/api_b2b_scim_v1_Group'
display_name:
type: string
nick_name:
type: string
profile_url:
type: string
user_type:
type: string
title:
type: string
preferred_language:
type: string
locale:
type: string
timezone:
type: string
emails:
type: array
items:
$ref: '#/components/schemas/api_b2b_scim_v1_Email'
phone_numbers:
type: array
items:
$ref: '#/components/schemas/api_b2b_scim_v1_PhoneNumber'
addresses:
type: array
items:
$ref: '#/components/schemas/api_b2b_scim_v1_Address'
ims:
type: array
items:
$ref: '#/components/schemas/api_b2b_scim_v1_IMs'
photos:
type: array
items:
$ref: '#/components/schemas/api_b2b_scim_v1_Photo'
entitlements:
type: array
items:
$ref: '#/components/schemas/api_b2b_scim_v1_Entitlement'
roles:
type: array
items:
$ref: '#/components/schemas/api_b2b_scim_v1_Role'
x509certificates:
type: array
items:
$ref: '#/components/schemas/api_b2b_scim_v1_X509Certificate'
name:
$ref: '#/components/schemas/api_b2b_scim_v1_Name'
enterprise_extension:
$ref: '#/components/schemas/api_b2b_scim_v1_EnterpriseExtension'
required:
- user_name
- id
- external_id
- active
- groups
- display_name
- nick_name
- profile_url
- user_type
- title
- preferred_language
- locale
# --- truncated at 32 KB (93 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/stytch/refs/heads/main/openapi/stytch-b2b-recovery-codes-api-openapi.yml