REST API Overview
The Daytona REST API provides programmatic access to manage sandboxes, snapshots, volumes, and other platform resources. Use the API to automate workflows, integrate with CI/CD pipelines, or build custom tooling.Base URL
The API is available at the following base URL:localhost:3000 with your Daytona instance URL.
API Version
The current API version is1.0. The API follows semantic versioning principles.
Authentication
All API requests require authentication. Daytona supports two authentication methods:- API Key - Bearer token authentication using API keys
- OAuth 2.0 - OpenID Connect authentication
SDKs vs REST API
When to Use SDKs
Daytona provides official SDKs for popular programming languages:- Python SDK - Pythonic interface with type hints
- TypeScript SDK - Full TypeScript support with IntelliSense
- Go SDK - Idiomatic Go with proper error handling
- Ruby SDK - Ruby conventions and best practices
- Building applications in supported languages
- You want type safety and IDE autocomplete
- You prefer higher-level abstractions
- You need automatic retry logic and error handling
When to Use the REST API
Use the REST API directly when:- Working with languages without official SDK support
- Building shell scripts or command-line tools
- Integrating with low-code/no-code platforms
- Debugging or testing API endpoints
- You need fine-grained control over HTTP requests
Request Format
All API requests must include:- Content-Type header - Set to
application/jsonfor requests with body - Authorization header - Bearer token with your API key
- Request body - Valid JSON (for POST, PUT, PATCH requests)
Example Request
Response Format
API responses are returned in JSON format with appropriate HTTP status codes.Success Response
Error Response
See Error Handling for detailed error codes and troubleshooting.Organization Context
Many API endpoints support multi-organization access. When using JWT authentication, specify the organization context using the header:Organization ID to use for the request. Required when using JWT tokens that have access to multiple organizations.
Pagination
List endpoints support pagination to handle large result sets efficiently.Paginated Endpoints
Endpoints ending with/paginated return structured pagination data:
Page number of results (minimum: 1)
Number of results per page (minimum: 1, maximum: 200)
Pagination Response
Filtering and Sorting
Many list endpoints support filtering and sorting capabilities.Filtering by Labels
Filtering by State
Sorting Results
Field to sort by (options: id, name, state, snapshot, region, updatedAt, createdAt)
Sort direction (options: asc, desc)
Rate Limiting
API requests are subject to rate limits to ensure platform stability. See Rate Limits for details.OpenAPI Specification
The complete OpenAPI 3.0 specification is available for:- Generating clients in any language
- API testing tools like Postman or Insomnia
- Documentation generators
Next Steps
Authentication
Learn how to authenticate API requests
Sandboxes API
Create and manage sandboxes
Rate Limits
Understand rate limiting policies
Error Codes
Handle API errors gracefully