Reference

API reference

Control OTADart from your own tools: apps, releases, patches, tracks and rollouts.

1. Get an API key

  1. Open the console and go to API keys.
  2. Pick a name and access level: Viewer (read only), Developer (releases, patches, rollouts) or Admin (also apps and team).
  3. Copy the key (it starts with otd_). It is shown once.
export OTADART_API_KEY=otd_your_key_here

Send 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"
ItemValue
Base URLhttps://otadart.dev/v1/api
Auth headerAuthorization: Bearer otd_…
BodyJSON (Content-Type: application/json); artifact uploads are raw bytes
Errors{"error": "message"} with status 400, 401, 403, 404, 409 or 429

Endpoints

Method & pathWhat it doesAccess
GET /workspaceYour workspace, apps, releases, team and planViewer
POST /appsCreate an app → { id }. Body: { "name" }Admin
PATCH /apps/{appId}Rename an app. Body: { "name" }Admin
GET /apps/{appId}/configurationotadart.yaml and public key for the appViewer
GET /apps/{appId}/tracksTracks and the default trackViewer
POST /apps/{appId}/tracksBody: { "action": "create" | "default" | "remove", "name" }Developer
POST /releasesRegister a release (release.json from otadart release)Developer
GET /releases/{releaseId}Patches and what each track servesViewer
DELETE /releases/{releaseId}Delete a release and its patchesAdmin
PUT /artifacts/{sha256}Upload patch bytes (application/octet-stream, max 32 MiB)Developer
POST /apps/{appId}/patchesSign and publish a patchDeveloper
POST /apps/{appId}/rolloutPut a patch on a track, change rollout, or roll backDeveloper

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 wantBody 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 beta

Every otadart command works with OTADART_API_KEY — handy for CI.

Limits & safety

  1. Patch files: up to 32 MiB.
  2. API keys cannot create other keys, change billing or sign in.
  3. Every patch and rollout is signed by OTADart with your app’s key before devices accept it.
  4. Revoked keys stop working immediately.

Related: CLI reference · CI & automation · Get help · Troubleshooting