Stytch Sdk API

The Sdk API from Stytch — 2 operation(s) for sdk.

OpenAPI Specification

stytch-sdk-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Stytch B2B Authentication Application Sdk 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: Sdk
paths:
  /pwa/v3/projects/:project_slug/environments/:environment_slug/sdk/consumer:
    get:
      summary: Getconsumerconfig
      operationId: pwa_sdk_v3_GetConsumerConfig
      tags:
      - Sdk
      description: GetConsumerConfig retrieves the SDK configuration for a B2C project environment
      parameters:
      - name: project_slug
        in: path
        required: true
        schema:
          type: string
      - name: environment_slug
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/pwa_sdk_v3_GetConsumerConfigResponse'
        '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
    put:
      summary: Setconsumerconfig
      operationId: pwa_sdk_v3_SetConsumerConfig
      tags:
      - Sdk
      description: SetConsumerConfig updates the SDK configuration for a B2C project environment
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/pwa_sdk_v3_SetConsumerConfigRequest'
      parameters:
      - name: project_slug
        in: path
        required: true
        schema:
          type: string
      - name: environment_slug
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/pwa_sdk_v3_SetConsumerConfigResponse'
        '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
  /pwa/v3/projects/:project_slug/environments/:environment_slug/sdk/b2b:
    get:
      summary: Getb2bconfig
      operationId: pwa_sdk_v3_GetB2BConfig
      tags:
      - Sdk
      description: GetB2BConfig retrieves the SDK configuration for a B2B project environment
      parameters:
      - name: project_slug
        in: path
        required: true
        schema:
          type: string
      - name: environment_slug
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/pwa_sdk_v3_GetB2BConfigResponse'
        '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
    put:
      summary: Setb2bconfig
      operationId: pwa_sdk_v3_SetB2BConfig
      tags:
      - Sdk
      description: SetB2BConfig updates the SDK configuration for a B2B project environment
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/pwa_sdk_v3_SetB2BConfigRequest'
      parameters:
      - name: project_slug
        in: path
        required: true
        schema:
          type: string
      - name: environment_slug
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/pwa_sdk_v3_SetB2BConfigResponse'
        '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
