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

# Map an external IdP group to a role for this connection

> Map an external IdP group to a role for this connection



## OpenAPI

````yaml POST /orgs/{org_id}/identity-providers/{provider_id}/group-mappings
openapi: 3.1.0
info:
  title: Timbal Platform API
  description: Public API documentation for the Timbal platform
  license:
    name: ''
  version: 2.0.0
servers:
  - url: https://api.timbal.ai
    description: Production
  - url: https://api.dev.timbal.ai
    description: Development
security: []
tags:
  - name: ace
    description: Action Control Engine (ACE) operations
  - name: analytics
    description: Project analytics
  - name: billing
    description: Subscriptions, usage, and payment-related operations
  - name: content
    description: Re-sign stored content URLs
  - name: files
    description: File operations
  - name: iam
    description: IAM — actions, roles, users, and authorization introspection
  - name: k2
    description: Knowledge Bases v2 operations
  - name: orgs
    description: Organization operations
  - name: projects
    description: Project operations
  - name: runs
    description: Execution operations
  - name: templates
    description: Public project template catalog
  - name: users
    description: Authenticated user profile
paths:
  /orgs/{org_id}/identity-providers/{provider_id}/group-mappings:
    post:
      tags:
        - orgs
      description: Map an external IdP group to a role for this connection
      operationId: handler
      parameters:
        - name: org_id
          in: path
          required: true
          schema:
            type: string
        - name: provider_id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateGroupRoleMappingReqBody'
        required: true
      responses:
        '201':
          description: Mapping created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GroupRoleMappingView'
        '404':
          description: Connection not found
        '409':
          description: Group already mapped for this connection
      security:
        - bearer_auth: []
components:
  schemas:
    CreateGroupRoleMappingReqBody:
      type: object
      description: Add an external-group → role mapping to a connection.
      required:
        - external_group
        - role_id
      properties:
        external_group:
          type: string
          description: External group identifier exactly as the IdP emits it.
        role_id:
          type: integer
          format: int64
          description: Target Timbal role id. Accepts a number or a stringified id.
    GroupRoleMappingView:
      type: object
      description: View of a group→role mapping.
      required:
        - id
        - provider_id
        - external_group
        - role_id
        - created_at
        - updated_at
      properties:
        created_at:
          type: integer
          format: int64
        external_group:
          type: string
        id:
          type: string
        provider_id:
          type: string
        role_id:
          type: string
        updated_at:
          type: integer
          format: int64
  securitySchemes:
    bearer_auth:
      type: http
      scheme: bearer
      description: >-
        Timbal API key. Obtain your API key from the Timbal platform settings.
        See [Authentication](/api-reference/authentication) for more
        information.

````