openapi: 3.0.3
info:
title: Stytch B2B Authentication Application 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_session_v1_SlackOAuthFactor:
type: object
properties:
id:
type: string
description: The unique ID of an OAuth registration.
provider_subject:
type: string
description: The unique identifier for the User within a given OAuth provider. Also commonly called the `sub` or "Subject field" in OAuth protocols.
email_id:
type: string
description: The globally unique UUID of the Member's email.
required:
- id
- provider_subject
api_session_v1_HubspotOAuthFactor:
type: object
properties:
id:
type: string
description: The unique ID of an OAuth registration.
provider_subject:
type: string
description: The unique identifier for the User within a given OAuth provider. Also commonly called the `sub` or "Subject field" in OAuth protocols.
email_id:
type: string
description: The globally unique UUID of the Member's email.
required:
- id
- provider_subject
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_DiscordOAuthFactor:
type: object
properties:
id:
type: string
provider_subject:
type: string
email_id:
type: string
required:
- id
- provider_subject
api_session_v1_SalesforceOAuthFactor:
type: object
properties:
id:
type: string
provider_subject:
type: string
email_id:
type: string
required:
- id
- provider_subject
api_b2b_recovery_codes_v1_RotateRequest:
type: object
properties:
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. You may also use the organization_slug or organization_external_id here as a convenience.
member_id:
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: Request type
required:
- organization_id
- member_id
api_session_v1_SAMLSSOFactor:
type: object
properties:
id:
type: string
description: The unique ID of an SSO Registration.
provider_id:
type: string
description: Globally unique UUID that identifies a specific SAML Connection.
external_id:
type: string
description: The ID of the member given by the identity provider.
required:
- id
- provider_id
- external_id
api_organization_v1_CustomRole:
type: object
properties:
role_id:
type: string
description:
type: string
permissions:
type: array
items:
$ref: '#/components/schemas/api_organization_v1_CustomRolePermission'
required:
- role_id
- description
- permissions
api_session_v1_ImpersonatedFactor:
type: object
properties:
impersonator_id:
type: string
description: For impersonated sessions initiated via the Stytch Dashboard, the `impersonator_id` will be the impersonator's Stytch Dashboard `member_id`.
impersonator_email_address:
type: string
description: The email address of the impersonator.
required:
- impersonator_id
- impersonator_email_address
api_session_v1_TikTokOAuthFactor:
type: object
properties:
id:
type: string
provider_subject:
type: string
email_id:
type: string
required:
- id
- provider_subject
api_session_v1_CoinbaseOAuthFactor:
type: object
properties:
id:
type: string
provider_subject:
type: string
email_id:
type: string
required:
- id
- provider_subject
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_organization_v1_RetiredEmail:
type: object
properties:
email_id:
type: string
description: The globally unique UUID of a Member's email.
email_address:
type: string
description: The email address of the Member.
required:
- email_id
- email_address
api_b2b_recovery_codes_v1_GetResponse:
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).
recovery_codes:
type: array
items:
type: string
description: An array of recovery codes that can be used to recover a Member's account.
status_code:
type: integer
# --- 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