| title | API Reference |
|---|---|
| description | Complete REST API documentation for Stack Auth |
| full | true |
Stack offers a REST API for backends & frontends of any programming language or framework. This API is used to authenticate users, manage user data, and more.
The following authentication headers are common to every endpoint:
curl https://api.stack-auth.com/api/v1/ \
-H "X-Stack-Access-Type: <either 'client' or 'server'>" \
-H "X-Stack-Project-Id: <your project UUID>" \
-H "X-Stack-Publishable-Client-Key: pck_<your publishable client key>" \
-H "X-Stack-Secret-Server-Key: ssk_<your secret server key>" \
-H "X-Stack-Access-Token: <the current user's access token>"| Header | Type | Description |
|---|---|---|
X-Stack-Access-Type |
"client" | "server" | Required. "client" (without quotes) for the frontend API, or "server" for the backend API. |
X-Stack-Project-Id |
UUID | Required. The project ID as found on the Stack dashboard. |
X-Stack-Publishable-Client-Key |
string | Required for client access. The API key as found on the Stack dashboard. |
X-Stack-Secret-Server-Key |
string | Required for server access. The API key as found on the Stack dashboard. |
X-Stack-Access-Token |
string | Optional. The access token for the current user. If not given, the request is considered to be logged out. |
**Server access type**, on the other hand, is for your backend server that you control. It has full access over all user data, and the secret server key should never be exposed to client-side code.
For more information, see the concept documentation on [StackApp](../concepts/stack-app#client-vs-server).
For more information, see the concept documentation on [StackApp](../concepts/stack-app#client-vs-server).
- `400 Bad Request` - Invalid request parameters
- `401 Unauthorized` - Invalid or missing authentication
- `403 Forbidden` - Insufficient permissions
- `404 Not Found` - Resource not found
- `429 Too Many Requests` - Rate limit exceeded
- `500 Internal Server Error` - Server error
Error responses include a JSON body with additional details about the error.
- Check out our Getting Started Guide for initial setup
- Visit our Concepts section to understand Stack Auth fundamentals
- Join our Discord community for support and discussions