REST API
Interact with Xata programmatically using our REST API
The Xata REST API allows you to programmatically manage your databases, branches, and data. All API endpoints are available at https://api.xata.tech
.
Authentication
The API supports OpenID Connect authentication. You can authenticate using:
-
API Keys - Include your API key in the
Authorization
header:curl -H "Authorization: Bearer YOUR_API_KEY" https://api.xata.tech/...
-
OpenID Connect - For OAuth2/OIDC flows, use the appropriate authentication headers.
Available Endpoints
The API is organized into the following sections:
Authentication API
Organizations
Users
API Keys
Projects API
Projects
- List projects
- Create project
- Get project details
- Update project
- Delete project
- Get available regions
Branches
Metrics
Error Handling
The API uses standard HTTP status codes to indicate the success or failure of requests:
200 OK
: The request was successful201 Created
: A new resource was successfully created204 No Content
: The request was successful but no content is returned400 Bad Request
: The request was malformed or contained invalid parameters401 Unauthorized
: Authentication failed or is missing404 Not Found
: The requested resource does not exist5XX
: Server error
Error responses include a JSON object with error details:
{
"id": "error_identifier",
"message": "Human-readable error message explaining the issue"
}
Rate Limiting
API requests are subject to rate limiting. The current limits are:
- 100 requests per minute per API key
- 1000 requests per hour per API key
Rate limit headers are included in all responses:
X-RateLimit-Limit
: The maximum number of requests allowed per time windowX-RateLimit-Remaining
: The number of requests remaining in the current time windowX-RateLimit-Reset
: The time when the current rate limit window resets (Unix timestamp)