---
title: "Create a request"
method: POST
path: "/requests"
tags: ["Requests"]
---

# Create a request

`POST /requests`

Create a leave request.

**Date/Time Format:** All dates must be in ISO 8601 format with UTC timezone (e.g., '2024-01-15T09:00:00Z').

**Day-based leave types (leave_unit: days):**
- Use start_at: 'morning' or 'afternoon' to specify when the absence starts
- Use end_at: 'lunchtime' or 'end_of_day' to specify when the absence ends
- Example full day: start='2024-01-15T00:00:00Z', end='2024-01-15T00:00:00Z', start_at='morning', end_at='end_of_day'
- Example half day (morning): start='2024-01-15T00:00:00Z', end='2024-01-15T00:00:00Z', start_at='morning', end_at='lunchtime'
- If start_at/end_at are omitted, they default to 'morning'/'end_of_day' (full day)
- For leave types with leave_unit 'days' (full days only), start_at='afternoon' or end_at='lunchtime' is rejected (each on its own) — use a 'half_days' leave type for half-day absences

**Hour-based leave types (leave_unit: hours):**
- Include the exact time in the start and end timestamps
- The start_at and end_at parameters are ignored
- Example: start='2024-01-15T09:00:00Z', end='2024-01-15T12:30:00Z' for a 9:00-12:30 UTC absence

**Representatives:** If the leave type or member requires representatives, pass representative_member_ids. Admin API keys creating for another member may instead set ignoreRepresentativeRequirement: true.

**Employment period:** The absence must fall entirely inside the member's employment period. A request starting before employment_start_date or ending after employment_end_date is rejected with 400. Both boundary dates are themselves bookable, and a null boundary means open ended on that side. A range that straddles a boundary is rejected rather than truncated.

The check compares **calendar days, not exact timestamps**. For an hour-based leave type, any time of day on employment_end_date is still inside the period (e.g. start='2024-09-30T09:00:00Z', end='2024-09-30T17:00:00Z' with employment_end_date '2024-09-30' is accepted) — midnight is not the cutoff. The same applies to employment_start_date.

## Request body

- object
  - `start` string, required — Start/end of the request in ISO 8601. For day-based leave types (`leave_unit: days`) send the date at midnight UTC (e.g. `2026-06-01T00:00:00Z`) and use `start_at` / `end_at` to set half-days. For hour-based leave types include the exact time of day (e.g. `2026-06-01T09:00:00Z`); `start_at` / `end_at` are then ignored.
  - `end` string, required — Start/end of the request in ISO 8601. For day-based leave types (`leave_unit: days`) send the date at midnight UTC (e.g. `2026-06-01T00:00:00Z`) and use `start_at` / `end_at` to set half-days. For hour-based leave types include the exact time of day (e.g. `2026-06-01T09:00:00Z`); `start_at` / `end_at` are then ignored.
  - `start_at` 'morning' | 'afternoon' — For day-based leave types: whether the absence starts in the `morning` (the whole first day counts) or `afternoon` (only the second half of the first day). Ignored for hour-based leave types.
  - `end_at` 'lunchtime' | 'end_of_day' — For day-based leave types: whether the absence ends at `lunchtime` (only the first half of the last day) or `end_of_day` (the whole last day counts). Ignored for hour-based leave types.
  - `leave_type_id` string, uuid, required
  - `reason` string
  - `requester_member_id` string, uuid, required
  - `representative_member_ids` string[] — Member IDs to assign as representatives. Required for leave types that mandate representatives — omitting them returns REQUIRED_REPRESENTATIVES_COUNT_NOT_MET.
  - `ignoreRepresentativeRequirement` boolean — Skip the representative requirement. Only honored when the API key's member is an admin and the request is created for another member.

## Response `200`

Successful response

- string, uuid

## Other responses

- `400` — Invalid input data
- `401` — Authorization not provided
- `403` — Insufficient access
- `500` — Internal server error

---

[API](https://skmtc.net/absentify/apis/absentify-crud-api.md) · [All operations](https://skmtc.net/absentify/apis/absentify-crud-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/absentify/absentify-crud-api/revisions/ef777d51e6f2/schema)
