Update an absence
PATCH/api/v1/absences/{id}
- Needs an API key, and runs with the access of the member who made the key.
- Send an
Idempotency-Key. The same key with the same request within 24 hours gives the first answer again and changes nothing. - A connected AI assistant can use it too, as
updateAbsence.
Parameters
In the address
idstring (uuid)required
Headers
Idempotency-KeystringrequiredUnique user-scoped key for safely retrying this mutation for 24 hours.
At least 1 character. Up to 200 characters.
Request body
Sent as application/json.
absenceobjectrequiredFields(5)
lock_versionintegerAt least 0.
membership_idstring (uuid)reasonstring or nullUp to 500 characters.
starts_atstring (date-time)ends_atstring (date-time)
Responses
200Absence details.
dataobjectrequiredFields(9)
lock_versionintegerAt least 0.
created_atstring (date-time)requiredupdated_atstring (date-time)requiredidstring (uuid)requiredaccount_idstring (uuid)requiredmembership_idstring (uuid)requiredreasonstring or nullstarts_atstring (date-time)requiredends_atstring (date-time)required
A refusal answers in the one error shape every operation shares.
Example
A request our own tests send. The ids are made up: put your own in their place.
curl -X PATCH "https://app.tradesender.co.uk/api/v1/absences/5504b937-9680-5f60-8e97-97b6fff714e6" \
-H "Authorization: Bearer $TRADESENDER_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"absence": {
"reason": "Chainsaw course"
}
}'