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

# Modify SAML configuration

> Modifies SAML configuration for the organization. When changing the active parameter, it will enable SAML configuration. This will cause other authentication (login/password, etc.) methods to be disabled for that organization. Activation of SAML configuration will be blocked if there is no product on an enterprise plan or the organization contains an account that is added to another organization.



## OpenAPI

````yaml /api/global-accounts/openapi.json patch /organizations/my/saml
openapi: 3.0.0
info:
  title: Global Accounts API
  description: >-
    API used to manage Organizations and Accounts for multiple products. Also
    responsible for authorization and authentication processes.
  version: 2.0.0
servers:
  - url: https://accounts.livechat.com/v2
    description: Main production server URL
security: []
paths:
  /organizations/my/saml:
    patch:
      tags:
        - SAML
      summary: Modify SAML configuration
      description: >-
        Modifies SAML configuration for the organization. When changing the
        active parameter, it will enable SAML configuration. This will cause
        other authentication (login/password, etc.) methods to be disabled for
        that organization. Activation of SAML configuration will be blocked if
        there is no product on an enterprise plan or the organization contains
        an account that is added to another organization.
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              properties:
                entrypoint:
                  type: string
                  description: >-
                    The entrypoint URL of the identity provider; SSO redirects
                    the AuthnRequest there.
                certificate:
                  type: string
                  description: >-
                    The SAML certificate configured on the IDP side in PEM
                    format.
                idp_entity_id:
                  type: string
                  description: >-
                    The entity ID of the external identity provider; usually a
                    URL.
                sp_entity_id:
                  type: string
                  description: >-
                    The entity ID of Text Accounts; it has a default value that
                    can be changed.
                active:
                  type: boolean
                  description: 'If `true`: the SAML configuration is enabled.'
            example:
              entrypoint: https://accounts.example.com/saml2/idp/SSOService.php
              active: false
      responses:
        '200':
          description: 'OK: SAML configuration was modified.'
          content:
            application/json:
              schema:
                description: The organization's SAML configuration.
                type: object
                properties:
                  entrypoint:
                    type: string
                    description: >-
                      The entrypoint URL of the identity provider; SSO redirects
                      the AuthnRequest there.
                  certificate:
                    type: string
                    description: >-
                      The SAML certificate configured on the IDP side in PEM
                      format.
                  idp_entity_id:
                    type: string
                    description: >-
                      The entity ID of the external identity provider; usually a
                      URL.
                  sp_entity_id:
                    type: string
                    description: >-
                      The entity ID of Text Accounts; it has a default value
                      that can be changed.
                  active:
                    type: boolean
                    description: 'If `true`: the SAML configuration is enabled.'
                  version:
                    type: integer
                    description: >-
                      The version of the SAML configuration; currently either 1
                      or 2.
              example:
                entrypoint: https://accounts.example.com/saml2/idp/SSOService.php
                certificate: >-
                  -----BEGIN CERTIFICATE-----

                  MIIDXTCCAkWgAwIBAgIJALmVVuDWu4NYMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV

                  -----END CERTIFICATE-----
                idp_entity_id: https://accounts.example.com/saml2/idp/metadata.php
                sp_entity_id: https://accounts.livechat.com/saml/metadata
                active: false
                version: 2
        '400':
          description: >-
            Bad Request: Accounts are connected with other organizations or
            insufficient product subscriptions; in case of enabling
            configuration.
          content:
            application/json:
              schema:
                allOf:
                  - description: The default error object.
                    type: object
                    properties:
                      error:
                        description: The error code.
                        type: string
                        enum:
                          - bad_request
                          - invalid_request
                          - unauthorized_client
                          - unauthorized
                          - access_denied
                          - unsupported_response_type
                          - invalid_scope
                          - server_error
                          - temporarily_unavailable
                          - unsupported_grant_type
                          - invalid_grant
                          - invalid_client
                          - conflict
                          - resource_not_found
                          - join_link_expired
                          - traffic_blocked
                          - not_implemented
                      error_description:
                        type: string
                      sub_error:
                        description: The error subcode.
                        type: string
                        nullable: true
                      request_id:
                        description: Unique request identifier.
                        type: string
                        format: uuid
                  - type: object
                    properties:
                      error:
                        type: string
                      error_description:
                        type: string
              example:
                error: bad_request
                error_description: >-
                  The server cannot or will not process the request due to an
                  apparent client error (for example, malformed request syntax,
                  size too large).
                request_id: 5903c51b-89f0-41a9-a25d-4f39af100353
        '403':
          description: 'Forbidden: Edition of v1 SAML configuration is forbidden.'
          content:
            application/json:
              schema:
                allOf:
                  - description: The default error object.
                    type: object
                    properties:
                      error:
                        description: The error code.
                        type: string
                        enum:
                          - bad_request
                          - invalid_request
                          - unauthorized_client
                          - unauthorized
                          - access_denied
                          - unsupported_response_type
                          - invalid_scope
                          - server_error
                          - temporarily_unavailable
                          - unsupported_grant_type
                          - invalid_grant
                          - invalid_client
                          - conflict
                          - resource_not_found
                          - join_link_expired
                          - traffic_blocked
                          - not_implemented
                      error_description:
                        type: string
                      sub_error:
                        description: The error subcode.
                        type: string
                        nullable: true
                      request_id:
                        description: Unique request identifier.
                        type: string
                        format: uuid
                  - type: object
                    properties:
                      error:
                        type: string
                      sub_error:
                        type: string
                      error_description:
                        type: string
              example:
                error: access_denied
                sub_error: insufficient_scope
                error_description: The resource owner or authorization server denied the request.
                request_id: 5903c51b-89f0-41a9-a25d-4f39af100353
        '404':
          description: 'Not found: SAML configuration not found.'
          content:
            application/json:
              schema:
                allOf:
                  - description: Returned on validation errors.
                    allOf:
                      - description: The default error object.
                        type: object
                        properties:
                          error:
                            description: The error code.
                            type: string
                            enum:
                              - bad_request
                              - invalid_request
                              - unauthorized_client
                              - unauthorized
                              - access_denied
                              - unsupported_response_type
                              - invalid_scope
                              - server_error
                              - temporarily_unavailable
                              - unsupported_grant_type
                              - invalid_grant
                              - invalid_client
                              - conflict
                              - resource_not_found
                              - join_link_expired
                              - traffic_blocked
                              - not_implemented
                          error_description:
                            type: string
                          sub_error:
                            description: The error subcode.
                            type: string
                            nullable: true
                          request_id:
                            description: Unique request identifier.
                            type: string
                            format: uuid
                      - type: object
                        properties:
                          resource_name:
                            description: The name of the resource related to the error.
                            type: string
                          resource_id:
                            description: >-
                              The identifier of the resource related to the
                              error.
                            type: string
                  - type: object
                    properties:
                      error:
                        type: string
                      error_description:
                        type: string
              example:
                error: resource_not_found
                error_description: The requested resource couldn't be found.
                resource_name: account
                resource_id: def31e95-5ca4-4817-b176-732e4544daca
                request_id: 5903c51b-89f0-41a9-a25d-4f39af100353
        '409':
          description: 'Conflict: Account exists in another organization.'
          content:
            application/json:
              schema:
                allOf:
                  - description: Returned on validation errors.
                    allOf:
                      - description: The default error object.
                        type: object
                        properties:
                          error:
                            description: The error code.
                            type: string
                            enum:
                              - bad_request
                              - invalid_request
                              - unauthorized_client
                              - unauthorized
                              - access_denied
                              - unsupported_response_type
                              - invalid_scope
                              - server_error
                              - temporarily_unavailable
                              - unsupported_grant_type
                              - invalid_grant
                              - invalid_client
                              - conflict
                              - resource_not_found
                              - join_link_expired
                              - traffic_blocked
                              - not_implemented
                          error_description:
                            type: string
                          sub_error:
                            description: The error subcode.
                            type: string
                            nullable: true
                          request_id:
                            description: Unique request identifier.
                            type: string
                            format: uuid
                      - type: object
                        properties:
                          resource_name:
                            description: The name of the resource related to the error.
                            type: string
                          resource_id:
                            description: >-
                              The identifier of the resource related to the
                              error.
                            type: string
                  - type: object
                    properties:
                      error:
                        type: string
                      error_description:
                        type: string
              example:
                error: conflict
                error_description: >-
                  The request couldn't be processed because of conflict in the
                  current state of the resource.
                resource_name: account
                resource_id: 5903c51b-89f0-41a9-a25d-4f39af100353
                request_id: 5903c51b-89f0-41a9-a25d-4f39af100353
        '422':
          description: Invalid request.
          content:
            application/json:
              schema:
                allOf:
                  - description: The default error object.
                    type: object
                    properties:
                      error:
                        description: The error code.
                        type: string
                        enum:
                          - bad_request
                          - invalid_request
                          - unauthorized_client
                          - unauthorized
                          - access_denied
                          - unsupported_response_type
                          - invalid_scope
                          - server_error
                          - temporarily_unavailable
                          - unsupported_grant_type
                          - invalid_grant
                          - invalid_client
                          - conflict
                          - resource_not_found
                          - join_link_expired
                          - traffic_blocked
                          - not_implemented
                      error_description:
                        type: string
                      sub_error:
                        description: The error subcode.
                        type: string
                        nullable: true
                      request_id:
                        description: Unique request identifier.
                        type: string
                        format: uuid
                  - type: object
                    properties:
                      error:
                        type: string
                      error_description:
                        type: string
                      invalid_fields:
                        type: object
                        additionalProperties:
                          type: string
              example:
                error: invalid_request
                error_description: >-
                  The request is missing a required parameter, includes an
                  invalid parameter value, includes a parameter more than once,
                  or is otherwise malformed.
                invalid_fields:
                  email: invalid email address
                request_id: 5903c51b-89f0-41a9-a25d-4f39af100353
        '500':
          description: Server Error.
          content:
            application/json:
              schema:
                allOf:
                  - description: The default error object.
                    type: object
                    properties:
                      error:
                        description: The error code.
                        type: string
                        enum:
                          - bad_request
                          - invalid_request
                          - unauthorized_client
                          - unauthorized
                          - access_denied
                          - unsupported_response_type
                          - invalid_scope
                          - server_error
                          - temporarily_unavailable
                          - unsupported_grant_type
                          - invalid_grant
                          - invalid_client
                          - conflict
                          - resource_not_found
                          - join_link_expired
                          - traffic_blocked
                          - not_implemented
                      error_description:
                        type: string
                      sub_error:
                        description: The error subcode.
                        type: string
                        nullable: true
                      request_id:
                        description: Unique request identifier.
                        type: string
                        format: uuid
                  - type: object
                    properties:
                      error:
                        type: string
                      error_description:
                        type: string
              example:
                error: server_error
                error_description: >-
                  The server encountered an unexpected condition that prevented
                  it from fulfilling the request.
                request_id: 5903c51b-89f0-41a9-a25d-4f39af100353
      security:
        - OAuth2BearerToken: []
components:
  securitySchemes:
    OAuth2BearerToken:
      description: >-
        This API uses OAuth2 with the implicit grant flow. <a
        href="/authentication/oauth-authorization#implicit-grant">Learn about
        the implicit grant flow.</a>
      type: oauth2
      flows:
        implicit:
          authorizationUrl: https://accounts.livechat.com
          scopes: {}
        authorizationCode:
          authorizationUrl: https://accounts.livechat.com
          tokenUrl: https://accounts.livechat.com/token
          scopes: {}

````