Routines
List routines
/v1/routinesParameters
all
Responses
200
routinesidtitleownerIdteamIdexecutortriggerkindeverySecondswatchsourcetargetoverUsd
atdaystimezonecatchUp
actionkind
proactivitynotifywrites
capsmaxRunsPerDay
reportTostatepausedReasonscheduleIdnextRunAtlastRunAtdeliveryavailablecodereason
createdViaversioncreatedAtupdatedAt
400
errormessagetypecodeparamnexusminimum
401
errormessagetypecodeparamnexusminimum
403
errormessagetypecodeparamnexusminimum
429
errormessagetypecodeparamnexusminimum
503
errormessagetypecodeparamnexusminimum
Errors
| Status | Code | When |
|---|---|---|
| 400 | invalid_request_error | A field is missing or not valid; the message names it |
| 400 | `all` is not `true` or `false`. | |
| 401 | authentication_error | No key, or a key Gateway does not accept |
| 403 | role_required | Your role does not have this permission |
| 429 | Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap). | |
| 429 | rate_limit_error | Too many requests from this key in a minute |
| 503 | Routines are off on this Gateway (`routines_disabled`): they need `NEXUS_ROUTINES` and `NEXUS_SCHEDULER`. The route still mounts. |
Example
curl "$NEXUS_URL/v1/routines" \
-H "Authorization: Bearer $NEXUS_API_KEY"Create routine
post
/v1/routinesParameters
Idempotency-Key
Request body · application/json
titletriggerkindeverySecondswatchsourcetargetoverUsd
atdaystimezonecatchUp
actionkind
proactivitynotifywrites
capsmaxRunsPerDay
reportToteam
Responses
201
idtitleownerIdteamIdexecutortriggerkindeverySecondswatchsourcetargetoverUsd
atdaystimezonecatchUp
actionkind
proactivitynotifywrites
capsmaxRunsPerDay
reportTostatepausedReasonscheduleIdnextRunAtlastRunAtdeliveryavailablecodereason
createdViaversioncreatedAtupdatedAt
400
errormessagetypecodeparamnexusminimum
401
errormessagetypecodeparamnexusminimum
403
errormessagetypecodeparamnexusminimum
409
errormessagetypecodeparamnexusminimum
422
errormessagetypecodeparamnexusminimum
429
errormessagetypecodeparamnexusminimum
503
errormessagetypecodeparamnexusminimum
Errors
| Status | Code | When |
|---|---|---|
| 400 | invalid_request_error | A field is missing or not valid; the message names it |
| 400 | A body that is not a routine, or a malformed `Idempotency-Key`. | |
| 401 | authentication_error | No key, or a key Gateway does not accept |
| 403 | role_required | Your role does not have this permission |
| 409 | You own 50 routines in this organization (`routine_limit`), or the `Idempotency-Key`'s first request still runs. | |
| 409 | idempotency_in_progress | A request with the same Idempotency-Key is still running |
| 409 | idempotency_interrupted | The first request with this Idempotency-Key was cut off and may have run in part |
| 422 | A routine Gateway does not build yet or cannot run (`invalid_routine`): a trigger other than `schedule`, both or neither of `everySeconds` and `at`, an interval under 600 s, an unknown time zone or day, an action other than `brief`, a `reportTo` other than `slack`. `writes: ask_first` is `routine_writes_unavailable`: it waits for Policy's approval records (PO1). | |
| 422 | idempotency_key_reused | The Idempotency-Key was used with a different request |
| 429 | Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap). | |
| 429 | rate_limit_error | Too many requests from this key in a minute |
| 503 | Routines are off on this Gateway (`routines_disabled`): they need `NEXUS_ROUTINES` and `NEXUS_SCHEDULER`. The route still mounts. |
Example
curl -X POST "$NEXUS_URL/v1/routines" \
-H "Authorization: Bearer $NEXUS_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"trigger": {
"kind": "schedule"
},
"action": {
"kind": "brief"
}
}'Get routine
/v1/routines/{id}Parameters
id
Responses
200
idtitleownerIdteamIdexecutortriggerkindeverySecondswatchsourcetargetoverUsd
atdaystimezonecatchUp
actionkind
proactivitynotifywrites
capsmaxRunsPerDay
reportTostatepausedReasonscheduleIdnextRunAtlastRunAtdeliveryavailablecodereason
createdViaversioncreatedAtupdatedAt
401
errormessagetypecodeparamnexusminimum
403
errormessagetypecodeparamnexusminimum
404
errormessagetypecodeparamnexusminimum
429
errormessagetypecodeparamnexusminimum
503
errormessagetypecodeparamnexusminimum
Errors
| Status | Code | When |
|---|---|---|
| 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 | No such routine you may see (`not_found`). A routine is its owner's, and its organization's owners' and admins' to read, pause and delete. Another member's routine, and another organization's, is as absent as a missing one. | |
| 429 | Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap). | |
| 429 | rate_limit_error | Too many requests from this key in a minute |
| 503 | Routines are off on this Gateway (`routines_disabled`): they need `NEXUS_ROUTINES` and `NEXUS_SCHEDULER`. The route still mounts. |
Example
curl "$NEXUS_URL/v1/routines/<id>" \
-H "Authorization: Bearer $NEXUS_API_KEY"Update routine
/v1/routines/{id}Parameters
idIdempotency-Key
Request body · application/json
state
Responses
200
idtitleownerIdteamIdexecutortriggerkindeverySecondswatchsourcetargetoverUsd
atdaystimezonecatchUp
actionkind
proactivitynotifywrites
capsmaxRunsPerDay
reportTostatepausedReasonscheduleIdnextRunAtlastRunAtdeliveryavailablecodereason
createdViaversioncreatedAtupdatedAt
400
errormessagetypecodeparamnexusminimum
401
errormessagetypecodeparamnexusminimum
403
errormessagetypecodeparamnexusminimum
404
errormessagetypecodeparamnexusminimum
429
errormessagetypecodeparamnexusminimum
503
errormessagetypecodeparamnexusminimum
Errors
| Status | Code | When |
|---|---|---|
| 400 | invalid_request_error | A field is missing or not valid; the message names it |
| 400 | `state` is not `paused` or `active`. | |
| 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 | No such routine you may see (`not_found`). A routine is its owner's, and its organization's owners' and admins' to read, pause and delete. Another member's routine, and another organization's, is as absent as a missing one. | |
| 409 | idempotency_in_progress | A request with the same Idempotency-Key is still running |
| 409 | idempotency_interrupted | The first request with this Idempotency-Key was cut off and may have run in part |
| 422 | idempotency_key_reused | The Idempotency-Key was used with a different request |
| 429 | Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap). | |
| 429 | rate_limit_error | Too many requests from this key in a minute |
| 503 | Routines are off on this Gateway (`routines_disabled`): they need `NEXUS_ROUTINES` and `NEXUS_SCHEDULER`. The route still mounts. |
Example
curl -X PATCH "$NEXUS_URL/v1/routines/<id>" \
-H "Authorization: Bearer $NEXUS_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"state": "paused"
}'Delete routine
DEL
/v1/routines/{id}Parameters
idIdempotency-Key
Responses
200
iddeleted
401
errormessagetypecodeparamnexusminimum
403
errormessagetypecodeparamnexusminimum
404
errormessagetypecodeparamnexusminimum
429
errormessagetypecodeparamnexusminimum
503
errormessagetypecodeparamnexusminimum
Errors
| Status | Code | When |
|---|---|---|
| 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 | No such routine you may see (`not_found`). A routine is its owner's, and its organization's owners' and admins' to read, pause and delete. Another member's routine, and another organization's, is as absent as a missing one. | |
| 409 | idempotency_in_progress | A request with the same Idempotency-Key is still running |
| 409 | idempotency_interrupted | The first request with this Idempotency-Key was cut off and may have run in part |
| 422 | idempotency_key_reused | The Idempotency-Key was used with a different request |
| 429 | Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap). | |
| 429 | rate_limit_error | Too many requests from this key in a minute |
| 503 | Routines are off on this Gateway (`routines_disabled`): they need `NEXUS_ROUTINES` and `NEXUS_SCHEDULER`. The route still mounts. |
Example
curl -X DELETE "$NEXUS_URL/v1/routines/<id>" \
-H "Authorization: Bearer $NEXUS_API_KEY" \
-H "Idempotency-Key: $(uuidgen)"