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

# Replace the group-to-role mappings

> Replaces the group-to-role mappings. While any exist, every sign-in the provider vouches for sets the member's role from the groups the provider asserts: the highest mapped role wins, a member in no mapped group gets the default role, and owner is never mapped.



## OpenAPI

````yaml https://platform.ankra.app/openapi.json put /org/organisation/{organisation_id}/sso/group-mappings
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers:
  - url: https://platform.ankra.app
security: []
tags:
  - name: Organisation IAM
    description: >-
      Custom organisation roles and scoped role assignments for member and
      service-account identities.
  - name: Clusters
    description: Create, inspect and manage clusters, and the stacks deployed on them.
  - name: Managed Clusters
    description: Provider-managed control planes, driven through one common surface.
  - name: Imported Clusters
    description: Clusters that already existed and were connected to Ankra.
  - name: Cluster Access
    description: Kubeconfigs, service-account tokens and per-cluster access grants.
  - name: Kubernetes
    description: Read and act on the Kubernetes objects inside a cluster.
  - name: AWS Clusters
    description: >-
      Provision and manage self-managed k3s / kubeadm clusters on AWS EC2 in
      your own VPC.
  - name: Ankra Cloud Clusters
    description: >-
      Provision and manage self-managed kubeadm / k3s clusters on Ankra Cloud
      servers: a private network, a NAT router and a bastion per cluster.
  - name: DigitalOcean Clusters
    description: Provision and manage DigitalOcean Kubernetes clusters.
  - name: Hetzner Clusters
    description: Provision and manage Hetzner Kubernetes clusters.
  - name: OVH Clusters
    description: Provision and manage OVH Kubernetes clusters.
  - name: Scaleway Clusters
    description: Provision and manage Scaleway Kapsule clusters.
  - name: UpCloud Clusters
    description: Provision and manage UpCloud Kubernetes clusters.
  - name: Applications
    description: Deploy, configure and observe applications across the fleet.
  - name: Pipelines
    description: Pipeline definitions and the approval of the authority they declare.
  - name: Backups
    description: >-
      Backup vaults, restore points, protection posture and captures for stacks
      and application deployments; a completed capture is not a verified
      restore.
  - name: Stack Profiles
    description: Reusable stack definitions, their versions and sharing.
  - name: Services
    description: >-
      Versioned service packages and explicit sharing. Runtime admission is
      separate from publication.
  - name: Charts
    description: Browse the chart catalogue behind stacks and addons.
  - name: Helm
    description: Helm registries, credentials and the charts they expose.
  - name: Executions
    description: Long-running platform executions and their jobs.
  - name: Operations
    description: Cancel in-flight cluster operations and their jobs.
  - name: Chat
    description: Conversational sessions, plans and confirmable actions.
  - name: AI Management
    description: >-
      Customer agent lifecycle, authenticated identity and organisation
      automation controls.
  - name: AI Agent Runs
    description: Autonomous agent runs and their outcomes.
  - name: AI Tickets
    description: The AI ticket board, its sync connections and settings.
  - name: AI Playbooks
    description: Reusable playbooks the AI lanes execute.
  - name: AI Conditions
    description: Conditions that gate AI autonomy.
  - name: AI Remediation
    description: >-
      The organisation's auto-remediation policy: what the AI lanes may fix by
      themselves, and who approves the rest.
  - name: AI Engineering Handoffs
    description: Work the AI lanes escalate to a human engineer.
  - name: AI Environment
    description: The environment and base stacks AI demos deploy into.
  - name: Security
    description: Findings, advisories, SBOMs, compliance and posture.
  - name: Cost
    description: Cluster and fleet cost, rate cards and cost settings.
  - name: Decisions
    description: >-
      The decision ledger behind the Security and Cost queues: proposals a
      surface computed, the approve and set-aside decisions people took on them,
      and the receipts of running them.
  - name: Billing
    description: Subscription and spend caps.
  - name: Organisation
    description: Members, invitations, audit logs and organisation settings.
  - name: Account Tokens
    description: Personal access tokens for the API and CLI.
  - name: Credentials
    description: The shared credential store.
  - name: AWS Credentials
    description: >-
      AWS credentials: access keys or CloudFormation-onboarded STS roles for
      cost, EKS and self-managed provisioning.
  - name: Ankra Cloud Credentials
    description: >-
      Ankra Cloud API tokens, shared by the self-managed and managed Ankra Cloud
      lanes.
  - name: Azure Credentials
    description: Azure credentials and SSH keys.
  - name: DigitalOcean Credentials
    description: DigitalOcean credentials and SSH keys.
  - name: Hetzner Credentials
    description: Hetzner credentials and SSH keys.
  - name: OVH Credentials
    description: OVH credentials and SSH keys.
  - name: Scaleway Credentials
    description: Scaleway credentials.
  - name: UpCloud Credentials
    description: UpCloud credentials and SSH keys.
  - name: Data Source Credentials
    description: Credentials for metrics and log sources.
  - name: DNS Credentials
    description: Credentials for DNS providers.
  - name: Object Storage Buckets
    description: >-
      Buckets Ankra creates and manages on an organisation's own provider
      credentials.
  - name: DNS
    description: DNS zones and records, including custom organisation zones.
  - name: Cloudflare
    description: Cloudflare domains and the credentials behind them.
  - name: Avura
    description: >-
      The linked Avura organization, the domains it shares with Ankra Platform,
      and their DNS records.
  - name: Variables
    description: Organisation- and cluster-scoped variables.
  - name: SOPS
    description: Encrypt and decrypt values with the organisation SOPS config.
  - name: Alerts
    description: Alert integrations and ingest credentials.
  - name: Notifications
    description: Notification routes and their delivery targets.
  - name: Support
    description: Support tickets.
  - name: AI Settings
    description: Organisation AI provider, model catalog and per-function model settings
