---
agentTools:
  projectIndex: https://sched.readme.io/llms.txt
---

# Get OAuth2 access token

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "sched.dev",
    "description": "Scheduling API",
    "version": "v1"
  },
  "servers": [
    {
      "url": "https://api.sched.dev",
      "description": "API Server"
    },
    {
      "url": "https://sandbox-api.sched.dev",
      "description": "Sandbox API Server"
    }
  ],
  "paths": {
    "/v1/auth/token": {
      "post": {
        "tags": [
          "Auth"
        ],
        "summary": "Get OAuth2 access token",
        "operationId": "login_v1_auth_token_post",
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/Body_login_v1_auth_token_post"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TokenResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Body_login_v1_auth_token_post": {
        "properties": {
          "grant_type": {
            "type": "string",
            "pattern": "client_credentials|client_id_grant",
            "title": "Grant Type"
          },
          "client_id": {
            "type": "string",
            "title": "Client Id"
          },
          "client_secret": {
            "type": "string",
            "title": "Client Secret"
          }
        },
        "type": "object",
        "required": [
          "grant_type"
        ],
        "title": "Body_login_v1_auth_token_post"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "TokenResponse": {
        "properties": {
          "access_token": {
            "type": "string",
            "title": "Access Token"
          },
          "token_type": {
            "type": "string",
            "title": "Token Type",
            "default": "bearer"
          },
          "expires_in": {
            "type": "integer",
            "title": "Expires In"
          }
        },
        "type": "object",
        "required": [
          "access_token",
          "expires_in"
        ],
        "title": "TokenResponse"
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "_id": {
    "buffer": {
      "0": 103,
      "1": 14,
      "2": 106,
      "3": 94,
      "4": 33,
      "5": 109,
      "6": 146,
      "7": 0,
      "8": 49,
      "9": 64,
      "10": 212,
      "11": 226
    }
  }
}
```