---
updatedAt: 2026-04-24T10:48:18.000Z
agentTools:
  projectIndex: https://docs.omnidocs.cloud/llms.txt
---

# Get Token

Get a bearer token from an api secret.

The client id and client secret should be included in a Basic Authorization header, but they can also be included in the form, if necessary.

# OpenAPI definition

```json
{
  "openapi": "3.0.4",
  "info": {
    "title": "Omnidocs API",
    "contact": {
      "name": "Omnidocs Support",
      "url": "https://support.omnidocs.com/hc/en-us/requests/new"
    },
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://app.omnidocs.cloud"
    }
  ],
  "paths": {
    "/api/v1/oauth2/token": {
      "post": {
        "tags": [
          "OAuth2"
        ],
        "summary": "Get Token",
        "description": "Get a bearer token from an api secret.\n\nThe client id and client secret should be included in a Basic Authorization header, but they can also be included in the form, if necessary.",
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "properties": {
                  "client_id": {
                    "type": "string"
                  },
                  "client_secret": {
                    "type": "string"
                  },
                  "grant_type": {
                    "enum": [
                      "client_credentials"
                    ],
                    "type": "string"
                  }
                }
              },
              "encoding": {
                "client_id": {
                  "style": "form"
                },
                "client_secret": {
                  "style": "form"
                },
                "grant_type": {
                  "style": "form"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The token metadata",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "access_token": {
                      "type": "string"
                    },
                    "token_type": {
                      "type": "string",
                      "default": "Bearer"
                    },
                    "expires_in": {
                      "type": "integer",
                      "default": 3600
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request response with problem details on the error.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized response with problem details on the error.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden response with problem details on the error.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not found response with problem details on the error.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        },
        "security": [
          {
            "Basic": []
          },
          {}
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "OAuth2": {
        "type": "oauth2",
        "flows": {
          "clientCredentials": {
            "tokenUrl": "/api/v1/oauth2/token",
            "scopes": {}
          }
        }
      },
      "Bearer": {
        "type": "apiKey",
        "name": "Authorization",
        "in": "header"
      },
      "Basic": {
        "type": "apiKey",
        "name": "Authorization",
        "in": "header"
      }
    }
  },
  "security": [
    {
      "OAuth2": []
    },
    {
      "Bearer": []
    }
  ],
  "tags": [
    {
      "name": "OAuth2",
      "description": "Auth endpoints, following the OAuth2 specification."
    }
  ]
}
```