Synced sessions
/v1/threads/{threadId}/control/v1/threads/{threadId}/control/v1/threads/{threadId}/commands- post
/v1/threads/{threadId}/commands /v1/threads/{threadId}/commands/{commandId}- post
/v1/threads/{threadId}/commands/{commandId}/claim - post
/v1/threads/{threadId}/commands/{commandId}/result - post
/v1/threads/{threadId}/commands/{commandId}/cancel /v1/devices/{runnerDeviceId}/code-commands
Get code control
/v1/threads/{threadId}/controlParameters
threadId
Responses
200
runnerDeviceIdenabledexpiresAtserverTime
400
403
404
409
410
429
Errors
| Status | Code | When |
|---|---|---|
| 400 | Malformed fields, ciphertext or expiry. | |
| 401 | authentication_error | No key, or a key Gateway does not accept |
| 403 | role_required | Your role does not have this permission |
| 404 | not_found | Nothing matches the path in your organization |
| 404 | The session, command or device does not belong to the caller. | |
| 409 | A device is untrusted, control is disabled or offline, the organization forbids synced content, or a command state conflicts. | |
| 410 | The session was deleted. | |
| 429 | The bounded command mailbox is full. | |
| 429 | rate_limit_error | Too many requests from this key in a minute |
Example
curl "$NEXUS_URL/v1/threads/<threadId>/control" \
-H "Authorization: Bearer $NEXUS_API_KEY"Set code control
/v1/threads/{threadId}/controlParameters
threadId
Request body · application/json
runnerDeviceIdenabledexpiresAtsignature
Responses
200
runnerDeviceIdenabledexpiresAtserverTime
400
403
404
409
410
429
Errors
| Status | Code | When |
|---|---|---|
| 400 | invalid_request_error | A field is missing or not valid; the message names it |
| 400 | Malformed fields, ciphertext or expiry. | |
| 401 | authentication_error | No key, or a key Gateway does not accept |
| 403 | role_required | Your role does not have this permission |
| 404 | not_found | Nothing matches the path in your organization |
| 404 | The session, command or device does not belong to the caller. | |
| 409 | A device is untrusted, control is disabled or offline, the organization forbids synced content, or a command state conflicts. | |
| 410 | The session was deleted. | |
| 429 | The bounded command mailbox is full. | |
| 429 | rate_limit_error | Too many requests from this key in a minute |
Example
curl -X PUT "$NEXUS_URL/v1/threads/<threadId>/control" \
-H "Authorization: Bearer $NEXUS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"runnerDeviceId": "<runnerDeviceId>",
"enabled": false,
"expiresAt": 1,
"signature": "<signature>"
}'List code commands
/v1/threads/{threadId}/commandsParameters
threadIdrunnerDeviceId
Responses
200
commandsidsenderDeviceIdrunnerDeviceIdexpiresAtlockedKeysealedsignaturewaitsthreadIdstate
400
403
404
409
410
429
Errors
| Status | Code | When |
|---|---|---|
| 400 | invalid_request_error | A field is missing or not valid; the message names it |
| 400 | Malformed fields, ciphertext or expiry. | |
| 401 | authentication_error | No key, or a key Gateway does not accept |
| 403 | role_required | Your role does not have this permission |
| 404 | not_found | Nothing matches the path in your organization |
| 404 | The session, command or device does not belong to the caller. | |
| 409 | A device is untrusted, control is disabled or offline, the organization forbids synced content, or a command state conflicts. | |
| 410 | The session was deleted. | |
| 429 | The bounded command mailbox is full. | |
| 429 | rate_limit_error | Too many requests from this key in a minute |
Example
curl "$NEXUS_URL/v1/threads/<threadId>/commands?runnerDeviceId=%3CrunnerDeviceId%3E" \
-H "Authorization: Bearer $NEXUS_API_KEY"Send code command
post
/v1/threads/{threadId}/commandsParameters
threadId
Request body · application/json
idsenderDeviceIdrunnerDeviceIdexpiresAtlockedKeysealedsignaturewaits
Responses
200
idsenderDeviceIdrunnerDeviceIdexpiresAtlockedKeysealedsignaturewaitsthreadIdstate
400
403
404
409
410
429
Errors
| Status | Code | When |
|---|---|---|
| 400 | invalid_request_error | A field is missing or not valid; the message names it |
| 400 | Malformed fields, ciphertext or expiry. | |
| 401 | authentication_error | No key, or a key Gateway does not accept |
| 403 | role_required | Your role does not have this permission |
| 404 | not_found | Nothing matches the path in your organization |
| 404 | The session, command or device does not belong to the caller. | |
| 409 | A device is untrusted, control is disabled or offline, the organization forbids synced content, or a command state conflicts. | |
| 410 | The session was deleted. | |
| 429 | The bounded command mailbox is full. | |
| 429 | rate_limit_error | Too many requests from this key in a minute |
Example
curl -X POST "$NEXUS_URL/v1/threads/<threadId>/commands" \
-H "Authorization: Bearer $NEXUS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"id": "<id>",
"senderDeviceId": "<senderDeviceId>",
"runnerDeviceId": "<runnerDeviceId>",
"expiresAt": 1,
"lockedKey": "<lockedKey>",
"sealed": "<sealed>",
"signature": "<signature>"
}'Get code command
/v1/threads/{threadId}/commands/{commandId}Parameters
threadIdcommandId
Responses
200
idsenderDeviceIdrunnerDeviceIdexpiresAtlockedKeysealedsignaturewaitsthreadIdstate
400
403
404
409
410
429
Errors
| Status | Code | When |
|---|---|---|
| 400 | Malformed fields, ciphertext or expiry. | |
| 401 | authentication_error | No key, or a key Gateway does not accept |
| 403 | role_required | Your role does not have this permission |
| 404 | not_found | Nothing matches the path in your organization |
| 404 | The session, command or device does not belong to the caller. | |
| 409 | A device is untrusted, control is disabled or offline, the organization forbids synced content, or a command state conflicts. | |
| 410 | The session was deleted. | |
| 429 | The bounded command mailbox is full. | |
| 429 | rate_limit_error | Too many requests from this key in a minute |
Example
curl "$NEXUS_URL/v1/threads/<threadId>/commands/<commandId>" \
-H "Authorization: Bearer $NEXUS_API_KEY"Claim code command
post
/v1/threads/{threadId}/commands/{commandId}/claimParameters
threadIdcommandId
Request body · application/json
runnerDeviceIdsignature
Responses
200
claimedcommandidsenderDeviceIdrunnerDeviceIdexpiresAtlockedKeysealedsignaturewaitsthreadIdstate
400
403
404
409
410
429
Errors
| Status | Code | When |
|---|---|---|
| 400 | invalid_request_error | A field is missing or not valid; the message names it |
| 400 | Malformed fields, ciphertext or expiry. | |
| 401 | authentication_error | No key, or a key Gateway does not accept |
| 403 | role_required | Your role does not have this permission |
| 404 | not_found | Nothing matches the path in your organization |
| 404 | The session, command or device does not belong to the caller. | |
| 409 | A device is untrusted, control is disabled or offline, the organization forbids synced content, or a command state conflicts. | |
| 410 | The session was deleted. | |
| 429 | The bounded command mailbox is full. | |
| 429 | rate_limit_error | Too many requests from this key in a minute |
Example
curl -X POST "$NEXUS_URL/v1/threads/<threadId>/commands/<commandId>/claim" \
-H "Authorization: Bearer $NEXUS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"runnerDeviceId": "<runnerDeviceId>",
"signature": "<signature>"
}'Finish code command
post
/v1/threads/{threadId}/commands/{commandId}/resultParameters
threadIdcommandId
Request body · application/json
runnerDeviceIdstatesignature
Responses
200
idsenderDeviceIdrunnerDeviceIdexpiresAtlockedKeysealedsignaturewaitsthreadIdstate
400
403
404
409
410
429
Errors
| Status | Code | When |
|---|---|---|
| 400 | invalid_request_error | A field is missing or not valid; the message names it |
| 400 | Malformed fields, ciphertext or expiry. | |
| 401 | authentication_error | No key, or a key Gateway does not accept |
| 403 | role_required | Your role does not have this permission |
| 404 | not_found | Nothing matches the path in your organization |
| 404 | The session, command or device does not belong to the caller. | |
| 409 | A device is untrusted, control is disabled or offline, the organization forbids synced content, or a command state conflicts. | |
| 410 | The session was deleted. | |
| 429 | The bounded command mailbox is full. | |
| 429 | rate_limit_error | Too many requests from this key in a minute |
Example
curl -X POST "$NEXUS_URL/v1/threads/<threadId>/commands/<commandId>/result" \
-H "Authorization: Bearer $NEXUS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"runnerDeviceId": "<runnerDeviceId>",
"state": "completed",
"signature": "<signature>"
}'Cancel code command
post
/v1/threads/{threadId}/commands/{commandId}/cancelParameters
threadIdcommandId
Request body · application/json
senderDeviceIdsignature
Responses
200
idsenderDeviceIdrunnerDeviceIdexpiresAtlockedKeysealedsignaturewaitsthreadIdstate
400
403
404
409
410
Errors
| Status | Code | When |
|---|---|---|
| 400 | invalid_request_error | A field is missing or not valid; the message names it |
| 400 | A malformed body. | |
| 401 | authentication_error | No key, or a key Gateway does not accept |
| 403 | role_required | Your role does not have this permission |
| 404 | not_found | Nothing matches the path in your organization |
| 404 | The session or command does not belong to the caller, or Gateway has no such command (`code_command_not_found`). | |
| 409 | A computer already claimed the command (`code_command_not_queued`), or the device is untrusted. | |
| 410 | The session was deleted. | |
| 429 | rate_limit_error | Too many requests from this key in a minute |
Example
curl -X POST "$NEXUS_URL/v1/threads/<threadId>/commands/<commandId>/cancel" \
-H "Authorization: Bearer $NEXUS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"senderDeviceId": "<senderDeviceId>",
"signature": "<signature>"
}'List runner code commands
/v1/devices/{runnerDeviceId}/code-commandsParameters
runnerDeviceId
Responses
200
commandsidsenderDeviceIdrunnerDeviceIdexpiresAtlockedKeysealedsignaturewaitsthreadIdstate
400
403
404
409
410
429
Errors
| Status | Code | When |
|---|---|---|
| 400 | Malformed fields, ciphertext or expiry. | |
| 401 | authentication_error | No key, or a key Gateway does not accept |
| 403 | role_required | Your role does not have this permission |
| 404 | not_found | Nothing matches the path in your organization |
| 404 | The session, command or device does not belong to the caller. | |
| 409 | A device is untrusted, control is disabled or offline, the organization forbids synced content, or a command state conflicts. | |
| 410 | The session was deleted. | |
| 429 | The bounded command mailbox is full. | |
| 429 | rate_limit_error | Too many requests from this key in a minute |
Example
curl "$NEXUS_URL/v1/devices/<runnerDeviceId>/code-commands" \
-H "Authorization: Bearer $NEXUS_API_KEY"