Skip to main content

Create an absence

POST/api/v1/absences

  • 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 createAbsence.

Parameters

Headers

  • Idempotency-Keystringrequired

    Unique 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.

  • absenceobjectrequired

    Fields(5)
    • lock_versioninteger

      At least 0.

    • membership_idstring (uuid)

    • reasonstring or null

      Up to 500 characters.

    • starts_atstring (date-time)required

    • ends_atstring (date-time)required

Responses

201Absence details.

  • dataobjectrequired

    Fields(9)
    • lock_versioninteger

      At least 0.

    • created_atstring (date-time)required

    • updated_atstring (date-time)required

    • idstring (uuid)required

    • account_idstring (uuid)required

    • membership_idstring (uuid)required

    • reasonstring or null

    • starts_atstring (date-time)required

    • ends_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 POST "https://app.tradesender.co.uk/api/v1/absences" \
  -H "Authorization: Bearer $TRADESENDER_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "absence": {
    "membership_id": "36c7095b-fcec-58a6-b1e1-916bdae515d3",
    "reason": "Holiday",
    "starts_at": "2026-10-16T09:00:00+01:00",
    "ends_at": "2026-10-16T17:00:00+01:00"
  }
}'