REST API
QLAM provides comprehensive OpenAPI documentation for all REST endpoints.
Accessing API Documentation
Each QLAM deployment hosts its own API documentation. Access it at:
https://<api-base-url>/docs/
For example:
| Deployment | API Docs URL |
|---|---|
| Demo | https://api.demo.quera.com/docs/ |
| Production | https://api.prod.quera.com/docs/ |
Why Per-Deployment Documentation?
API documentation is served directly from each QLAM deployment. This ensures the documentation always matches the exact API version running on that deployment, including available endpoints, request/response schemas, and supported features.
Finding Your API Base URL
Your API base URL is configured in your QLAM Shell configuration (~/.qsh/config.json):
{
"contexts": [
{
"name": "demo",
"defaults": {
"api_base_url": "https://api.demo.quera.com"
}
}
]
}
Append /docs/ to access the documentation.
Documentation Features
The hosted API documentation includes:
- Interactive explorer: Try API calls directly from the browser
- Request/response schemas: Complete data models for all endpoints
- Authentication details: Required scopes and permissions
- Code examples: Sample requests in multiple languages
Common Endpoints
While the full API is documented at each deployment, here are the most commonly used endpoints:
Tasks
| Method | Endpoint | Description |
|---|---|---|
POST |
/v2/tasks |
Submit a new task |
GET |
/v2/tasks/{id} |
Get task status |
GET |
/v2/tasks/{id}/results |
Get task results |
GET |
/v2/tasks |
List tasks |
Task Definitions
| Method | Endpoint | Description |
|---|---|---|
GET |
/v1/task-definitions |
List available task definitions |
GET |
/v1/task-definitions/{name} |
Get task definition details |
QPU Modes
| Method | Endpoint | Description |
|---|---|---|
GET |
/v1/qpu-modes |
List available QPU modes |
GET |
/v1/qpu-modes/{name} |
Get QPU mode details |
Using the API
Authentication
All API requests require a valid access token:
curl -X GET "https://api.demo.quera.com/v2/tasks" \
-H "Authorization: Bearer $ACCESS_TOKEN"
See Authentication for details on obtaining tokens.
Content Type
For requests with a body, use JSON:
curl -X POST "https://api.demo.quera.com/v2/tasks" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"task_definition": "qasm-10q", ...}'
Error Responses
Errors return standard HTTP status codes with details:
{
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid task payload",
"details": {
"field": "shots",
"reason": "Must be between 1 and 10000"
}
}
}
OpenAPI Specification
The raw OpenAPI specification is available at:
https://<api-base-url>/openapi.json
You can use this with tools like:
- Swagger Editor
- Postman
- Code generators (openapi-generator, etc.)
Next Steps
- Authentication - Set up API access
- Direct API Guide - Examples and patterns
- Task Lifecycle - Understand task states