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

# Update Idp Config

> Update the IdP role mapping configuration for the organization.

Requires an IdP to already be configured for the organization — raises 404
otherwise, matching the legacy Keycloak-mapper-backed behavior (strict backward
compatibility). Upserts (or, when ``admin_group`` is empty, deletes) the org's
``admin``-role ``group_role_mapping`` row(s) (BCP-3486) and enqueues org-wide
re-evaluation. This no longer creates/updates a Keycloak IdP mapper — but does
best-effort delete a lingering legacy ``barndoor-role-admin`` mapper if one is still
present, so a stale FORCE-sync mapper can't keep granting admin at SSO after this
call changes the authoritative DB row (see
``GroupRoleMappingService.update_legacy_idp_config``).

Requires admin or superadmin role.



## OpenAPI

````yaml /api-reference/openapi.yaml put /api/identity/public/v1/idp/config
openapi: 3.1.0
info:
  title: Barndoor.ai Public API
  description: Unified public API specification for Barndoor.ai platform
  version: 2.18.0
servers:
  - url: https://{host}
    description: Barndoor public API
    variables:
      host:
        default: platform.barndoor.ai
        description: >-
          The host serving your Barndoor deployment. Defaults to production;
          override it for another environment or a dedicated deployment.
security:
  - ApiKey: []
  - OAuth2:
      - openid
      - profile
      - email
tags:
  - name: dlp
    x-group: Data Control Center
  - name: identity
    x-group: Identity
  - name: llm-gateway
    x-group: LLM Gateway
  - name: notification
    x-group: Notifications
  - name: policy
    x-group: Policies
  - name: registry
    x-group: MCP Gateway
  - name: system-management
    x-group: Log Exports
paths:
  /api/identity/public/v1/idp/config:
    put:
      tags:
        - identity
      summary: Update Idp Config
      description: >-
        Update the IdP role mapping configuration for the organization.


        Requires an IdP to already be configured for the organization — raises
        404

        otherwise, matching the legacy Keycloak-mapper-backed behavior (strict
        backward

        compatibility). Upserts (or, when ``admin_group`` is empty, deletes) the
        org's

        ``admin``-role ``group_role_mapping`` row(s) (BCP-3486) and enqueues
        org-wide

        re-evaluation. This no longer creates/updates a Keycloak IdP mapper —
        but does

        best-effort delete a lingering legacy ``barndoor-role-admin`` mapper if
        one is still

        present, so a stale FORCE-sync mapper can't keep granting admin at SSO
        after this

        call changes the authoritative DB row (see

        ``GroupRoleMappingService.update_legacy_idp_config``).


        Requires admin or superadmin role.
      operationId: update_idp_config
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/IdpRoleMappingConfig'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IdpRoleMappingResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    IdpRoleMappingConfig:
      properties:
        admin_group:
          anyOf:
            - type: string
            - type: 'null'
          title: Admin Group
      type: object
      title: IdpRoleMappingConfig
      description: Configuration for IdP group to Barndoor role mapping.
    IdpRoleMappingResponse:
      properties:
        idp_alias:
          anyOf:
            - type: string
            - type: 'null'
          title: Idp Alias
        idp_display_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Idp Display Name
        admin_group:
          anyOf:
            - type: string
            - type: 'null'
          title: Admin Group
      type: object
      title: IdpRoleMappingResponse
      description: Response containing current IdP role mapping configuration.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    ApiKey:
      type: http
      scheme: bearer
      description: >-
        A Barndoor API key, sent as `Authorization: Bearer <key>`. Keys are
        prefixed `bdai_` and are opaque — do not attempt to decode one.
        Interchangeable with an OAuth 2.0 access token.
    OAuth2:
      type: oauth2
      x-issuer: https://auth.barndoor.ai/realms/barndoor
      description: >-
        An OAuth 2.0 access token from Barndoor's identity provider, sent as
        `Authorization: Bearer <token>`. Public clients must use PKCE.
        Interchangeable with an API key.
      flows:
        authorizationCode:
          authorizationUrl: >-
            https://auth.barndoor.ai/realms/barndoor/protocol/openid-connect/auth
          tokenUrl: >-
            https://auth.barndoor.ai/realms/barndoor/protocol/openid-connect/token
          scopes:
            openid: Issue an OIDC ID token identifying the caller.
            profile: Read the caller's basic profile claims.
            email: Read the caller's email address.
            offline_access: Issue a refresh token. Optional — no operation requires it.
        clientCredentials:
          tokenUrl: >-
            https://auth.barndoor.ai/realms/barndoor/protocol/openid-connect/token
          scopes:
            openid: Issue an OIDC ID token identifying the caller.
            profile: Read the caller's basic profile claims.
            email: Read the caller's email address.
            offline_access: Issue a refresh token. Optional — no operation requires it.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.