---
title: "Create an allocation"
method: POST
path: "/allocations"
tags: ["Allocations"]
---

# Create an allocation

`POST /allocations`

## Request

- Base URL: `https://www.ruddr.io/api/workspace`
- URL: `https://www.ruddr.io/api/workspace/allocations`
- Auth: HTTP bearer

## Request body

- object
  - `resourceTypeId` 'member' | 'placeholder', required: The type of resource being assigned. Must be either `"member"` for a real team member or `"placeholder"` for a generic resource placeholder.
  - `assignmentTypeId` 'project' | 'time_off', required: The type of assignment. Must be either `"project"` for a project-related allocation or `"time_off"` for a time off assignment.
  - `start` string, date, required: The start date (`YYYY-MM-DD`) of the allocation, must come on or before `end` date.
  - `end` string, date, required: The end date (`YYYY-MM-DD`) of the allocation, must come on or after the `start` date.
  - `unit` 'day' | 'week' | 'month' | 'allocation' | 'ratio_of_capacity', required: The time unit that determines how the allocation is defined. Possible values are `"day"` (Per day), `"week"` (Per week), `"month"` (Per month), `"allocation"` (Absolute number of hours), or `"ratio_of_capacity"` (Percentage of available capacity).
  - `hoursPerDay` number, nullable: The number of hours allocated per day. Only allowed when `unit` is `day`. Must be between `0` and `24` with up to 2 decimal places.
  - `hoursPerWeek` number, nullable: The number of hours allocated per week. Only allowed when `unit` is `week`. Must be between `0` and `168` with up to 2 decimal places.
  - `hoursPerMonth` number, nullable: The number of hours allocated per month. Only allowed when `unit` is `month`. Must be between `0` and `744` with up to 2 decimal places.
  - `hoursPerAllocation` number, nullable: The total number of hours allocated for the full duration. Only allowed when `unit` is `allocation`. Must be between `0` and `99999` with up to 2 decimal places.
  - `hoursRatioOfCapacity` number, nullable: The proportion of the member's available capacity to allocate. Only allowed when `unit` is `ratio_of_capacity`. Must be between `0` and `1` with up to 4 decimal places.
  - `allocateOnTimeOffDays` boolean, nullable: Whether time can be allocated on days when the member has time off. Defaults to `false` if not provided.
  - `bookingTypeId` 'confirmed' | 'soft': The booking type of the allocation. Defaults to `confirmed` if not provided.
  - `notes` string, nullable: Any notes with the associated allocation.
  - `memberId` string, nullable: The member ID (`uuid`) of the member for this allocation. Must be provided if the `resourceTypeId` is `member`.
  - `resourcePlaceholderId` string, nullable: The resource placeholder ID (`uuid`) of the resource placeholder for this allocation. Must be provided if the `resourceTypeId` is `placeholder`.
  - `projectId` string, nullable: The project ID (`uuid`) of the project for the allocation. Must be provided if the `assignmentTypeId` is `project`.
  - `projectRoleId` string, nullable: The project role ID (`uuid`) of the project role for the allocation. May be required depending on the project configuration.
  - `projectTaskId` string, nullable: The project task ID (`uuid`) of the project task for the allocation.
  - `timeOffTypeId` string, nullable: The time off type ID (`uuid`) of the time off type for the allocation. Must be provided if the `assignmentTypeId` is `time_off`.

## Response `200`

200

- Allocation
  - `id` string: The unique identifier for the object.
  - `resourceTypeId` 'member' | 'placeholder': The type of resource assigned to this allocation.
  - `assignmentTypeId` 'project' | 'time_off': The type of assignment for this allocation.
  - `start` string, date: The start date of the allocation. Will be in the form YYYY-MM-DD.
  - `end` string, date: The end date of the allocation. Will be in the form YYYY-MM-DD.
  - `unit` 'day' | 'week' | 'month' | 'allocation' | 'ratio_of_capacity': The time unit that determines how the allocation is measured.
  - `hoursPerDay` number, nullable: The number of hours allocated per day. Only present when `unit` is `"day"`, otherwise `null`.
  - `hoursPerWeek` number, nullable: The number of hours allocated per week. Only present when `unit` is `"week"`, otherwise `null`.
  - `hoursPerMonth` number, nullable: The number of hours allocated per month. Only present when `unit` is `"month"`, otherwise `null`.
  - `hoursPerAllocation` number, nullable: The total number of hours for the entire allocation duration. Only present when `unit` is `"allocation"`, otherwise `null`.
  - `hoursRatioOfCapacity` number, nullable: The proportion of the member's available capacity allocated. Only present when `unit` is `"ratio_of_capacity"`, otherwise `null`.
  - `allocateOnTimeOffDays` boolean, nullable: Whether time is allocated on days when the member has time off. Only present when `assignmentTypeId` is `"project"` and `resourceTypeId` is `"member"`, otherwise `null`.
  - `totalHours` number: The total number of computed hours across all dates in the allocation.
  - `isBillable` boolean: Whether this allocation is billable.
  - `bookingTypeId` 'confirmed' | 'soft': The booking type of the allocation.
  - `notes` string, nullable: Notes associated with the allocation.
  - `readOnly` boolean: Whether this allocation is read-only. Allocations sourced from time entries or holidays are read-only.
  - `entity` 'allocation' | 'time_entry' | 'holiday': The source entity type.
  - `createdAt` string, date-time: The timestamp when the object was created.
  - `modifiedAt` string, date-time, nullable: The timestamp when the object was last modified. `null` for time-entry and holiday allocations, which are derived and have no modification timestamp.
  - `member` object, nullable: The member assigned to this allocation. Present when `resourceTypeId` is `"member"`, otherwise `null`.
    - `id` string: The unique identifier for the object.
    - `name` string: The name of the member.
  - `placeholder` object, nullable: The resource placeholder assigned to this allocation. Present when `resourceTypeId` is `"placeholder"`, otherwise `null`.
    - `id` string: The unique identifier for the object.
    - `name` string: The name of the resource placeholder.
  - `project` object, nullable: The project this allocation is assigned to. Present when `assignmentTypeId` is `"project"`, otherwise `null`.
    - `id` string: The unique identifier for the object.
    - `name` string: The name of the project.
    - `client` object: The client associated with the project.
      - `id` string: The unique identifier for the object.
      - `name` string: The name of the client.
  - `role` object, nullable: The project role associated with this allocation, if any.
    - `id` string: The unique identifier for the object.
    - `name` string: The name of the project role.
  - `task` object, nullable: The project task associated with this allocation, if any.
    - `id` string: The unique identifier for the object.
    - `name` string: The name of the project task.
  - `timeOffType` object, nullable: The time off type associated with this allocation. Present when `assignmentTypeId` is `"time_off"`, otherwise `null`.
    - `id` string: The unique identifier for the object.
    - `name` string: The name of the time off type.

## Other responses

- `400`: 400
- `403`: 403

---

[API](https://skmtc.dev/ruddr/apis/ruddr-api.md) · [All operations](https://skmtc.dev/ruddr/apis/ruddr-api/llms.txt) · [OpenAPI document](https://skmtc.dev/ruddr/apis/ruddr-api/revisions/01c3f2a969ba?raw)
