---
updatedAt: 2026-06-12T23:00:16.000Z
agentTools:
  projectIndex: https://developers.7shifts.com/llms.txt
---

# Create OAuth Token

> ❗️ OAuth Token URL
>
> To acquire a token use the following URL:
>
> **`https://app.7shifts.com/oauth2/token`**
>
> Due to a limitation in our sandbox you will not be able to use the **Try It!** button on this page to acquire a token. You can use curl as per the example below.

#### Scopes

For the list of valid scopes reference the valid scopes in the [Authentication page](https://developers.7shifts.com/reference/authentication#access-scopes) under in API Usage.

#### Sample Request

```curl
curl --request POST --url 'https://app.7shifts.com/oauth2/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=client_credentials' \
--data-urlencode 'client_id={CLIENT_ID}' \
--data-urlencode 'client_secret={CLIENT_SECRET}' \
--data-urlencode 'scope=v1_access companies:read companies:write locations:read locations:write users:read users:write departments:read departments:write roles:read roles:write sales:read sales:write shifts:read shifts:write time_punches:read time_punches:write events:read events:write'
```

#### Sample Response

```json
{
    "token_type":"Bearer",
    "expires_in":3600,
    "access_token":"eyJ0eXAiOiJKV1QiLCJhbZciOiJSUzI1NiJ9.eyJhdWQiOiJhOWQyMWFjNGYwNmJiOTYzMzQzY2I4NmQ3NmZkMGE5ZRTMxN2NmOTg4IiwianRpIjoiNjEwZDYyNzQwYzAxNDYzYzFjNzc1NWQxOTc0ZGNlMjk0ZGIxNzI1ZGQzYTMzMThkMmQzNjBkNTk1N2JiYWZkYmI0YjljOTA3ZDUwMjBjNTEiLCJpYXQiOjE2NTcyOTYxNzgsIm5iZiI6MTY1NzI5NjE3OCwiZXhwIjoxNjU3Mjk5Nzc4LCJzdWIiOiIiLCJzY29wZXMiOlsidjFfYWNjZXNzIiwiY29tcGFuaWVzOnJlYWQiLCJjb21wYW5pZXM6d3JpdGUiLCJsb2NhdGlvbnM6cmVhZCIsImxvY2F0aW9uczp3cml0ZSIsInVzZXJzOnJlYWQiLCJ1c2Vyczp3cml0ZSIsImRlcGFydG1lbnRzOnJlYWQiLCJkZXBhcnRtZW50czp3cml0ZSIsInJvbGVzOnJlYWQiLCJyb2xlczp3cml0ZSIsInNhbGVzOnJlYWQiLCJzYWxlczp3cml0ZSIsInNoaWZ0czpyZWFkIiwic2hpZnRzOndyaXRlIiwidGltZV9wdW5jaGVzOnJlYWQiLCJ0aW1lX3B1bmNoZXM6d3JpdGUiLCJldmVudHM6cmVhZCIsImV2ZW50czp3cml0ZSJdfQ.mKInbUWiytfKxL65cYMuoMKR5ATvjOGttiViZ4bMwP0Xff6EEfPu3QzriGusB6wQmK6t3YYzJjFQei_GD80w1GnzcXd1rYU9NOcIys8o-EjLWGd7m2NG7uMWHBYNyI8gvSzABei7GlAKK2ha1RvFOp9gf9nnITisydGI-7kA2Guv0mnKo3mLyTz-RHBavMRLiTIDL2BZPZtWaoIMXQqTVspspJOIfZ0H2XN037aMMqdLHHnKiP-tJJAP9U9S9jX3jI73iNz4Cv6U802ossytwSUzAOs9vZuqE4cH0DfTAQmvqIgG56WUFszhQMWPWC0IMgIc5HIMnXSgab68sf-RBA"
}
```

# OpenAPI definition

```json
{
  "openapi": "3.0.2",
  "info": {
    "title": "7shifts API",
    "contact": {
      "email": "api-support@7shifts.com"
    },
    "version": "2026-06-01"
  },
  "servers": [
    {
      "url": "https://api.7shifts.com",
      "description": "Production server"
    }
  ],
  "paths": {
    "/oauth2/token": {
      "post": {
        "tags": [
          "Authentication"
        ],
        "summary": "Create OAuth Token",
        "operationId": "oauthToken",
        "x-public-api": true,
        "security": [],
        "servers": [
          {
            "url": "https://app.7shifts.com",
            "description": "Override base path token generation"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "grant_type": {
                    "description": "Token grant type. For Partner OAuth tokens specifying client_credentials",
                    "type": "string",
                    "enum": [
                      "client_credentials",
                      "password",
                      "authorization_code",
                      "refresh_token"
                    ]
                  },
                  "client_id": {
                    "type": "string"
                  },
                  "client_secret": {
                    "type": "string"
                  },
                  "scope": {
                    "type": "string",
                    "description": "A space-delimited list of scopes."
                  },
                  "code": {
                    "type": "string",
                    "description": "The authorization code returned by the auth server response to oauth2/authorize. Used by authorization code flow"
                  },
                  "code_verifier": {
                    "type": "string",
                    "description": "The code_verifier parameter as described in the PKCE specification. Used by authorization code flow"
                  },
                  "redirect_ui": {
                    "type": "string",
                    "description": "The URI to redirect to upon a successful request. Used by authorization code flow. This URI must have been configured previously"
                  }
                },
                "required": [
                  "grant_type",
                  "client_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "token_type": {
                      "type": "string",
                      "enum": [
                        "Bearer"
                      ]
                    },
                    "expires_in": {
                      "type": "integer",
                      "description": "Number of seconds until token expires."
                    },
                    "access_token": {
                      "type": "string",
                      "description": "Your authorization token"
                    },
                    "refresh_token": {
                      "type": "string",
                      "description": "Refresh token used to refresh access token, if available"
                    }
                  },
                  "required": [
                    "token_type",
                    "expires_in",
                    "access_token"
                  ]
                }
              }
            }
          },
          "500": {
            "description": "Unexpected error",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "enum": [
                        "invalid_request",
                        "invalid_client",
                        "invalid_scope",
                        "invalid_credentials",
                        "invalid_grant",
                        "unsupported_grant_type",
                        "access_denied",
                        "server_error"
                      ]
                    },
                    "error_description": {
                      "type": "string"
                    },
                    "hint": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "OAuth2": {
        "type": "oauth2",
        "flows": {
          "clientCredentials": {
            "tokenUrl": "https://app.7shifts.com/oauth2/token",
            "refreshUrl": "https://app.7shifts.com/oauth2/token",
            "scopes": {
              "v1_access": "Required to access APIv1 endpoints."
            }
          },
          "password": {
            "tokenUrl": "https://app.7shifts.com/oauth2/token",
            "refreshUrl": "https://app.7shifts.com/oauth2/token",
            "scopes": {
              "v1_access": "Required to access APIv1 endpoints."
            }
          },
          "authorizationCode": {
            "authorizationUrl": "https://app.7shifts.com/oauth2/authorize",
            "tokenUrl": "https://app.7shifts.com/oauth2/token",
            "refreshUrl": "https://app.7shifts.com/oauth2/token",
            "scopes": {
              "v1_access": "Required to access APIv1 endpoints."
            }
          }
        }
      },
      "cookieAuth": {
        "type": "apiKey",
        "in": "cookie",
        "name": "7session"
      }
    }
  },
  "security": [
    {
      "OAuth2": []
    },
    {
      "cookieAuth": []
    }
  ],
  "tags": [
    {
      "name": "Authentication"
    }
  ]
}
```