Reference
API reference
Control OTADart from your own tools: apps, releases, patches, tracks and rollouts.
1. Get an API key
- Open the console and go to API keys.
- Pick a name and access level: Viewer (read only), Developer (releases, patches, rollouts) or Admin (also apps and team).
- Copy the key (it starts with otd_). It is shown once.
export OTADART_API_KEY=otd_your_key_hereSend it on every request in the Authorization header. A key belongs to one workspace and never has more access than the person who created it. Revoke it any time in the console.
2. Make a request
curl https://otadart.dev/v1/api/workspace \
-H "Authorization: Bearer $OTADART_API_KEY"| Item | Value |
|---|---|
| Base URL | https://otadart.dev/v1/api |
| Auth header | Authorization: Bearer otd_… |
| Body | JSON (Content-Type: application/json); artifact uploads are raw bytes |
| Errors | {"error": "message"} with status 400, 401, 403, 404, 409 or 429 |
Endpoints
| Method & path | What it does | Access |
|---|---|---|
| GET /workspace | Your workspace, apps, releases, team and plan | Viewer |
| POST /apps | Create an app → { id }. Body: { "name" } | Admin |
| PATCH /apps/{appId} | Rename an app. Body: { "name" } | Admin |
| GET /apps/{appId}/configuration | otadart.yaml and public key for the app | Viewer |
| GET /apps/{appId}/tracks | Tracks and the default track | Viewer |
| POST /apps/{appId}/tracks | Body: { "action": "create" | "default" | "remove", "name" } | Developer |
| POST /releases | Register a release (release.json from otadart release) | Developer |
| GET /releases/{releaseId} | Patches and what each track serves | Viewer |
| DELETE /releases/{releaseId} | Delete a release and its patches | Admin |
| PUT /artifacts/{sha256} | Upload patch bytes (application/octet-stream, max 32 MiB) | Developer |
| POST /apps/{appId}/patches | Sign and publish a patch | Developer |
| POST /apps/{appId}/rollout | Put a patch on a track, change rollout, or roll back | Developer |
Example: publish a patch (Android & iOS)
Same steps for each platform; use the release ID of that platform. Giving both the same number keeps patch #2 the same fix everywhere.
API=https://otadart.dev/v1/api
AUTH="Authorization: Bearer $OTADART_API_KEY"
APP=your-app-id
# 1. Upload the patch file (its SHA-256 is the address)
HASH=$(shasum -a 256 android.patch | cut -d" " -f1)
curl -X PUT "$API/artifacts/$HASH" -H "$AUTH" \
-H "Content-Type: application/octet-stream" --data-binary @android.patch
# 2. Publish it as patch #2 of the Android release
curl -X POST "$API/apps/$APP/patches" -H "$AUTH" -H "Content-Type: application/json" \
-d '{"releaseId":"ANDROID_RELEASE_ID","number":2,"artifactFormat":"android-aot-elf-v1","encoding":"full","hash":"'$HASH'"}'
# 3. Send it to 25% of beta users
curl -X POST "$API/apps/$APP/rollout" -H "$AUTH" -H "Content-Type: application/json" \
-d '{"releaseId":"ANDROID_RELEASE_ID","channel":"beta","patchNumber":2,"rolloutBps":2500}'For iOS, upload ios.patch and use the iOS release ID with "artifactFormat":"dart-dynamic-module-v1". Use "encoding":"otadart-delta-v1" when the file is a delta made by the CLI.
Rollouts and rollback
| You want | Body for POST /apps/{appId}/rollout |
|---|---|
| Patch #2 to everyone on stable | { "releaseId": "…", "channel": "stable", "patchNumber": 2 } |
| Patch #2 to 10% of beta | { "releaseId": "…", "channel": "beta", "patchNumber": 2, "rolloutBps": 1000 } |
| Roll stable back to the store build | { "releaseId": "…", "channel": "stable", "patchNumber": 0 } |
| Roll back to patch #1 | { "releaseId": "…", "channel": "stable", "patchNumber": 1 } |
rolloutBps is basis points: 10000 = 100%, 2500 = 25%. Add "expectedRevision" to refuse the change if someone else changed the track first (you get 409).
Example: read what is live
curl "$API/releases/IOS_RELEASE_ID" -H "$AUTH"{
"patches": [{ "number": 2, "hash": "…", "size": 1184 }],
"deployments": [{ "channel": "stable", "patchNumber": 2, "rolloutBps": 10000, "revision": 3 }]
}Use the key with the CLI
export OTADART_API_KEY=otd_…
otadart patch all --track betaEvery otadart command works with OTADART_API_KEY — handy for CI.
Limits & safety
- Patch files: up to 32 MiB.
- API keys cannot create other keys, change billing or sign in.
- Every patch and rollout is signed by OTADart with your app’s key before devices accept it.
- Revoked keys stop working immediately.