Commands
Connect your application to Barq eLock commands with scoped access, idempotent submissions and recorded request receipts.
The examples below describe the API format. This documentation page sends no requests.
Access And Capabilities
Send your Barq-issued API token in Authorization: Bearer …. Command permission is required on both the key and subscription. Barq configures command access for the eLock’s current assignment.
Use the Barq id from GET /api/v1/devices/ as DEVICE_ID. Device passwords and private card IDs stay with Barq; they are not API request fields. Portal sign-in is a separate workflow.
/api/v1/devices/{device_id}/command-capabilities/Requires read permission. Returns the configured command kinds, dispatch flag and credential permissions without contacting the eLock.
curl --get "https://api.barqglobal.com/api/v1/devices/$DEVICE_ID/command-capabilities/" \
--header "Authorization: Bearer $BARQ_API_TOKEN"| Field | Use |
|---|---|
supported_kinds | Use a kind configured for this assignment. Lock and unlock both use lock. |
dispatch_enabled | Configured profile and dispatch availability. |
permitted | Configured profile and this credential’s command permissions. Submission also checks current assignment, pending receipts, cooldown and quotas. |
configuration_permitted | Also requires asset-management permission on the credential/member and subscription. Required for typed reporting and latent settings. |
named_instructions | Approved instruction labels available to command-authorised callers. |
Submit Lock Or Unlock
/api/v1/devices/{device_id}/commands/Prepare BARQ_API_TOKEN and DEVICE_ID privately. Generate BARQ_IDEMPOTENCY_KEY once per intentional action and persist it with the device and exact JSON body before submission.
export BARQ_IDEMPOTENCY_KEY="$(python3 -c 'import uuid; print(uuid.uuid4())')"For a lock request, send exactly kind and action as JSON:
curl --include --request POST "https://api.barqglobal.com/api/v1/devices/$DEVICE_ID/commands/" \
--header "Authorization: Bearer $BARQ_API_TOKEN" \
--header "Idempotency-Key: $BARQ_IDEMPOTENCY_KEY" \
--header "Content-Type: application/json" \
--data '{"kind":"lock","action":"lock"}'For a separate unlock intent, use {"kind":"lock","action":"unlock"} with its own saved key. Executing these examples with enabled credentials submits a real device request.
A recorded request returns its receipt id and relative read URL in Location. Persist both whenever present, alongside the HTTP status and body.
Read The Receipt
/api/v1/devices/{device_id}/commands/{command_id}/Set COMMAND_ID to the returned receipt id. This GET requires command permission and reads the stored request record. HTTP 200 confirms receipt retrieval; status describes the recorded request outcome.
curl --get "https://api.barqglobal.com/api/v1/devices/$DEVICE_ID/commands/$COMMAND_ID/" \
--header "Authorization: Bearer $BARQ_API_TOKEN"Receipt access follows the current company and device assignment. Contact Barq Administration for assistance with a previous receipt reference.
Accepted Request Receipt
Illustrative JSON for an accepted submission (HTTP 202) or its receipt read (HTTP 200). IDs and timestamps are examples; no request is made here.
{
"id": "523e4567-e89b-42d3-a456-426614174000",
"device_id": "123e4567-e89b-42d3-a456-426614174000",
"kind": "lock",
"action": "lock",
"status": "accepted",
"reason": "accepted",
"execution_verified": false,
"requested_parameters": {},
"blocks_new_commands": true,
"delivery_reviewed": false,
"delivered": false,
"delivered_at": null,
"created_at": "2026-09-30T12:00:00Z",
"updated_at": "2026-09-30T12:00:01Z"
}Request Tracking
The receipt records request processing. accepted acknowledges submission. execution_verified is false for request receipts and describes independent verification of physical execution. Read device status separately for the latest reported eLock state.
blocks_new_commands=true means another command cannot yet be submitted for this device. A recorded delivery (delivered=true, with delivered_at) or Barq’s delivery review releases that block. delivery_reviewed=true records the review while retaining the original request status. Delivery and review do not verify physical execution, and review does not cancel a queued request.
Use the saved receipt for follow-up. Barq Administration handles delivery review; provide the device reference, receipt ID and request time.
Idempotency
Keys are hyphenated UUIDs scoped to the company. Reusing a key for the same device, exact body, channel and unchanged assignment returns the matching saved receipt without dispatching again. A different device or body returns HTTP 409.
Use GET when a receipt ID is available. If a submission response is interrupted before an ID is received, retain the original key and body and contact Barq before repeating the POST. A repeat with no saved receipt can create the original request. Do not automatically retry POSTs or generate a replacement key for recovery.
Saved replays retain the original submission’s HTTP status. Receipt reads return HTTP 200 when the record is accessible.
Other Command Kinds
Use the kinds returned for your assigned device. Each body accepts only its documented fields.
| Kind | Fields | Contract |
|---|---|---|
lock | kind, action | Action: lock or unlock. |
query-statusquery-parametersquery-identifier | kind | Physical device queries using the command gates and quotas. Return request receipts. Use telemetry GETs for available readings. |
named | kind, instruction | Approved label from named_instructions. Optional parameters must be an empty object. |
text | kind, content | Exact Barq-approved value, one printable ASCII line up to 500 characters. Obtain the value privately from Barq. |
engine | kind, action | Approved compatible hardware; action cut or restore. A cut requires a stationary report received within 60 seconds and consumes one read. |
reporting-intervals | kind, parameters | eLock intelligent mode. Parameters: integer moving_seconds (5–1800) and stationary_seconds (300–43200). Requires verified device settings and asset-management permission as well as command permission. |
latent-interval | kind, parameters | eLock sleep mode. Parameter: integer wake_minutes (5–43200). Same verification and permissions. Tracking updates and queued commands may be delayed until the device wakes. |
query-version, query-corner | kind only | Request a supported eLock's version report or current corner setting. Requires explicit profile assignment. Returns a request receipt, not the raw device reply. |
corner-reporting | kind, parameters | Integer angle_degrees from 0–180; 0 disables corner reporting. Requires verified model/firmware and asset-management permission. |
latent-schedule | kind, parameters | local_times: one to four different 24-hour HH:MM strings in the device's configured local timezone. Confirm that timezone first. Changing it shifts all scheduled wake times. Same verification and permissions; no browser-timezone conversion or device-timezone change is performed. |
For example, a reporting request body is {"kind":"reporting-intervals","parameters":{"moving_seconds":30,"stationary_seconds":900}}. A separate latent-mode request uses {"kind":"latent-interval","parameters":{"wake_minutes":60}}. Use only one intended mode change with its own saved idempotency key. Interval and angle parameters require JSON integers; wake schedules require the documented time strings. No extra fields are accepted.
A wake schedule request is {"kind":"latent-schedule","parameters":{"local_times":["08:00","10:00","15:30","19:00"]}}. Corner reporting uses {"kind":"corner-reporting","parameters":{"angle_degrees":15}}. No extra parameters are accepted.
Settings receipts include requested_parameters, which records requested values only. Acceptance means queued, including when a device sleeps. Settings application and the new Version/Corner queries cannot yet be matched automatically; Barq must review delivery before another command can be submitted. Acceptance is not confirmation that the eLock applied a setting.
Limits And Responses
Company credentials share 10 writes and 5 command submissions per UTC minute. New commands for one device are separated by at least 10 seconds. Pending receipts also apply.
Capability and receipt GETs consume the read allowance. Follow Retry-After for read throttling and temporary availability responses. Coordinate command follow-up with Barq using the original receipt.
Use the submission reference, receipt reference and OpenAPI specification for complete response fields and HTTP status codes.
Integration Support
Share your device reference, receipt ID and request time with Barq Administration. Keep tokens, passwords and private card IDs private.