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

# Create new Access Token

> Provides Bearer access tokens based on the client credentials grant type.

<Note>You will need valid `Client Credentials` (client\_id + client\_secret) to call this endpoint. See [Quickstart](/quickstart) or [Authentication](/api-reference/authentication) to get started.</Note>

We recommend that you only call this endpoint when you really need a new `access_token` for your client. You can reuse the token in your service and only call this endpoint when the time you retrieved this + `expires_in` is going to pass.


## OpenAPI

````yaml POST /v1/oauth/token
openapi: 3.0.0
info:
  title: Setle API
  description: ''
  version: '1.0'
  contact: {}
servers:
  - url: https://public-api.setle.app
security: []
tags: []
paths:
  /v1/oauth/token:
    post:
      tags:
        - General
      description: >-
        Provides Bearer access tokens based on the client credentials grant
        type.
      operationId: PublicApiController_requestBearerToken
      parameters:
        - name: x-setle-client-id
          required: true
          in: header
          schema:
            type: string
        - name: x-setle-client-secret
          required: true
          in: header
          schema:
            type: string
      responses:
        '200':
          description: Successfully authenticated and generated Bearer token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RequestBearerTokenActionOutputDto'
        '400':
          description: Request failed because of input validation errors.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DefaultHttpException'
        '500':
          description: Request failed because of internal server error(s).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerErrorException'
components:
  schemas:
    RequestBearerTokenActionOutputDto:
      type: object
      properties:
        access_token:
          type: string
        expires_in:
          type: number
        token_type:
          type: string
      required:
        - access_token
        - expires_in
        - token_type
    DefaultHttpException:
      type: object
      properties:
        statusCode:
          type: number
          description: >-
            HTTP status code for the response. Can be anything within the 4XX
            and 5XX range.
          example: 400
        message:
          type: object
          description: >-
            Main error message. This will generally be a string or array of
            strings, but could also be a custom object or array of objects
            without predefined schema.
          example:
            - Name should not be empty.
            - Password must contain at least 1 uppercase character.
        error:
          type: string
          description: Short string representation of the status code.
          example: Bad Request
      required:
        - statusCode
        - message
        - error
    InternalServerErrorException:
      type: object
      properties: {}

````