Skip to content

Developer API

CRUD endpoints for humans and CI pipelines. All endpoints accept either a personal API token (PAT) or a project-scoped token (constrained to that project).

Base path: /api/v1/ (project resources under /api/v1/projects/, caller identity and personal tokens under /api/v1/me/)

Conventions

  • All requests/responses are JSON unless noted (artifact upload uses multipart/form-data).
  • Timestamps are ISO 8601 UTC.
  • Every path identifier is a UUID. project.slug is returned in responses as a human label, but no endpoint accepts it in place of the project id.
  • List endpoints return plain JSON arrays (no pagination wrapper).

Resource map

Resource Endpoint Methods
Caller /me/ GET
Projects /projects/ GET, POST
/projects/{id}/ GET, DELETE
Users /users?email= GET
Project audit /projects/{id}/audit/ GET
Release (one-shot) /projects/{id}/release/ POST
Personal tokens /me/tokens/ GET, POST
/me/tokens/{tid}/ DELETE
Project tokens /projects/{id}/tokens/ GET, POST
/projects/{id}/tokens/{tid}/ DELETE
Signing keys /projects/{id}/signing-keys/ GET, POST
/projects/{id}/signing-keys/{key_id}/ DELETE
Devices /projects/{id}/devices/ GET, POST
/projects/{id}/devices/{did}/ GET, PATCH, DELETE
/projects/{id}/devices/{did}/token/ POST, DELETE
Device checks /projects/{id}/devices/{did}/check-events/ GET
Groups /projects/{id}/groups/ GET, POST
/projects/{id}/groups/{gid}/members/ GET, POST
/projects/{id}/groups/{gid}/members/{did}/ DELETE
Channels /projects/{id}/channels/ GET, POST
Artifacts /projects/{id}/artifacts/ GET, POST
/projects/{id}/artifacts/{aid}/ PATCH
/projects/{id}/artifacts/{aid}/strict-signature/ POST
Deployments /projects/{id}/deployments/ GET, POST
/projects/{id}/deployments/{did}/ GET
/projects/{id}/deployments/{did}/transition/ POST
/projects/{id}/deployments/{did}/states/ GET
/projects/{id}/deployments/{did}/devices/ GET

Devices usually create themselves. The common path is auto-registration: a device appears the first time it calls /api/v1/ota/check/. You can also POST /devices/ to pre-provision one and get its per-device token back, which is what a factory flashing rig wants. PATCH updates the active flag and metadata; DELETE removes the device and its history, so prefer setting active: false unless you really want it gone.

Per-device tokens are issued and rotated with POST /devices/{did}/token/. The raw value is returned once and never again. DELETE on the same path revokes it.

Groups and channels are collection-only. There are no individual GET /groups/{id}/ or GET /channels/{id}/ endpoints; fetch the list and filter client-side. This is also the only way to discover a channel's UUID, which CI needs to target a deployment.

Deleting a project requires a personal access token; a project-scoped token cannot delete its own project. It is refused while any deployment is active or paused.

Staff personal tokens may read another owner's project resources, including the audit list, but may write only to their own projects. Staff project lists require an exact email or an owner_id query parameter. GET /me/ returns the account on the personal token, including id and email, which those filters take. GET /users?email= is a staff-only exact email lookup. These read-only support requests are excluded from the customer's audit log. Staff mutations remain owner-scoped, and normal customer mutations continue to emit their documented audit events.

Selected endpoints

GET /me/

Returns the identity of the bearer token. A personal token returns the account. A project token with api scope returns that project's id and name, plus the scopes stored on the token.

Personal token:

{
  "token_type": "personal",
  "account": {
    "id": 12,
    "email": "ada@example.com",
    "username": "ada",
    "is_staff": false
  }
}

Project token:

{
  "token_type": "project",
  "project": {
    "id": "8e1f…",
    "name": "Demo"
  },
  "scopes": ["api", "device"]
}

A project token response contains token_type, project, and scopes. A missing token, or a project token with only device scope, receives the same 401 as the other developer API routes.

GET /projects/{id}/devices/

Returns every device in the project, including the full set of compatibility dimensions the decision engine matches on. If a device is not being offered a build, compare these against the artifact's manifest to see which dimension excludes it (see compatibility).

Optional query parameters:

Parameter Values Behavior
active Boolean Filters by active status.
group_id Group UUID Returns devices in the group. An unknown or cross-project UUID returns an empty list.
channel_id Channel UUID Returns devices on the channel. An unknown or cross-project UUID returns an empty list.