paths:
  /org/organisation/{organisation_id}/sso/group-mappings:
    put:
      tags:
        - Organisation
      summary: Replace the group-to-role mappings
      description: >-
        Replaces the group-to-role mappings. While any exist, every sign-in the
        provider vouches for sets the member's role from the groups the provider
        asserts: the highest mapped role wins, a member in no mapped group gets
        the default role, and owner is never mapped.
      operationId: put_organisation_sso_group_mappings
      parameters:
        - name: organisation_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrganisationSSOGroupMappingsRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrganisationSSOSettings'
          description: Single sign-on settings
        '400':
          description: Invalid mappings
        '401':
          description: Unauthorized
        '403':
          description: Not permitted
        '404':
          description: Single sign-on is not configured for this organisation
        '409':
          description: Single sign-on is switched off on this installation
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
        '500':
          description: Internal server error
      security:
        - SessionCookie: []
components:
  schemas:
    OrganisationSSOGroupMappingsRequest:
      properties:
        mappings:
          items:
            properties:
              group:
                description: >-
                  A value of the provider's groups claim, exactly as the
                  provider sends it.
                type: string
              role:
                enum:
                  - member
                  - admin
                  - read-only
                type: string
            required:
              - group
              - role
            type: object
          maxItems: 50
          type: array
      required:
        - mappings
      title: OrganisationSSOGroupMappingsRequest
      type: object
    OrganisationSSOSettings:
      properties:
        connection:
          anyOf:
            - $ref: '#/components/schemas/OrganisationSSOConnection'
            - type: 'null'
        domains:
          items:
            $ref: '#/components/schemas/OrganisationSSODomain'
          type: array
        group_mappings:
          items:
            $ref: '#/components/schemas/OrganisationSSOGroupMapping'
          type: array
        governed_member_count:
          type: integer
        is_available:
          type: boolean
        redirect_uri:
          type: string
        sign_in_url:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Sends somebody straight to the organisation's identity provider.
            Served on the portal origin, which proxies /auth/* to the API; null
            until a domain is verified.
        suspended_member_count:
          type: integer
      required:
        - is_available
        - connection
        - domains
        - group_mappings
        - redirect_uri
        - sign_in_url
        - governed_member_count
        - suspended_member_count
      title: OrganisationSSOSettings
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    OrganisationSSOConnection:
      properties:
        break_glass_user_ids:
          items:
            type: string
            format: uuid
          type: array
        client_id:
          type: string
        created_at:
          type: string
          format: date-time
        enforcement:
          enum:
            - optional
            - required
          type: string
        id:
          type: string
          format: uuid
        is_enabled:
          type: boolean
        issuer:
          type: string
        jit_default_role:
          enum:
            - member
            - admin
            - read-only
          type: string
        jit_enabled:
          type: boolean
        last_login_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
        reverify_interval_hours:
          maximum: 720
          minimum: 1
          type: integer
        strategy:
          enum:
            - oidc
          type: string
        updated_at:
          type: string
          format: date-time
      required:
        - id
        - strategy
        - issuer
        - client_id
        - is_enabled
        - enforcement
        - jit_enabled
        - jit_default_role
        - reverify_interval_hours
        - break_glass_user_ids
        - last_login_at
        - created_at
        - updated_at
      title: OrganisationSSOConnection
      type: object
    OrganisationSSODomain:
      properties:
        domain:
          type: string
        id:
          type: string
          format: uuid
        is_verified:
          type: boolean
        last_checked_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
        verification_record_name:
          type: string
        verification_record_value:
          type: string
        verified_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
      required:
        - id
        - domain
        - verification_record_name
        - verification_record_value
        - is_verified
        - verified_at
        - last_checked_at
      title: OrganisationSSODomain
      type: object
    OrganisationSSOGroupMapping:
      properties:
        group:
          type: string
        id:
          type: string
          format: uuid
        role:
          enum:
            - member
            - admin
            - read-only
          type: string
      required:
        - id
        - group
        - role
      title: OrganisationSSOGroupMapping
      type: object
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
  securitySchemes:
    SessionCookie:
      description: Browser session. Mutations also require X-Ankra-CSRF.
      in: cookie
      name: ankra_session
      type: apiKey

````