FleetDeckDocs

API reference / Workers and bridges

Record a native action outcome

Use the action.id from claim, not the caller’s requestId.

POST/api/v1/worker/bridge/{actionId}/complete

Authorization

Bearer tokenworker:run; registered key, deviceId and workerId

Send Authorization: Bearer <FLEETDECK_API_KEY> with the scope above. The key must also grant access to the target device. Authentication guide ↗

Request example
Request · cURL
curl --request POST \
  --url 'https://fleetdeck.co/api/v1/worker/bridge/action_123/complete' \
  --header "Authorization: Bearer $FLEETDECK_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
  "workerId": "bridge-01",
  "deviceId": "device_123",
  "status": "completed",
  "result": {
    "status": "applied",
    "verified": false,
    "instruction": "Inspect the screen to verify application state"
  }
}'

Replace example IDs with returned values. Read credentials from your private environment.

Response examples
200 · success
{
  "recorded": true
}

Path parameters

actionIdstringrequired

Internal action ID returned by the bridge claim. This is distinct from the client requestId.

min 1 charactersmax 128 characters
Example: "action_123"
Validation pattern^[A-Za-z0-9._:-]+$

Request body application/json

workerIdstringrequired

Stable identifier for this worker process. Reuse it for claim, heartbeat and completion calls.

min 1 charactersmax 128 characters
Example: "bridge-01"
Validation pattern^[A-Za-z0-9._:-]+$
deviceIdstringrequired

Exact device ID from List devices. The current key must grant access to this phone.

min 1 charactersmax 128 characters
Example: "device_123"
Validation pattern^[A-Za-z0-9._:-]+$
statusstringrequired

Current state. A completed action means the driver finished; verify the intended screen or app effect separately.

Allowed:"completed""failed""unknown"
resultany JSONoptional

Driver output or null. Inspect the action status first; result formats vary by driver and command.

Unknown fields are rejected.

Behavior and limits

Use the action.id from claim, not the caller’s requestId. status is completed, failed or unknown. result is driver-defined JSON (null is allowed). Requires the original running action lease and bridge identity. Record unknown if delivery or effect is uncertain. Never re-execute an action to recover from a reporting failure.

Response 200

Recorded · application/json

recordedbooleanalways present

True when the completion report has been recorded.

Allowed:true

Errors

Expand a code for its recovery steps. Responses use error and code; validation errors also include issues.

401UNAUTHORIZEDMissing, malformed, expired or revoked credential; user verification/password state can also deny access.

Recovery: Use Authorization: Bearer with a valid scoped key. For dashboard routes, sign in. Job children require an active parent job and timely renewal.

Full error reference ↗
403FORBIDDENRequired scope, device grant, account membership or worker identity is missing.

Recovery: Check the endpoint’s scopes, exact device, owning key and workerId. A different key cannot access the original key’s sessions or jobs.

Full error reference ↗
404NOT_FOUNDUnknown route or resource unavailable to this caller.

Recovery: Check method/path and use returned IDs from this account/key. Do not guess IDs.

Full error reference ↗
402PLAN_REQUIREDDevice account has no active entitlement.

Recovery: Restore an active device entitlement in the workspace before controlling it.

Full error reference ↗
409LEASE_EXPIREDCompletion report no longer owns a live action/job lease.

Recovery: Do not rerun the work. Inspect action/job status and the device; record the uncertainty in agent evidence.

Full error reference ↗
400INVALID_JSONMissing or malformed JSON.

Recovery: Use valid JSON. Body-less routes should omit the body; required routes need their documented object.

Full error reference ↗
415CONTENT_TYPEA supplied JSON body lacks application/json content type.

Recovery: Set Content-Type: application/json; charset parameters are accepted.

Full error reference ↗
413TOO_LARGERequest body exceeds its byte limit.

Recovery: Keep /api/v1 bodies at or below 3,000,000 bytes and key creation at or below 16,384. Use media_chunk for large files.

Full error reference ↗
422VALIDATIONA field, type, bound or unknown property failed validation.

Recovery: Read issues[].path and issues[].message. Match the endpoint schema; strict objects reject extra fields.

Full error reference ↗
500INTERNALUnexpected service error.

Recovery: Save nonsecret request context and time for support. Query action status before repeating a mutation; never assume it did not execute.

Full error reference ↗

Example error messages are illustrative. Match the code and HTTP status; do not depend on exact message wording.