When group_id and channel_id are both set, a device must match both.

{
  "device_id":            "esp32-demo-0001",
  "framework":            "esp_idf",
  "chip_family":          "esp32",
  "board_id":             "esp32-devkitc",
  "hardware_revision":    "",
  "partition_profile":    "",
  "nvs_schema_version":   1,
  "security_mode":        "signed",
  "require_manifest":     false,
  "current_build_number": 2,
  "current_version_label":"v2.0",
  "last_ota_status":      "confirmed",
  "active":               true,
  "last_seen":            "2026-07-24T20:52:00Z",
  "last_check_at":        "2026-07-24T20:52:00Z",
  "last_check_status":    "up_to_date",
  "check_state":          "no_pending_check",
  "group_ids":            ["1a2652ac-83d5-4b52-9026-70f59121f331"]
}

security_mode is what a device reports about itself, so it is the field to watch during a basic to signed migration: devices still reporting basic have not yet taken the key-aware build. require_manifest is true while the device's last check-in said it takes strict-ready builds only (strict mode).

last_check_at and last_check_status describe the most recently recorded OTA decision. check_state describes whether a new check is expected:

  • never_seen: the device has no heartbeat or recorded check.
  • waiting_for_next_check: an active deployment targets the device and no check or offer has been recorded since that deployment started.
  • no_pending_check: the API has no evidence that the device owes a check. This says nothing about device activity, compatibility, or whether an update is available. Use last_check_status for the latest decision outcome.

device_id is null for a device created without one until a check-in with its device token saves the ID its board reports (see POST /projects/{id}/devices/).

group_ids lists the device's groups in ascending group-name order, with the group UUID as a stable tie-breaker. Devices without groups return an empty list. The same fields are returned by the device detail, create, update, and group-members endpoints.

POST /projects/{id}/devices/

Creates a device and issues its per-device token. The response is the device representation plus raw_token, which is returned only this once.

Field Required Notes
name When device_id is absent Up to 128 characters.
device_id When name is absent Trimmed, and a MAC address is normalised to upper-case AA:BB:CC:DD:EE:FF. An ID already in the project returns 409.
framework No Defaults to the project's default framework.

Without device_id, the device's device_id is null until a check-in with its device token saves the ID the board reports. A saved device_id does not change. A reported ID that belongs to another device in the project, or that is over 64 characters, is not saved. Check events record each reported ID of 64 characters or fewer as reported_device_id.

400 covers a missing name and device_id, a blank device_id, a device_id over 64 characters, a name over 128 characters, an unknown framework and a full plan.

GET /projects/{id}/devices/{did}/check-events/

Returns the device's recorded OTA decisions in deterministic newest-first order. The write path retains the newest 20 records per device without a time expiry. Recording is best effort so an observability failure does not change an otherwise valid OTA response.

Optional query parameters:

Parameter Values Behavior
limit Integer Defaults to 20 and is capped at 20.
since ISO 8601 timestamp Includes records created at or after the timestamp.
decision offered, no_update Filters the top-level decision.
status offered, up_to_date, no_compatible_build, device_inactive, over_limit, not_in_rollout, no_active_deployment Filters the detailed outcome.

Each record includes id, project_id, device_id, created_at, decision, status, optional deployment_id, optional artifact_build_number, optional reported_build_number, reported_version, reported_device_id (the normalised device_id the check-in sent, or "" when it sent none or one over 64 characters), and message.

POST /projects/{id}/artifacts/

Uploads a firmware artifact. multipart/form-data only.

curl -X POST https://simpleota.com/api/v1/projects/${PID}/artifacts/ \
  -H "Authorization: Bearer ${TOKEN}" \
  -F "manifest=$(jq -c . manifest.json)" \
  -F "binary=@firmware.bin"

Form fields:

Field Type Notes
manifest string (JSON) Validated against the manifest schema.
binary file Streamed to object storage; SHA-256 computed.

The manifest can also carry an optional sha256 field, the SHA-256 of your binary as 64 hexadecimal characters in either case, which the server compares with the SHA-256 it computes from the file it received. If the two differ, the upload fails with 400 before anything is reserved, so no artifact is created, no build number is allocated and your monthly upload count stays where it was. The detail reads sha256 mismatch: expected <manifest value>, received <server digest>, with your value shown in lower case. A value that isn't 64 hexadecimal characters fails as a normal manifest invalid error instead, and leaving the field out changes nothing. Either way, the checksum_sha256 stored on the artifact is the digest the server computed.

