Browse the docs ▾

Time off API

Read, add, change and withdraw time off. GET /api/v1/leave, POST /api/v1/leave, POST /api/v1/leave/{id}/approve, POST /api/v1/leave/{id}/cancel and more.

Generated from the app's endpoint listView as Markdown

5 operations. Each needs an API key with the permission shown; see API keys and permissions.

#GET /api/v1/leave

Time off, requested and approved. Whole days: start and end are the first and last day, given as midday UTC.

  • Permission: leave:read
  • Returns: a page of records: { data, hasMore, nextCursor }, status 200

Query parameters (all optional)

NameDescription
statusrequested, approved, active, returned or cancelled.
providerIdOnly this person.
fromLeave that ends after this date.
toLeave that starts before this date.
limitRows per page, 1 to 200. Default 50.
cursorThe nextCursor value from the previous page.

Fields in each record: id, providerId, type, status, start, end, requestedAt, externalId

curl "https://app.staffedly.com/api/v1/leave?limit=50" \
  -H "Authorization: Bearer $STAFFEDLY_API_KEY"

#POST /api/v1/leave

Add time off, as a request or already approved.

  • Permission: leave:write
  • Returns: one record: { data }, status 201
  • Safe retry: send an Idempotency-Key header (8 to 128 characters); the same key with the same request returns the first answer again

Body fields (JSON; a field the API does not know is refused)

FieldDescription
providerIdRequired.
startRequired. First day, YYYY-MM-DD.
endLast day, YYYY-MM-DD. Default: the same day.
typevacation, short_term_disability, medical, personal or other (default).
statusrequested (default) or approved.

Fields in each record: id, providerId, type, status, start, end, requestedAt, externalId

curl -X POST "https://app.staffedly.com/api/v1/leave" \
  -H "Authorization: Bearer $STAFFEDLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"providerId":"<providerId>","start":"2027-01-12"}'

#POST /api/v1/leave/{id}/approve

Approve requested time off. The person is told; shifts they still hold on those days are raised for your schedulers.

  • Permission: leave:write
  • Returns: one record: { data }, status 201
  • Safe retry: send an Idempotency-Key header (8 to 128 characters); the same key with the same request returns the first answer again

Path

NameDescription
idThe record's id.

Body fields (JSON; a field the API does not know is refused)

FieldDescription
noteSent to the person.

Fields in each record: id, providerId, type, status, start, end, requestedAt, externalId

curl -X POST "https://app.staffedly.com/api/v1/leave/<id>/approve" \
  -H "Authorization: Bearer $STAFFEDLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"note":"Family trip"}'

#POST /api/v1/leave/{id}/cancel

Withdraw time off that is requested, approved or under way. The person is told.

  • Permission: leave:write
  • Returns: one record: { data }, status 201
  • Safe retry: send an Idempotency-Key header (8 to 128 characters); the same key with the same request returns the first answer again

Path

NameDescription
idThe record's id.

Body fields (JSON; a field the API does not know is refused)

FieldDescription
reasonSent to the person.

Fields in each record: id, providerId, type, status, start, end, requestedAt, externalId

curl -X POST "https://app.staffedly.com/api/v1/leave/<id>/cancel" \
  -H "Authorization: Bearer $STAFFEDLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"reason":"Extra room opened"}'

#PATCH /api/v1/leave/{id}

Change the dates or kind of time off that is requested or approved. The person is told.

  • Permission: leave:write
  • Returns: one record: { data }, status 200
  • Safe retry: send an Idempotency-Key header (8 to 128 characters); the same key with the same request returns the first answer again

Path

NameDescription
idThe record's id.

Body fields (JSON; a field the API does not know is refused)

FieldDescription
startFirst day, YYYY-MM-DD.
endLast day, YYYY-MM-DD.
typevacation, short_term_disability, medical, personal or other.

Fields in each record: id, providerId, type, status, start, end, requestedAt, externalId

curl -X PATCH "https://app.staffedly.com/api/v1/leave/<id>" \
  -H "Authorization: Bearer $STAFFEDLY_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"start":"2027-01-12","end":"2027-01-14"}'

Something missing or wrong on this page? Email [email protected] or book a free call; our team sets up every new customer at no charge.