> ## Documentation Index
> Fetch the complete documentation index at: https://stytch.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Set B2B SDK Configuration

> SetB2BConfig updates the SDK configuration for a B2B project environment



## OpenAPI

````yaml PUT /pwa/v3/projects/:project_slug/environments/:environment_slug/sdk/b2b
openapi: 3.0.3
info:
  title: Stytch API
  description: The Stytch API provides endpoints for authentication and user management.
  version: 1.0.0
  contact:
    name: Stytch Support
    url: https://stytch.com/docs
    email: support@stytch.com
servers:
  - url: https://management.stytch.com
    description: Production server
security:
  - basicAuth: []
paths:
  /pwa/v3/projects/:project_slug/environments/:environment_slug/sdk/b2b:
    put:
      tags:
        - Sdk
      summary: Setb2Bconfig
      description: SetB2BConfig updates the SDK configuration for a B2B project environment
      operationId: pwa_sdk_v3_SetB2BConfig
      parameters:
        - name: project_slug
          in: path
          required: true
          schema:
            type: string
        - name: environment_slug
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/pwa_sdk_v3_SetB2BConfigRequest'
      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_SetB2BConfigRequest:
      type: object
      properties:
        config:
          $ref: '#/components/schemas/pwa_sdk_v3_B2BConfig'
      description: Request type
    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_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_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_B2BSessionsConfig:
      type: object
      properties:
        max_session_duration_minutes:
          type: integer
          format: int32
      required:
        - max_session_duration_minutes
    pwa_sdk_v3_B2BMagicLinksConfig:
      type: object
      properties:
        enabled:
          type: boolean
        pkce_required:
          type: boolean
      required:
        - enabled
        - pkce_required
    pwa_sdk_v3_B2BOAuthConfig:
      type: object
      properties:
        enabled:
          type: boolean
        pkce_required:
          type: boolean
      required:
        - enabled
        - pkce_required
    pwa_sdk_v3_B2BTOTPsConfig:
      type: object
      properties:
        create_totps:
          type: boolean
        enabled:
          type: boolean
      required:
        - create_totps
        - enabled
    pwa_sdk_v3_B2BSSOConfig:
      type: object
      properties:
        enabled:
          type: boolean
        pkce_required:
          type: boolean
      required:
        - enabled
        - pkce_required
    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_B2BDFPPAConfig:
      type: object
      properties:
        enabled:
          $ref: '#/components/schemas/pwa_sdk_v3_DFPPASetting'
        on_challenge:
          $ref: '#/components/schemas/pwa_sdk_v3_DFPPAOnChallengeAction'
    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_B2BCookiesConfig:
      type: object
      properties:
        http_only:
          $ref: '#/components/schemas/pwa_sdk_v3_B2BCookiesConfigHttpOnly'
      required:
        - http_only
    pwa_sdk_v3_AuthorizedB2BDomain:
      type: object
      properties:
        domain:
          type: string
        slug_pattern:
          type: string
      required:
        - domain
        - slug_pattern
    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_DFPPASetting:
      type: string
      enum:
        - ENABLED
        - PASSIVE
        - DISABLED
    pwa_sdk_v3_DFPPAOnChallengeAction:
      type: string
      enum:
        - ALLOW
        - BLOCK
        - TRIGGER_CAPTCHA
    pwa_sdk_v3_B2BCookiesConfigHttpOnly:
      type: string
      enum:
        - DISABLED
        - ENABLED
        - ENFORCED
    pwa_sdk_v3_SMSAutofillMetadataMetadataType:
      type: string
      enum:
        - domain
        - hash
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic

````