Approvals API
15 endpoints, generated from packages/core/openapi/v1.snapshot.json (OpenAPI 3.1.0, contract version 1.0). Conventions for lists, errors, money and authentication are on the API conventions page.
GET/api/v1/approvals/delegations
List out-of-office cover
Current and upcoming cover involving the caller; hr_admins and owners see everyone's with `all=true`.
Parameters
| Name | In | Type | Required |
|---|---|---|---|
all | query | enum | no |
Responses
200 Success. object
itemsarray of objectrequiredidstring (uuid)requiredfromobjectrequiredmembershipIdstring (uuid)requirednamestringrequired
toobjectrequiredmembershipIdstring (uuid)requirednamestringrequired
startsOnstring (date)requiredendsOnstring (date)requiredsubjectTypesarray of string or nullrequiredactivebooleanrequiredcreatedAtstring (date-time)required
- 400
validation_failed - 401
session_expired,session_revoked,unauthenticated - 403
mfa_enrolment_required
POST/api/v1/approvals/delegations
Set out-of-office cover
While active, the delegate also receives the member's approval tasks. hr_admins may set it for anyone.
Request body
application/json, object, required
fromMembershipIdstring (uuid)toMembershipIdstring (uuid)requiredstartsOnstring (date)requiredendsOnstring (date)requiredsubjectTypesarray of string or null
Responses
201 Success. object
idstring (uuid)requiredfromobjectrequiredmembershipIdstring (uuid)requirednamestringrequired
toobjectrequiredmembershipIdstring (uuid)requirednamestringrequired
startsOnstring (date)requiredendsOnstring (date)requiredsubjectTypesarray of string or nullrequiredactivebooleanrequiredcreatedAtstring (date-time)required
- 400
validation_failed - 401
session_expired,session_revoked,unauthenticated - 403
csrf_rejected,mfa_enrolment_required - 404
not_found
DELETE/api/v1/approvals/delegations/{id}
Remove out-of-office cover
Parameters
| Name | In | Type | Required |
|---|---|---|---|
id | path | string (uuid) | yes |
Responses
204 No content.
- 400
validation_failed - 401
session_expired,session_revoked,unauthenticated - 403
csrf_rejected,mfa_enrolment_required - 404
not_found
GET/api/v1/approvals/people
List members who can approve or cover
Active members of the organisation (name only), for delegate and approver pickers.
Responses
200 Success. object
itemsarray of objectrequiredmembershipIdstring (uuid)requirednamestringrequired
- 401
session_expired,session_revoked,unauthenticated - 403
mfa_enrolment_required
GET/api/v1/approvals/policies
List approval policies per request type
Types without a stored policy show the built-in default chain.
Responses
200 Success. object
typesarray of objectrequiredsubjectTypestringrequiredlabelstringrequiredinstalledbooleanrequiredownerOnlybooleanrequiredcanEditbooleanrequiredpoliciesarray of objectrequiredidstring (uuid) or nullrequirednamestringrequiredconditionobject or nullrequiredamountGteintegermin 1 · max 100000000000
typeCodesarray of string
priorityintegerrequiredmin -9007199254740991
isDefaultbooleanrequiredbuiltInbooleanrequiredstepsarray of objectrequiredapproverRulestringrequiredlabelstringrequiredescalateAfterDaysintegerrequiredmin -9007199254740991
- 401
session_expired,session_revoked,unauthenticated - 403
forbidden,mfa_enrolment_required
PUT/api/v1/approvals/policies/{subjectType}
Replace the approval policies of one request type
Exactly one policy must have no condition (the default). Requests already submitted keep their chain. Policies for payroll runs and profile changes (bank details) are owner-only.
Parameters
| Name | In | Type | Required |
|---|---|---|---|
subjectType | path | string | yes |
Request body
application/json, object, required
policiesarray of objectrequirednamestringrequiredmin length 1 · max length 80
conditionobject or nullamountGteintegermin 1 · max 100000000000
typeCodesarray of string
priorityintegermin 0 · max 1000 · default 0
stepsarray of objectrequiredapproverRulestringrequiredescalateAfterDaysintegermin 0 · max 60 · default 3
Responses
200 Success. object
subjectTypestringrequiredpoliciesarray of objectrequiredidstring (uuid) or nullrequirednamestringrequiredconditionobject or nullrequiredamountGteintegermin 1 · max 100000000000
typeCodesarray of string
priorityintegerrequiredmin -9007199254740991
isDefaultbooleanrequiredbuiltInbooleanrequiredstepsarray of objectrequiredapproverRulestringrequiredlabelstringrequiredescalateAfterDaysintegerrequiredmin -9007199254740991
- 400
validation_failed - 401
session_expired,session_revoked,unauthenticated - 403
csrf_rejected,forbidden,mfa_enrolment_required - 404
not_found
GET/api/v1/approvals/requests
List my requests
Requests the caller submitted, newest first.
Parameters
| Name | In | Type | Required |
|---|---|---|---|
limit | query | integer | no |
Responses
200 Success. object
itemsarray of objectrequiredidstring (uuid)requiredsubjectTypestringrequiredsubjectLabelstringrequiredtitlestringrequiredstatusenumrequiredone of "pending", "approved", "rejected", "withdrawn"
submittedAtstring (date-time)requireddecidedAtstring (date-time) or nullrequiredwaitingOnstring | nullrequired
- 400
validation_failed - 401
session_expired,session_revoked,unauthenticated - 403
mfa_enrolment_required
GET/api/v1/approvals/requests/{id}
Get a request with its approval chain
Visible to the requester, approvers, delegates while their task is open, owners and hr_admins (not payroll runs), and whoever the module's `canRead` allows.
Parameters
| Name | In | Type | Required |
|---|---|---|---|
id | path | string (uuid) | yes |
Responses
200 Success. object
idstring (uuid)requiredsubjectTypestringrequiredsubjectLabelstringrequiredtitlestringrequiredstatusenumrequiredone of "pending", "approved", "rejected", "withdrawn"
policyNamestringrequiredsubmittedAtstring (date-time)requireddecidedAtstring (date-time) or nullrequiredrequesterobjectrequirednamestringrequired
summaryobject or nullrequiredtitlestringrequiredlinesarray of objectrequiredlabelstringrequiredvaluestringrequired
contextarray of objectrequiredlabelstringrequiredvaluestringrequired
linkstringrequiredstepsarray of objectrequiredpositionintegerrequiredmin -9007199254740991
labelstringrequiredstatusenumrequiredone of "waiting", "active", "approved", "rejected", "skipped"
skipReasonstring | nullrequiredfallbackbooleanrequiredescalatedbooleanrequiredtasksarray of objectrequiredidstring (uuid)requiredassigneestringrequiredonBehalfOfstring | nullrequiredoriginenumrequiredone of "resolved", "delegated", "escalated", "reassigned"
statusenumrequiredone of "pending", "approved", "rejected", "superseded"
decidedAtstring (date-time) or nullrequiredcommentstring | nullrequiredselfApprovedbooleanrequired
commentsarray of objectrequiredidstring (uuid)requiredauthorstringrequiredbodystringrequiredcreatedAtstring (date-time)required
viewerobjectrequiredmyTaskIdstring (uuid) or nullrequiredcanWithdrawbooleanrequiredcanCommentbooleanrequired
- 400
validation_failed - 401
session_expired,session_revoked,unauthenticated - 403
mfa_enrolment_required - 404
not_found
POST/api/v1/approvals/requests/{id}/comments
Comment on a request
Parameters
| Name | In | Type | Required |
|---|---|---|---|
id | path | string (uuid) | yes |
Request body
application/json, object, required
bodystringrequiredmin length 1 · max length 500
Responses
201 Success. object
idstring (uuid)required
- 400
validation_failed - 401
session_expired,session_revoked,unauthenticated - 403
csrf_rejected,mfa_enrolment_required - 404
not_found
POST/api/v1/approvals/requests/{id}/withdraw
Withdraw my pending request
Parameters
| Name | In | Type | Required |
|---|---|---|---|
id | path | string (uuid) | yes |
Responses
200 Success. object
requestIdstring (uuid)requiredstatus"withdrawn"required
- 400
validation_failed - 401
session_expired,session_revoked,unauthenticated - 403
csrf_rejected,mfa_enrolment_required - 404
not_found - 409
already_decided
GET/api/v1/approvals/tasks
List my open approval tasks
Pending tasks assigned to the caller, including delegated, escalated and reassigned ones.
Responses
200 Success. object
itemsarray of objectrequiredtaskIdstring (uuid)requiredrequestIdstring (uuid)requiredsubjectTypestringrequiredsubjectLabelstringrequiredtitlestringrequiredrequesterobjectrequirednamestringrequired
submittedAtstring (date-time)requireddueOnstring (date) or nullrequiredoverdueDaysintegerrequiredmin -9007199254740991
originenumrequiredone of "resolved", "delegated", "escalated", "reassigned"
onBehalfOfstring | nullrequiredinlinebooleanrequiredstepobjectrequiredpositionintegerrequiredmin -9007199254740991
ofintegerrequiredmin -9007199254740991
labelstringrequired
- 401
session_expired,session_revoked,unauthenticated - 403
mfa_enrolment_required
POST/api/v1/approvals/tasks/{id}/decision
Approve or reject a task
Idempotent: repeating the same decision returns `replayed: true`. A task that someone else already decided answers 409 `already_decided` with who decided and when.
Parameters
| Name | In | Type | Required |
|---|---|---|---|
id | path | string (uuid) | yes |
Request body
application/json, object, required
decisionenumrequiredone of "approve", "reject"
commentstring or nullmax length 500
Responses
200 Success. object
taskIdstring (uuid)requiredrequestIdstring (uuid)requiredoutcomeenumrequiredone of "approved", "rejected"
requestStatusenumrequiredone of "pending", "approved", "rejected", "withdrawn"
replayedbooleanrequired
- 400
validation_failed - 401
session_expired,session_revoked,unauthenticated - 403
csrf_rejected,forbidden,mfa_enrolment_required - 404
not_found - 409
already_decided
POST/api/v1/approvals/tasks/{id}/reassign
Reassign a pending task
Parameters
| Name | In | Type | Required |
|---|---|---|---|
id | path | string (uuid) | yes |
Request body
application/json, object, required
toMembershipIdstring (uuid)requiredreasonstringrequiredmin length 1 · max length 500
Responses
200 Success. object
taskIdstring (uuid) or nullrequiredrequestIdstring (uuid)required
- 400
validation_failed - 401
session_expired,session_revoked,unauthenticated - 403
csrf_rejected,forbidden,mfa_enrolment_required - 404
not_found - 409
already_decided
POST/api/v1/approvals/tasks/decisions
Approve or reject several tasks
Each task is decided in its own transaction; the result lists the outcome per task.
Request body
application/json, object, required
taskIdsarray of string (uuid)requireddecisionenumrequiredone of "approve", "reject"
commentstring or nullmax length 500
Responses
200 Success. object
resultsarray of objectrequiredtaskIdstring (uuid)requiredokbooleanrequiredrequestStatusenum or nullrequiredone of "pending", "approved", "rejected", "withdrawn"
codestring | nullrequiredmessagestring | nullrequired
- 400
validation_failed - 401
session_expired,session_revoked,unauthenticated - 403
csrf_rejected,forbidden,mfa_enrolment_required
GET/api/v1/inbox
My work to do
Actionable items from every source (approvals, reminders, setup, payroll due), overdue first, then by due date, then by age. `sources` says which sources are not set up yet.
Responses
200 Success. object
todaystring (date)requireditemsarray of objectrequiredidstringrequiredsourcestringrequiredkindstringrequiredtitlestringrequiredconcernsstring | nullrequireddetailstring | nullrequireddueOnstring (date) or nullrequiredoverdueDaysintegerrequiredmin -9007199254740991
createdAtstring (date-time)requiredhrefstringrequiredactionLabelstringrequiredtaskobject or nullrequiredidstring (uuid)requiredrequestIdstring (uuid)requiredsubjectTypestringrequiredinlinebooleanrequiredoriginenumrequiredone of "resolved", "delegated", "escalated", "reassigned"
onBehalfOfstring | nullrequired
sourcesarray of objectrequiredidstringrequiredlabelstringrequiredstatusenumrequiredone of "ready", "not_set_up"
- 401
session_expired,session_revoked,unauthenticated - 403
mfa_enrolment_required