Barq Global API Reference v1
Integration Guide

Commands

Connect your application to Barq eLock commands with scoped access, idempotent submissions and recorded request receipts.

1 · Check AccessRead the capabilities for your assigned eLock.
2 · Submit OnceSave a UUID key with the device and request body.
3 · Read The ReceiptUse the returned receipt ID for follow-up.

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.

GET/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 · Capabilities
curl --get "https://api.barqglobal.com/api/v1/devices/$DEVICE_ID/command-capabilities/" \
  --header "Authorization: Bearer $BARQ_API_TOKEN"
Capability Fields
FieldUse
supported_kindsUse a kind configured for this assignment. Lock and unlock both use lock.
dispatch_enabledConfigured profile and dispatch availability.
permittedConfigured profile and this credential’s command permissions. Submission also checks current assignment, pending receipts, cooldown and quotas.
configuration_permittedAlso requires asset-management permission on the credential/member and subscription. Required for typed reporting and latent settings.
named_instructionsApproved instruction labels available to command-authorised callers.

Submit Lock Or Unlock

POST/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.

Local UUID Generation
export BARQ_IDEMPOTENCY_KEY="$(python3 -c 'import uuid; print(uuid.uuid4())')"

For a lock request, send exactly kind and action as JSON:

cURL · Lock Request
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

GET/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 · Receipt
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.

Example Response

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.

JSON · Request Receipt
{
  "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.

JSON Body By Kind
KindFieldsContract
lockkind, actionAction: lock or unlock.
query-status
query-parameters
query-identifier
kindPhysical device queries using the command gates and quotas. Return request receipts. Use telemetry GETs for available readings.
namedkind, instructionApproved label from named_instructions. Optional parameters must be an empty object.
textkind, contentExact Barq-approved value, one printable ASCII line up to 500 characters. Obtain the value privately from Barq.
enginekind, actionApproved compatible hardware; action cut or restore. A cut requires a stationary report received within 60 seconds and consumes one read.
reporting-intervalskind, parameterseLock 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-intervalkind, parameterseLock 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-cornerkind onlyRequest a supported eLock's version report or current corner setting. Requires explicit profile assignment. Returns a request receipt, not the raw device reply.
corner-reportingkind, parametersInteger angle_degrees from 0–180; 0 disables corner reporting. Requires verified model/firmware and asset-management permission.
latent-schedulekind, parameterslocal_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.

Contact Barq Tech Support