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

# Get OAuth Token

> Exchange client credentials for a JWT access token

Exchange your client ID and client secret for a JWT access token that can be used to authenticate subsequent API requests.

<Warning>
  **Rate Limited**: This endpoint is rate-limited. You should cache the returned token and reuse it until it expires (60 minutes).
</Warning>

## Token Lifecycle

1. Request a token using your client credentials
2. Use the token in the `Authorization: Bearer <token>` header
3. Token expires after 60 minutes
4. Request a new token before expiration

## Example Usage

```javascript theme={null}
const response = await fetch('https://public.api.live.turrisfi.com/v1/auth/jwt', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    client_id: 'your-client-id',
    client_secret: 'your-client-secret'
  })
});

const { access_token } = await response.json();
```


## OpenAPI

````yaml openapi/v1.json POST /v1/auth/jwt
openapi: 3.0.0
info:
  title: Turris Public API
  description: API for managing insurance compliance data
  version: 1.0.0
  contact: {}
servers:
  - url: https://public.api.live.turrisfi.com
    description: Production
  - url: https://public.api.sandbox.turrisfi.com
    description: Sandbox
security: []
tags: []
paths:
  /v1/auth/jwt:
    post:
      tags:
        - auth
      operationId: AuthController_getToken_v1
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GetTokenDto'
      responses:
        '201':
          description: JWT access token response
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/GetTokenResponse'
                  requestId:
                    type: string
                    description: Unique request identifier
                    example: dev-2c5e7cf2-9acf-4c8c-ab2f-b81f39d775a8
                  timestamp:
                    type: string
                    description: Response timestamp
                    example: '2025-11-12T20:49:03.293Z'
                required:
                  - data
                  - requestId
                  - timestamp
        '401':
          description: Invalid client credentials
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseDto'
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseDto'
components:
  schemas:
    GetTokenDto:
      type: object
      properties:
        clientId:
          type: string
          description: Your API client ID
          example: m2m-client-abc123
        clientSecret:
          type: string
          description: Your API client secret
          example: your-client-secret
      required:
        - clientId
        - clientSecret
    GetTokenResponse:
      type: object
      properties:
        accessToken:
          type: string
          description: JWT access token
          example: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...
        expiresIn:
          type: number
          description: Token expiration time in seconds
          example: 3600
        tokenType:
          type: string
          description: Token type
          example: Bearer
      required:
        - accessToken
        - expiresIn
        - tokenType
    ErrorResponseDto:
      type: object
      properties:
        statusCode:
          type: number
          description: HTTP status code
        requestId:
          type: string
          description: Unique request identifier for debugging
        errorType:
          type: string
          description: Error type classification
        errorMessage:
          description: Array of error messages
          type: array
          items:
            type: string
        timestamp:
          type: string
          description: ISO timestamp when the error occurred
        details:
          type: object
          description: Additional error context
      required:
        - statusCode
        - requestId
        - errorType
        - errorMessage
        - timestamp

````