> ## Documentation Index
> Fetch the complete documentation index at: https://cognitio-agent.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Set auth credentials

> Set authentication credentials



## OpenAPI

````yaml /openapi.json put /auth/{providerID}
openapi: 3.1.1
info:
  title: cognitio
  description: cognitio api
  version: 1.0.0
servers: []
security: []
paths:
  /auth/{providerID}:
    put:
      summary: Set auth credentials
      description: Set authentication credentials
      operationId: auth.set
      parameters:
        - in: path
          name: providerID
          schema:
            type: string
          required: true
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Auth'
      responses:
        '200':
          description: Successfully set authentication credentials
          content:
            application/json:
              schema:
                type: boolean
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestError'
      x-codeSamples:
        - lang: js
          source: |-
            import { createCognitioClient } from "@cognitio/sdk

            const client = createCognitioClient()
            await client.auth.set({
              ...
            })
components:
  schemas:
    Auth:
      anyOf:
        - $ref: '#/components/schemas/OAuth'
        - $ref: '#/components/schemas/ApiAuth'
        - $ref: '#/components/schemas/WellKnownAuth'
    BadRequestError:
      type: object
      properties:
        data: {}
        errors:
          type: array
          items:
            type: object
            propertyNames:
              type: string
            additionalProperties: {}
        success:
          type: boolean
          const: false
      required:
        - data
        - errors
        - success
    OAuth:
      type: object
      properties:
        type:
          type: string
          const: oauth
        refresh:
          type: string
        access:
          type: string
        expires:
          type: number
        accountId:
          type: string
        enterpriseUrl:
          type: string
      required:
        - type
        - refresh
        - access
        - expires
    ApiAuth:
      type: object
      properties:
        type:
          type: string
          const: api
        key:
          type: string
        metadata:
          type: object
          propertyNames:
            type: string
          additionalProperties:
            type: string
      required:
        - type
        - key
    WellKnownAuth:
      type: object
      properties:
        type:
          type: string
          const: wellknown
        key:
          type: string
        token:
          type: string
      required:
        - type
        - key
        - token

````

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