Response 201:

{
  "id":               "8e1f…",
  "build_number":     24,
  "version_label":    "1.4.2",
  "framework":        "arduino",
  "chip_family":      "esp32",
  "board_id":         "esp32dev",
  "checksum_sha256":  "8f3c…",
  "file_size":        1287456,
  "security_mode":    "basic",
  "signing_key_id":   "",
  "strict_ready":     false,
  "manifest_version": null,
  "archived":         false,
  "created_at":       "2026-04-25T17:21:00Z"
}

signing_key_id names the key that signed a signed build and is empty for basic. strict_ready turns true once a strict signature is attached with POST /projects/{id}/artifacts/{aid}/strict-signature/.

Failure modes, all 400 with the message in detail:

  • "manifest must be JSON: …" or "manifest invalid: …" when the manifest does not parse or does not validate. Note the manifest rejects unknown keys, so a misspelled field fails here rather than being ignored.
  • "sha256 mismatch: expected …, received …" when the manifest's sha256 doesn't match the uploaded file, as described above.
  • "monthly artifact upload limit reached for current plan; upgrade your plan to upload more."
  • "binary is … MiB, over this plan's … MiB limit for a single firmware image."

Each plan limits the number of devices, uploads per month and the size of a single firmware binary (see Plans and limits). An oversize binary is rejected before the upload is reserved, so it doesn't count against your monthly uploads.

PATCH /projects/{id}/artifacts/{aid}/

Archives an artifact, or returns it to circulation. The only field is archived.

{ "archived": true }

An archived build is never offered to a device and cannot be chosen for a new deployment, while the record of which devices ran it is kept. Artifacts are never deleted.

Returns 400 while a draft, active or paused deployment still references the build:

{ "detail": "1 deployment still reference this artifact; cancel or complete them first." }

That keeps a deployment's own state the single answer to what it can reach.

POST /projects/{id}/artifacts/{aid}/strict-signature/

Attaches a strict signature to a signed build, which makes it a strict-ready build. Devices in strict mode are offered strict-ready builds only. The signature is Ed25519, by the key that signed the image, over these bytes, each line ended by one \n:

SimpleOTA-Manifest-v1
<project id: the project's UUID, lowercase, with hyphens>
<signing key id of the build>
<build number, decimal>
<checksum_sha256 of the build, lowercase>
{ "manifest_signature": "bF9i2/VJ…PRAw==", "manifest_version": 1 }

manifest_version is optional and must be 1. The server checks the signature against the project's registered public key, and returns the artifact with "strict_ready": true. Sending the same signature again returns the artifact unchanged, so the call is safe to retry.

Failure modes, all 400 with the message in detail: the build's binary upload has not completed, the build is not signed, its signing key is revoked or not registered, the signature is not base64 of 64 bytes, manifest_version is not 1, or the signature does not verify for this build, for example because it names another build number. The call returns 404 when the token cannot change the project (a staff personal token on another user's project included) or the artifact is not in it.

POST /projects/{id}/release/

Upload, create a deployment and start it, in one call. This is what the SimpleOTA GitHub Actions use for a ship-on-merge pipeline. multipart/form-data only.

curl -X POST https://simpleota.com/api/v1/projects/${PID}/release/ \
  -H "Authorization: Bearer ${TOKEN}" \
  -F "manifest=$(jq -c . manifest.json)" \
  -F "binary=@firmware.bin" \
  -F "channel_name=stable" \
  -F "rollout_percentage=100"

Form fields:

Field Type Default Notes
manifest string (JSON) required Same schema as the artifact upload, including the optional sha256.
binary file required The application image.
channel_name string stable By name, not id. Must already exist.
rollout_percentage int 100 0..100.

The optional sha256 check works exactly as it does on POST /projects/{id}/artifacts/ above, and a mismatch here also means no deployment is created.

Response 201:

{
  "artifact_id":   "8e1f…",
  "build_number":  24,
  "deployment_id": "b93c…",
  "state":         "active",
  "channel":       "stable"
}

Unlike POST /deployments/, the resulting deployment is already started, and the channel is named rather than addressed by UUID. Use the three-call flow (artifacts → deployments → transition) when you need canary percentages, device-group targeting, or a human approval step in between.

POST /projects/{id}/deployments/

{
  "artifact_id":          "8e1f…",
  "target_group_ids":     ["<group-uuid>"],
  "target_channel_ids":   ["<channel-uuid>"],
  "rollout_percentage":   5,
  "rollout_strategy":     "immediate",
  "notes":                ""
}

