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:

  1. API Keys - Include your API key in the Authorization header:

    curl -H "Authorization: Bearer YOUR_API_KEY" https://api.xata.tech/...
  2. 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

Branches

Metrics

Error Handling

The API uses standard HTTP status codes to indicate the success or failure of requests:

  • 200 OK: The request was successful
  • 201 Created: A new resource was successfully created
  • 204 No Content: The request was successful but no content is returned
  • 400 Bad Request: The request was malformed or contained invalid parameters
  • 401 Unauthorized: Authentication failed or is missing
  • 404 Not Found: The requested resource does not exist
  • 5XX: 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 window
  • X-RateLimit-Remaining: The number of requests remaining in the current time window
  • X-RateLimit-Reset: The time when the current rate limit window resets (Unix timestamp)