components:
  schemas:
    pwa_sdk_v3_SetConsumerConfigRequest:
      type: object
      properties:
        config:
          $ref: '#/components/schemas/pwa_sdk_v3_ConsumerConfig'
      description: Request type
    pwa_sdk_v3_B2BOTPsConfig:
      type: object
      properties:
        sms_enabled:
          type: boolean
        sms_autofill_metadata:
          type: array
          items:
            $ref: '#/components/schemas/pwa_sdk_v3_SMSAutofillMetadata'
        email_enabled:
          type: boolean
      required:
      - sms_enabled
      - sms_autofill_metadata
      - email_enabled
    pwa_sdk_v3_B2BMagicLinksConfig:
      type: object
      properties:
        enabled:
          type: boolean
        pkce_required:
          type: boolean
      required:
      - enabled
      - pkce_required
    pwa_sdk_v3_SMSAutofillMetadataMetadataType:
      type: string
      enum:
      - domain
      - hash
    pwa_sdk_v3_SetB2BConfigResponse:
      type: object
      properties:
        request_id:
          type: string
        config:
          $ref: '#/components/schemas/pwa_sdk_v3_B2BConfig'
        status_code:
          type: integer
          format: int32
      description: Response type
      required:
      - request_id
      - config
      - status_code
    pwa_sdk_v3_B2BBasicConfig:
      type: object
      properties:
        enabled:
          type: boolean
        allow_self_onboarding:
          type: boolean
        enable_member_permissions:
          type: boolean
        domains:
          type: array
          items:
            $ref: '#/components/schemas/pwa_sdk_v3_AuthorizedB2BDomain'
        bundle_ids:
          type: array
          items:
            type: string
      required:
      - enabled
      - allow_self_onboarding
      - enable_member_permissions
      - domains
      - bundle_ids
    pwa_sdk_v3_B2BCookiesConfig:
      type: object
      properties:
        http_only:
          $ref: '#/components/schemas/pwa_sdk_v3_B2BCookiesConfigHttpOnly'
      required:
      - http_only
    pwa_sdk_v3_SetB2BConfigRequest:
      type: object
      properties:
        config:
          $ref: '#/components/schemas/pwa_sdk_v3_B2BConfig'
      description: Request type
    pwa_sdk_v3_ConsumerCryptoWalletsConfig:
      type: object
      properties:
        enabled:
          type: boolean
        siwe_required:
          type: boolean
      required:
      - enabled
      - siwe_required
    pwa_sdk_v3_ConsumerOTPsConfig:
      type: object
      properties:
        sms_login_or_create_enabled:
          type: boolean
        whatsapp_login_or_create_enabled:
          type: boolean
        email_login_or_create_enabled:
          type: boolean
        sms_send_enabled:
          type: boolean
        whatsapp_send_enabled:
          type: boolean
        email_send_enabled:
          type: boolean
        sms_autofill_metadata:
          type: array
          items:
            $ref: '#/components/schemas/pwa_sdk_v3_SMSAutofillMetadata'
      required:
      - sms_login_or_create_enabled
      - whatsapp_login_or_create_enabled
      - email_login_or_create_enabled
      - sms_send_enabled
      - whatsapp_send_enabled
      - email_send_enabled
      - sms_autofill_metadata
    pwa_sdk_v3_ConsumerConfig:
      type: object
      properties:
        basic:
          $ref: '#/components/schemas/pwa_sdk_v3_ConsumerBasicConfig'
        sessions:
          $ref: '#/components/schemas/pwa_sdk_v3_ConsumerSessionsConfig'
        magic_links:
          $ref: '#/components/schemas/pwa_sdk_v3_ConsumerMagicLinksConfig'
        otps:
          $ref: '#/components/schemas/pwa_sdk_v3_ConsumerOTPsConfig'
        oauth:
          $ref: '#/components/schemas/pwa_sdk_v3_ConsumerOAuthConfig'
        totps:
          $ref: '#/components/schemas/pwa_sdk_v3_ConsumerTOTPsConfig'
        webauthn:
          $ref: '#/components/schemas/pwa_sdk_v3_ConsumerWebAuthnConfig'
        crypto_wallets:
          $ref: '#/components/schemas/pwa_sdk_v3_ConsumerCryptoWalletsConfig'
        dfppa:
          $ref: '#/components/schemas/pwa_sdk_v3_ConsumerDFPPAConfig'
        biometrics:
          $ref: '#/components/schemas/pwa_sdk_v3_ConsumerBiometricsConfig'
        passwords:
          $ref: '#/components/schemas/pwa_sdk_v3_ConsumerPasswordsConfig'
        cookies:
          $ref: '#/components/schemas/pwa_sdk_v3_ConsumerCookiesConfig'
    pwa_sdk_v3_ConsumerTOTPsConfig:
      type: object
      properties:
        create_totps:
          type: boolean
        enabled:
          type: boolean
      required:
      - create_totps
      - enabled
    pwa_sdk_v3_ConsumerWebAuthnConfig:
      type: object
      properties:
        create_webauthns:
          type: boolean
        enabled:
          type: boolean
      required:
      - create_webauthns
      - enabled
    pwa_sdk_v3_ConsumerMagicLinksConfig:
      type: object
      properties:
        login_or_create_enabled:
          type: boolean
        send_enabled:
          type: boolean
        pkce_required:
          type: boolean
      required:
      - login_or_create_enabled
      - send_enabled
      - pkce_required
    pwa_sdk_v3_ConsumerCookiesConfigHttpOnly:
      type: string
      enum:
      - DISABLED
      - ENABLED
      - ENFORCED
    pwa_sdk_v3_ConsumerBasicConfig:
      type: object
      properties:
        enabled:
          type: boolean
        domains:
          type: array
          items:
            type: string
        bundle_ids:
          type: array
          items:
            type: string
      required:
      - enabled
      - domains
      - bundle_ids
    pwa_sdk_v3_B2BOAuthConfig:
      type: object
      properties:
        enabled:
          type: boolean
        pkce_required:
          type: boolean
      required:
      - enabled
      - pkce_required
    pwa_sdk_v3_ConsumerBiometricsConfig:
      type: object
      properties:
        create_biometrics_enabled:
          type: boolean
        enabled:
          type: boolean
      required:
      - create_biometrics_enabled
      - enabled
    pwa_sdk_v3_B2BSSOConfig:
      type: object
      properties:
        enabled:
          type: boolean
        pkce_required:
          type: boolean
      required:
      - enabled
      - pkce_required
    pwa_sdk_v3_AuthorizedB2BDomain:
      type: object
      properties:
        domain:
          type: string
        slug_pattern:
          type: string
      required:
      - domain
      - slug_pattern
    pwa_sdk_v3_ConsumerPasswordsConfig:
      type: object
      properties:
        enabled:
          type: boolean
        pkce_required_for_password_resets:
          type: boolean
      required:
      - enabled
      - pkce_required_for_password_resets
    pwa_sdk_v3_B2BPasswordsConfig:
      type: object
      properties:
        enabled:
          type: boolean
        pkce_required_for_password_resets:
          type: boolean
      required:
      - enabled
      - pkce_required_for_password_resets
    pwa_sdk_v3_B2BTOTPsConfig:
      type: object
      properties:
        create_totps:
          type: boolean
        enabled:
          type: boolean
      required:
      - create_totps
      - enabled
    pwa_sdk_v3_GetB2BConfigResponse:
      type: object
      properties:
        request_id:
          type: string
        config:
          $ref: '#/components/schemas/pwa_sdk_v3_B2BConfig'
        status_code:
          type: integer
          format: int32
      description: Response type
      required:
      - request_id
      - config
      - status_code
    pwa_sdk_v3_ConsumerSessionsConfig:
      type: object
      properties:
        max_session_duration_minutes:
          type: integer
          format: int32
      required:
      - max_session_duration_minutes
    pwa_sdk_v3_ConsumerCookiesConfig:
      type: object
      properties:
        http_only:
          $ref: '#/components/schemas/pwa_sdk_v3_ConsumerCookiesConfigHttpOnly'
      required:
      - http_only
    pwa_sdk_v3_SMSAutofillMetadata:
      type: object
      properties:
        metadata_type:
          $ref: '#/components/schemas/pwa_sdk_v3_SMSAutofillMetadataMetadataType'
        metadata_value:
          type: string
        bundle_id:
          type: string
      required:
      - metadata_type
      - metadata_value
      - bundle_id
    pwa_sdk_v3_B2BDFPPAConfig:
      type: object
      properties:
        enabled:
          $ref: '#/components/schemas/pwa_sdk_v3_DFPPASetting'
        on_challenge:
          $ref: '#/components/schemas/pwa_sdk_v3_DFPPAOnChallengeAction'
    pwa_sdk_v3_DFPPAOnChallengeAction:
      type: string
      enum:
      - ALLOW
      - BLOCK
      - TRIGGER_CAPTCHA
    pwa_sdk_v3_GetConsumerConfigResponse:
      type: object
      properties:
        request_id:
          type: string
        config:
          $ref: '#/components/schemas/pwa_sdk_v3_ConsumerConfig'
        status_code:
          type: integer
          format: int32
      description: Response type
      required:
      - request_id
      - config
      - status_code
    pwa_sdk_v3_DFPPASetting:
      type: string
      enum:
      - ENABLED
      - PASSIVE
      - DISABLED
    pwa_sdk_v3_SetConsumerConfigResponse:
      type: object
      properties:
        request_id:
          type: string
        config:
          $ref: '#/components/schemas/pwa_sdk_v3_ConsumerConfig'
        status_code:
          type: integer
          format: int32
      description: Response type
      required:
      - request_id
      - config
      - status_code
    pwa_sdk_v3_ConsumerOAuthConfig:
      type: object
      properties:
        enabled:
          type: boolean
        pkce_required:
          type: boolean
      required:
      - enabled
      - pkce_required
    pwa_sdk_v3_ConsumerDFPPAConfig:
      type: object
      properties:
        enabled:
          $ref: '#/components/schemas/pwa_sdk_v3_DFPPASetting'
        on_challenge:
          $ref: '#/components/schemas/pwa_sdk_v3_DFPPAOnChallengeAction'
    pwa_sdk_v3_B2BConfig:
      type: object
      properties:
        basic:
          $ref: '#/components/schemas/pwa_sdk_v3_B2BBasicConfig'
        sessions:
          $ref: '#/components/schemas/pwa_sdk_v3_B2BSessionsConfig'
        magic_links:
          $ref: '#/components/schemas/pwa_sdk_v3_B2BMagicLinksConfig'
        oauth:
          $ref: '#/components/schemas/pwa_sdk_v3_B2BOAuthConfig'
        totps:
          $ref: '#/components/schemas/pwa_sdk_v3_B2BTOTPsConfig'
        sso:
          $ref: '#/components/schemas/pwa_sdk_v3_B2BSSOConfig'
        otps:
          $ref: '#/components/schemas/pwa_sdk_v3_B2BOTPsConfig'
        dfppa:
          $ref: '#/components/schemas/pwa_sdk_v3_B2BDFPPAConfig'
        passwords:
          $ref: '#/components/schemas/pwa_sdk_v3_B2BPasswordsConfig'
        cookies:
          $ref: '#/components/schemas/pwa_sdk_v3_B2BCookiesConfig'
    pwa_sdk_v3_B2BSessionsConfig:
      type: object
      properties:
        max_session_duration_minutes:
          type: integer
          format: int32
      required:
      - max_session_duration_minutes
    pwa_sdk_v3_B2BCookiesConfigHttpOnly:
      type: string
      enum:
      - DISABLED
      - ENABLED
      - ENFORCED
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic