For the base URL, authentication and errors, see the REST API overview.
GET /v1/users/{user}/syncs
- Request: GET /v1/users/{user}/syncs
- Operation: ListSyncs
- Operation ID:
Sync_List - Authentication: access token,
Authorization: Bearer YOUR_TOKEN
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
user | path | string | yes |
Example request
curl 'https://YOUR_SERVER/v1/users/YOUR_USER/syncs' \
-H 'Authorization: Bearer YOUR_TOKEN'Responses
| Status | Description |
|---|---|
| 200 | ok |
| 401 | unauthorized |
| 403 | forbidden |
Response example (200)
[
{
"created": 1792263090740,
"enabled": true,
"modified": 1792263090740,
"name": "Firmware uploads",
"sync": "firmware_uploads"
},
{
"created": 1792263090740,
"description": "Only one controller can dose at a time",
"enabled": true,
"modified": 1792263090740,
"name": "Dosing pump",
"sync": "dosing_pump"
}
]POST /v1/users/{user}/syncs
- Request: POST /v1/users/{user}/syncs
- Operation: CreateSync
- Operation ID:
Sync_Create - Authentication: access token,
Authorization: Bearer YOUR_TOKEN
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
user | path | string | yes |
Request body (application/json, required)
A sync is a shared semaphore: 'available' slots that devices or scripts take with locks (POST .../syncs/{sync}/locks) and release, e.g. to let only N devices use a resource at the same time. 'timeout' (seconds) is the default lock lifetime; 0 = until released.
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
config | object | yes | ||
config | object | no | Variant 1: | |
config.available | integer | yes | Minimum: 0 | Variant 1: |
config.timeout | integer | no | Minimum: 0 | Variant 1: |
description | string | no | Maximum length: 255 | A brief description of the resource, providing context or additional information, limited to 255 characters. |
enabled | boolean | yes | ||
name | string | yes | Maximum length: 255 | The name of the resource, limited to 255 characters. It can include any character. |
sync | string | yes | Pattern: ^[a-zA-Z0-9_-]{1,32}$ | A unique identifier for resources, consisting of alphanumeric characters, underscores, or hyphens, and limited to 32 characters. |
Example request: Limit concurrent uploads
curl -X POST 'https://YOUR_SERVER/v1/users/YOUR_USER/syncs' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"config": {
"available": 5,
"timeout": 600
},
"enabled": true,
"name": "Firmware uploads",
"sync": "firmware_uploads"
}'Example body: One device at a time
{
"config": {
"available": 1,
"timeout": 120
},
"description": "Only one controller can dose at a time",
"enabled": true,
"name": "Dosing pump",
"sync": "dosing_pump"
}Responses
| Status | Description |
|---|---|
| 200 | ok |
| 401 | unauthorized |
| 403 | forbidden |
GET /v1/users/{user}/syncs/{sync}
- Request: GET /v1/users/{user}/syncs/
- Operation: ReadSyncConfig
- Operation ID:
Sync_ReadConfig - Authentication: access token,
Authorization: Bearer YOUR_TOKEN
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
user | path | string | yes | |
sync | path | string | yes |
Example request
curl 'https://YOUR_SERVER/v1/users/YOUR_USER/syncs/YOUR_SYNC' \
-H 'Authorization: Bearer YOUR_TOKEN'Responses
| Status | Description |
|---|---|
| 200 | ok |
| 401 | unauthorized |
| 403 | forbidden |
Response example (200, Limit concurrent uploads)
{
"config": {
"available": 5,
"timeout": 600
},
"created": 1792263090740,
"enabled": true,
"modified": 1792263090740,
"name": "Firmware uploads",
"sync": "firmware_uploads"
}Response example (200, One device at a time)
{
"config": {
"available": 1,
"timeout": 120
},
"created": 1792263090740,
"description": "Only one controller can dose at a time",
"enabled": true,
"modified": 1792263090740,
"name": "Dosing pump",
"sync": "dosing_pump"
}PUT /v1/users/{user}/syncs/{sync}
- Request: PUT /v1/users/{user}/syncs/
- Operation: UpdateSync
- Operation ID:
Sync_Update - Authentication: access token,
Authorization: Bearer YOUR_TOKEN
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
user | path | string | yes | |
sync | path | string | yes |
Request body (application/json, required)
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
config | object | no | ||
config | object | no | Variant 1: | |
config.available | integer | yes | Minimum: 0 | Variant 1: |
config.timeout | integer | no | Minimum: 0 | Variant 1: |
description | string | no | Maximum length: 255 | A brief description of the resource, providing context or additional information, limited to 255 characters. |
enabled | boolean | no | ||
name | string | no | Maximum length: 255 | The name of the resource, limited to 255 characters. It can include any character. |
Example request: Disable
curl -X PUT 'https://YOUR_SERVER/v1/users/YOUR_USER/syncs/YOUR_SYNC' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"enabled": false
}'Example body: More slots
{
"config": {
"available": 10,
"timeout": 600
}
}Responses
| Status | Description |
|---|---|
| 200 | ok |
| 401 | unauthorized |
| 403 | forbidden |
DELETE /v1/users/{user}/syncs/{sync}
- Request: DELETE /v1/users/{user}/syncs/
- Operation: DeleteSync
- Operation ID:
Sync_Delete - Authentication: access token,
Authorization: Bearer YOUR_TOKEN
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
user | path | string | yes | |
sync | path | string | yes |
Example request
curl -X DELETE 'https://YOUR_SERVER/v1/users/YOUR_USER/syncs/YOUR_SYNC' \
-H 'Authorization: Bearer YOUR_TOKEN'Responses
| Status | Description |
|---|---|
| 200 | ok |
| 401 | unauthorized |
| 403 | forbidden |
GET /v1/users/{user}/syncs/{sync}/clone
- Request: GET /v1/users/{user}/syncs/{sync}/clone
- Operation: CloneSyncConfig
- Operation ID:
Sync_CloneConfig - Authentication: access token,
Authorization: Bearer YOUR_TOKEN
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
user | path | string | yes | |
sync | path | string | yes |
Example request
curl 'https://YOUR_SERVER/v1/users/YOUR_USER/syncs/YOUR_SYNC/clone' \
-H 'Authorization: Bearer YOUR_TOKEN'Responses
| Status | Description |
|---|---|
| 200 | ok |
| 401 | unauthorized |
| 403 | forbidden |
POST /v1/users/{user}/syncs/{sync}/clone
- Request: POST /v1/users/{user}/syncs/{sync}/clone
- Operation: CloneSync
- Operation ID:
Sync_Clone - Authentication: access token,
Authorization: Bearer YOUR_TOKEN
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
user | path | string | yes | |
sync | path | string | yes |
Request body (application/json, required)
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
description | string | no | Maximum length: 255 | A brief description of the resource, providing context or additional information, limited to 255 characters. |
enabled | boolean | no | ||
name | string | no | Maximum length: 255 | The name of the resource, limited to 255 characters. It can include any character. |
sync | string | yes | Pattern: ^[a-zA-Z0-9_-]{1,32}$ | A unique identifier for resources, consisting of alphanumeric characters, underscores, or hyphens, and limited to 32 characters. |
Example request: Copy with a new id
curl -X POST 'https://YOUR_SERVER/v1/users/YOUR_USER/syncs/YOUR_SYNC/clone' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"sync": "copy_of_sync"
}'Example body: Copy with name and description
{
"description": "Same configuration as the original, for production line 2",
"name": "Line 2 copy",
"sync": "line_2_sync"
}Responses
| Status | Description |
|---|---|
| 200 | ok |
| 401 | unauthorized |
| 403 | forbidden |
GET /v1/users/{user}/syncs/{sync}/locks
- Request: GET /v1/users/{user}/syncs/{sync}/locks
- Operation: ListSyncLocks
- Operation ID:
Sync_ListLocks - Authentication: access token,
Authorization: Bearer YOUR_TOKEN
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
user | path | string | yes | |
sync | path | string | yes |
Example request
curl 'https://YOUR_SERVER/v1/users/YOUR_USER/syncs/YOUR_SYNC/locks' \
-H 'Authorization: Bearer YOUR_TOKEN'Responses
| Status | Description |
|---|---|
| 200 | ok |
| 401 | unauthorized |
| 403 | forbidden |
Response example (200)
[
{
"created": 1792263090741,
"lock": "pump_controller_1",
"modified": 1792263090741,
"name": "Controller 1"
},
{
"created": 1792263090741,
"lock": "bulk_job",
"modified": 1792263090741,
"slots": 2
}
]POST /v1/users/{user}/syncs/{sync}/locks
- Request: POST /v1/users/{user}/syncs/{sync}/locks
- Operation: CreateSyncLock
- Operation ID:
Sync_CreateLock - Authentication: access token,
Authorization: Bearer YOUR_TOKEN
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
user | path | string | yes | |
sync | path | string | yes |
Request body (application/json, required)
Takes 'slots' (default 1) of the sync. Fails when not enough slots are free. 'timeout' (seconds) overrides the sync default; without lock id a random one is assigned. Delete the lock to release it.
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
description | string | no | Maximum length: 255 | A brief description of the resource, providing context or additional information, limited to 255 characters. |
lock | string | no | Pattern: ^[a-zA-Z0-9_-]{1,32}$ | A unique identifier for resources, consisting of alphanumeric characters, underscores, or hyphens, and limited to 32 characters. |
name | string | no | Maximum length: 255 | The name of the resource, limited to 255 characters. It can include any character. |
slots | number | no | ||
timeout | number | no |
Example request: Take one slot
curl -X POST 'https://YOUR_SERVER/v1/users/YOUR_USER/syncs/YOUR_SYNC/locks' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"lock": "pump_controller_1",
"name": "Controller 1"
}'Example body: Two slots for 60 seconds
{
"lock": "bulk_job",
"slots": 2,
"timeout": 60
}Responses
| Status | Description |
|---|---|
| 200 | ok |
| 401 | unauthorized |
| 403 | forbidden |
GET /v1/users/{user}/syncs/{sync}/locks/{lock}
- Request: GET /v1/users/{user}/syncs/{sync}/locks/
- Operation: ReadSyncLockConfig
- Operation ID:
Sync_ReadLockConfig - Authentication: access token,
Authorization: Bearer YOUR_TOKEN
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
user | path | string | yes | |
sync | path | string | yes | |
lock | path | string | yes |
Example request
curl 'https://YOUR_SERVER/v1/users/YOUR_USER/syncs/YOUR_SYNC/locks/YOUR_LOCK' \
-H 'Authorization: Bearer YOUR_TOKEN'Responses
| Status | Description |
|---|---|
| 200 | ok |
| 401 | unauthorized |
| 403 | forbidden |
Response example (200, Take one slot)
{
"created": 1792263090741,
"lock": "pump_controller_1",
"modified": 1792263090741,
"name": "Controller 1"
}Response example (200, Two slots for 60 seconds)
{
"created": 1792263090741,
"lock": "bulk_job",
"modified": 1792263090741,
"slots": 2,
"timeout": 60
}PUT /v1/users/{user}/syncs/{sync}/locks/{lock}
- Request: PUT /v1/users/{user}/syncs/{sync}/locks/
- Operation: UpdateSyncLock
- Operation ID:
Sync_UpdateLock - Authentication: access token,
Authorization: Bearer YOUR_TOKEN
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
user | path | string | yes | |
sync | path | string | yes | |
lock | path | string | yes |
Request body (application/json, required)
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
description | string | no | Maximum length: 255 | A brief description of the resource, providing context or additional information, limited to 255 characters. |
name | string | no | Maximum length: 255 | The name of the resource, limited to 255 characters. It can include any character. |
Example request: Rename
curl -X PUT 'https://YOUR_SERVER/v1/users/YOUR_USER/syncs/YOUR_SYNC/locks/YOUR_LOCK' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"name": "Controller 1 - night shift"
}'Responses
| Status | Description |
|---|---|
| 200 | ok |
| 401 | unauthorized |
| 403 | forbidden |
DELETE /v1/users/{user}/syncs/{sync}/locks/{lock}
- Request: DELETE /v1/users/{user}/syncs/{sync}/locks/
- Operation: DeleteSyncLock
- Operation ID:
Sync_DeleteLock - Authentication: access token,
Authorization: Bearer YOUR_TOKEN
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
user | path | string | yes | |
sync | path | string | yes | |
lock | path | string | yes |
Example request
curl -X DELETE 'https://YOUR_SERVER/v1/users/YOUR_USER/syncs/YOUR_SYNC/locks/YOUR_LOCK' \
-H 'Authorization: Bearer YOUR_TOKEN'Responses
| Status | Description |
|---|---|
| 200 | ok |
| 401 | unauthorized |
| 403 | forbidden |
PUT /v1/users/{user}/syncs/{sync}/projects
- Request: PUT /v1/users/{user}/syncs/{sync}/projects
- Operation: UpdateSyncProjects
- Operation ID:
Sync_UpdateProjects - Authentication: access token,
Authorization: Bearer YOUR_TOKEN
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
user | path | string | yes | |
sync | path | string | yes |
Request body (application/json, required)
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
(body) | array of string | no | Projects the resource belongs to, as <owner>@<project> ids. Replaces the whole list: read the current one first to add or remove a single project; [] removes it from every project. |
Example request: No projects
curl -X PUT 'https://YOUR_SERVER/v1/users/YOUR_USER/syncs/YOUR_SYNC/projects' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '[]'Example body: One project
[
"YOUR_USER@greenhouse"
]Example body: Two projects
[
"YOUR_USER@greenhouse",
"YOUR_USER@maintenance"
]Responses
| Status | Description |
|---|---|
| 200 | ok |
| 401 | unauthorized |
| 403 | forbidden |