artifact_id is required. target_group_ids and target_channel_ids are optional. Within each list, any id matches. When both lists are non-empty, the device must match a group and a channel. An empty list is not a filter on that axis. Leaving both lists empty includes every device in the project. There is no endpoint to attach targets after creation.

Most fleets target the default channel

The dashboard's quick upload applies the project's default channel for you. From the API this is explicit: fetch GET /projects/{id}/channels/, take the entry with "is_default": true, and pass its id in target_channel_ids. Devices belong to a channel (stable by default), so this is the usual way to reach a whole fleet.

The remaining fields are optional. Deployments are created in draft state; call /transition/ with {"action": "start"} to activate. Starting a deployment that names neither groups nor channels includes every device in the project. When that project has two or more devices, start and resume require "confirm_all": true. A project with no devices cannot start that deployment. Returns the new deployment object.

The create, GET /projects/{id}/deployments/{did}/ and /transition/ responses include compatible_audience_device_count: the number of active devices in the deployment's audience whose stored framework, chip family, board, hardware revision, partition profile, NVS schema version and security mode are compatible with its artifact. A device in strict mode counts only once the artifact is strict-ready. It uses the OTA endpoint's compatibility check, applied to the metadata stored for each device at request time. A check-in updates that metadata before the OTA endpoint runs the check, so a device's next check-in can change the result. The count does not apply the rollout percentage, the deployment's state, the artifact's status or per-device retry exhaustion, so a canary at 5% reports the same count as at 100%. GET /projects/{id}/deployments/ omits the field.

GET /projects/{id}/deployments/{did}/devices/

Lists the devices that compatible_audience_device_count counts: active devices in the deployment's audience whose stored metadata is compatible with its artifact at request time. Like the count, it does not apply the rollout percentage, the deployment's state, the artifact's status or per-device retry exhaustion, so it includes devices outside the current canary cohort. Devices appear here before they check in; compare with /states/, which lists only devices that have.

The response is paginated with limit (default 100, maximum 500) and offset (default 0). Items are ordered by device_id. count is the total across all pages. The list and compatible_audience_device_count come from the same set of devices. Each item has the same fields as GET /projects/{id}/devices/. Items are read after the devices are selected, so a device changed during the request shows its new values, and a device deleted during it is left out.

{
  "count": 2,
  "items": [
    { "id": "d7a2…", "device_id": "a4cf12…", "active": true, "…": "…" }
  ]
}

Auth matches the device list: a personal token for a project you own (or a staff personal token, read-only), or that project's token with the api scope.

GET /projects/{id}/deployments/{did}/states/

Returns per-device rollout state records for the deployment; one entry per device that has been offered the update or reported a result:

[
  {
    "id":                  "c4e1…",
    "device_id":           "d7a2…",
    "final_status":        "reboot",
    "eligible":            true,
    "assigned_to_rollout": true,
    "offered_at":          "2026-04-25T18:01:00Z",
    "download_started_at": "2026-04-25T18:02:00Z",
    "downloaded_at":       "2026-04-25T18:03:00Z",
    "flashed_at":          "2026-04-25T18:04:00Z",
    "rebooted_at":         null,
    "validated_at":        "2026-04-25T18:04:30Z",
    "reboot_at":           "2026-04-25T18:05:11Z",
    "confirmed_at":        null,
    "failed_at":           null,
    "rollback_at":         null,
    "status_reason":       ""
  }
]

device_id is the device record UUID. Current clients set reboot_at, while only legacy v0.1 clients set rebooted_at.

final_status values: pending, offered, download_started, downloaded, flashed, rebooted, validated, reboot, confirmed, failed, rolled_back. Use this to monitor rollout health without polling individual devices. confirmed is the terminal success state; failed and rolled_back are the terminal failure states.

POST /projects/{id}/deployments/{did}/transition/

Transitions a deployment's state. Payload:

{ "action": "start", "confirm_all": true }

Valid action values: start, pause, resume, cancel, complete, ramp (requires rollout_percentage). confirm_all is required on start and resume when the deployment names neither groups nor channels and the project has two or more devices. Invalid transitions return 400.

~~POST /projects/{id}/deployments/{did}/pause/~~

Removed. Use POST /transition/ with {"action": "pause"} instead.

Errors

Errors carry a single detail key:

{ "detail": "monthly artifact upload limit reached for current plan; …" }

Match on the HTTP status; detail is a human-readable message whose wording may change. Request-body schema failures return 422 with detail as an array rather than a string. See Errors.