The API lives under the base path /api/v1/, served from the same origin as your application:
| Environment | Base URL |
|---|---|
| Stardraw Cloud | https://stardraw.cloud/api/v1/ |
| Your custom domain | https://your-domain/api/v1/ |
Every call is authorized against the privileges of the calling user, so the API can only ever do what that user is allowed to do in the web app.
The API is fully described by an OpenAPI 3.0 document, which you can use to generate a typed client in your language of choice or load into any OpenAPI tool:
| Document | Endpoint |
|---|---|
| Stardraw Cloud API (JSON) | GET /api/v1/openapi.json |
| Stardraw Cloud API (YAML) | GET /api/v1/openapi.yaml |
| Admin API (JSON) | GET /api/v1/admin/openapi.json |
| Admin API (YAML) | GET /api/v1/admin/openapi.yaml |
Exchange your email address and password for an access token, then call an endpoint with it. Tokens are sent as a Bearer token in the Authorization header.
# 1. Get an access token
curl -X POST https://stardraw.cloud/api/v1/oauth/token \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=password&username=you@example.com&password=YOUR_PASSWORD"
# 2. Use the access_token from the response
curl -X POST https://stardraw.cloud/api/v1/projects/grid \
-H "Authorization: Bearer ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "startRow": 0, "endRow": 50 }'