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

# Change a token exchange profile



## OpenAPI

````yaml put /api/airouter/token-exchange/{name}
openapi: 3.1.0
info:
  title: Nx1 AI API
  description: |

    AI API for Nx1 Data Platform Management and Automated Data Tasks.

    Authentication is required via PSK in Authorization header.

    Default PSK is | [ask a friend] |
  version: 0.10.2
servers: []
security: []
paths:
  /api/airouter/token-exchange/{name}:
    put:
      tags:
        - AI Router
      summary: Change a token exchange profile
      operationId: update_token_exchange_profile_api_airouter_token_exchange__name__put
      parameters:
        - name: name
          in: path
          required: true
          schema:
            type: string
            title: Name
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TokenExchangeProfileRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TokenExchangeProfile'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - OAuth2AuthorizationCodeBearer: []
        - APIKeyHeader: []
components:
  schemas:
    TokenExchangeProfileRequest:
      properties:
        name:
          type: string
          maxLength: 64
          minLength: 1
          pattern: ^[A-Za-z0-9][A-Za-z0-9_.-]*$
          title: Name
        token_url:
          type: string
          maxLength: 500
          minLength: 1
          title: Token Url
          description: The identity provider's token endpoint.
        client_id:
          type: string
          maxLength: 200
          minLength: 1
          title: Client Id
          description: The router's own client.
        client_secret:
          anyOf:
            - type: string
              maxLength: 500
            - type: 'null'
          title: Client Secret
          description: >-
            That client's secret. Omit to keep the stored one; '' removes it.
            Never returned — the response says only whether one is set.
        audience:
          anyOf:
            - type: string
              maxLength: 200
            - type: 'null'
          title: Audience
          description: >-
            What the exchanged token is minted for, usually the backend's client
            id. An endpoint may override it.
        scope:
          anyOf:
            - type: string
              maxLength: 500
            - type: 'null'
          title: Scope
        resource:
          anyOf:
            - type: string
              maxLength: 500
            - type: 'null'
          title: Resource
        subject_token_header:
          anyOf:
            - type: string
              maxLength: 100
            - type: 'null'
          title: Subject Token Header
          description: >-
            Header the caller's token is read from. Empty means 'authorization',
            with any 'Bearer ' prefix stripped.
        cache_ttl_seconds:
          anyOf:
            - type: integer
              maximum: 86400
              minimum: 0
            - type: 'null'
          title: Cache Ttl Seconds
          description: >-
            How long an exchanged token is reused. The provider's own expires_in
            is used when it is shorter.
        timeout_seconds:
          anyOf:
            - type: integer
              maximum: 60
              minimum: 1
            - type: 'null'
          title: Timeout Seconds
          description: Bounds one exchange call; a caller's request waits on it.
        verify_tls:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Verify Tls
          description: Check the token endpoint's certificate. On unless set false.
      type: object
      required:
        - name
        - token_url
        - client_id
      title: TokenExchangeProfileRequest
      description: Create or replace a profile. The name can't change on update.
    TokenExchangeProfile:
      properties:
        name:
          type: string
          title: Name
        token_url:
          type: string
          title: Token Url
        client_id:
          type: string
          title: Client Id
        has_client_secret:
          type: boolean
          title: Has Client Secret
          default: false
        audience:
          anyOf:
            - type: string
            - type: 'null'
          title: Audience
        scope:
          anyOf:
            - type: string
            - type: 'null'
          title: Scope
        resource:
          anyOf:
            - type: string
            - type: 'null'
          title: Resource
        subject_token_header:
          anyOf:
            - type: string
            - type: 'null'
          title: Subject Token Header
        cache_ttl_seconds:
          anyOf:
            - type: integer
            - type: 'null'
          title: Cache Ttl Seconds
        timeout_seconds:
          anyOf:
            - type: integer
            - type: 'null'
          title: Timeout Seconds
        verify_tls:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Verify Tls
        endpoints:
          items:
            type: string
          type: array
          title: Endpoints
        updated_by:
          anyOf:
            - type: string
            - type: 'null'
          title: Updated By
        updated_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Updated At
      type: object
      required:
        - name
        - token_url
        - client_id
      title: TokenExchangeProfile
      description: 'A profile as the UI sees it: everything but the secret itself.'
    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:
    OAuth2AuthorizationCodeBearer:
      type: oauth2
      flows:
        authorizationCode:
          scopes: {}
          authorizationUrl: >-
            https://sso-rapid.rapid.nx1cloud.com/realms/rapid/protocol/openid-connect/auth
          tokenUrl: >-
            https://sso-rapid.rapid.nx1cloud.com/realms/rapid/protocol/openid-connect/token
    APIKeyHeader:
      type: apiKey
      in: header
      name: Authorization-PSK

````

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