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

# Add an identity provider

> Adds an identity provider whose tokens trust rules can accept.

> [!NOTE]
>
> [Workload identity federation](https://docs.baseten.co/organization/workload-identity.md) is in **Private Preview**.


## OpenAPI

````yaml post /v1/access/identity_providers
openapi: 3.1.0
info:
  description: REST API for management of Baseten resources
  title: Baseten management API
  version: 1.0.0
servers:
  - url: https://api.baseten.co
security:
  - BearerAuth: []
paths:
  /v1/access/identity_providers:
    post:
      summary: Adds an identity provider
      description: >-
        Adds an identity provider to the organization. For a provider with a
        per-customer issuer, the issuer must match the provider's format, and
        its signing keys are fetched before it's saved; a failure returns 422
        with the reason. Each provider with a fixed issuer can be added once.
        Only organization admins can call this endpoint.
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateIdentityProviderRequestV1'
        required: true
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IdentityProviderV1'
      x-codeSamples:
        - lang: bash
          source: |-
            curl --request POST \
            --url https://api.baseten.co/v1/access/identity_providers \
            --header "Authorization: Bearer $BASETEN_API_KEY" \
            --data '{
              "name": "prod-eks",
              "predefined": {
                "kind": "AWS_EKS",
                "issuer_url": "https://oidc.eks.us-west-2.amazonaws.com/id/EXAMPLED539D4633E53DE1B71EXAMPLE"
              }
            }'
        - lang: python
          source: |-
            import requests
            import os
            API_KEY = os.environ.get("BASETEN_API_KEY", "<YOUR_API_KEY>")
            url = "https://api.baseten.co/v1/access/identity_providers"

            headers = {"Authorization": f"Bearer {API_KEY}"}

            response = requests.request(
                "POST",
                url,
                headers=headers,
                json={'name': 'prod-eks', 'predefined': {'kind': 'AWS_EKS', 'issuer_url': 'https://oidc.eks.us-west-2.amazonaws.com/id/EXAMPLED539D4633E53DE1B71EXAMPLE'}}
            )

            print(response.text)
components:
  schemas:
    CreateIdentityProviderRequestV1:
      additionalProperties: false
      description: Request to add an identity provider.
      properties:
        name:
          anyOf:
            - maxLength: 255
              minLength: 1
              type: string
            - type: 'null'
          default: null
          description: >-
            Name, unique in the organization. Defaults to the provider's display
            name, so pass one when adding a second issuer of the same provider.
          title: Name
        description:
          anyOf:
            - maxLength: 1024
              type: string
            - type: 'null'
          default: null
          description: Optional description
          title: Description
        predefined:
          $ref: '#/components/schemas/CreatePredefinedIdentityProviderConfigV1'
          description: The predefined provider to add
      required:
        - predefined
      title: CreateIdentityProviderRequestV1
      type: object
    IdentityProviderV1:
      description: >-
        An OIDC issuer whose tokens the organization accepts for workload
        identity federation.
      properties:
        id:
          description: Identity provider ID
          title: Id
          type: string
        name:
          description: Name, unique in the organization
          title: Name
          type: string
        description:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: Description
          title: Description
        predefined:
          $ref: '#/components/schemas/PredefinedIdentityProviderConfigV1'
          description: Settings of the predefined provider
        created_by:
          description: ID of the user who added the provider
          title: Created By
          type: string
        created_at:
          description: Time the provider was added
          format: date-time
          title: Created At
          type: string
        updated_at:
          description: Time the provider was last updated
          format: date-time
          title: Updated At
          type: string
      required:
        - id
        - name
        - predefined
        - created_by
        - created_at
        - updated_at
      title: IdentityProviderV1
      type: object
    CreatePredefinedIdentityProviderConfigV1:
      additionalProperties: false
      description: Settings of the predefined identity provider to add.
      properties:
        kind:
          $ref: '#/components/schemas/PredefinedIdentityProviderKindV1'
          description: Which predefined provider. Can't be changed.
        issuer_url:
          anyOf:
            - maxLength: 1024
              type: string
            - type: 'null'
          default: null
          description: >-
            The `iss` claim of the provider's tokens. When adding AWS IAM,
            Amazon EKS, Azure managed identity, or Azure Kubernetes Service,
            pass your issuer in the format the predefined identity providers
            endpoint shows; it's unique in the organization. Can't be passed for
            other providers, or changed. Always set in responses.
          title: Issuer Url
      required:
        - kind
      title: CreatePredefinedIdentityProviderConfigV1
      type: object
    PredefinedIdentityProviderConfigV1:
      description: Settings of an identity provider that Baseten defines.
      properties:
        kind:
          $ref: '#/components/schemas/PredefinedIdentityProviderKindV1'
          description: Which predefined provider. Can't be changed.
        issuer_url:
          anyOf:
            - maxLength: 1024
              type: string
            - type: 'null'
          default: null
          description: >-
            The `iss` claim of the provider's tokens. When adding AWS IAM,
            Amazon EKS, Azure managed identity, or Azure Kubernetes Service,
            pass your issuer in the format the predefined identity providers
            endpoint shows; it's unique in the organization. Can't be passed for
            other providers, or changed. Always set in responses.
          title: Issuer Url
      required:
        - kind
      title: PredefinedIdentityProviderConfigV1
      type: object
    PredefinedIdentityProviderKindV1:
      description: An identity provider Baseten supports.
      enum:
        - GITHUB_ACTIONS
        - GCP
        - BASETEN
        - AWS_IAM
        - AWS_EKS
        - AZURE_MANAGED_IDENTITY_V1
        - AZURE_MANAGED_IDENTITY_V2
        - AZURE_AKS
      title: PredefinedIdentityProviderKindV1
      type: string
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        Send `Authorization: Bearer <api_key>`. The legacy `Authorization:
        Api-Key <api_key>` scheme is also accepted.

````