# Create assignment

Creates an assignment.

Typical parameters:

- user_id
- assignable_id
- starts_at
- ends_at
- allocation_mode (percent, hours_per_day, fixed) and a value for the respective mode-named property (that is, a property named percent, hours_per_day, or fixed_hours)

> Note: You can create subtasks within the assignment by including them in a subtasks array property, like the one in the request body object below.
> 
> For subtask-specific operations, see Subtasks.
>
> json
> {
>  "user_id": null,
>  "assignable_id": 123,
>  "ends_at": "2018-06-27",
>  "starts_at": "2018-06-21",
>  "status_option_id": 1,
>  "description": "Build wireframes",
>  "note": null,
>  "subtasks": [
>    {
>      "description": "New Task",
>      "completed": false
>    }
>  ]
>}
>

Endpoint: POST /assignments
Version: v1
Security: AuthToken

## Header parameters:

  - `Content-Type` (string, required)
    Enum: "application/json"

  - `Accept` (string, required)
    Enum: same as `Content-Type` (1 values)

## Request fields (application/json):

  - `user_id` (integer, required)
    The ID of the user this assignment belongs to.
    Example: 5612

  - `assignable_id` (integer, required)
    The ID of the project, phase, or leave type to which the the assignment applies.
    Example: 1234

  - `subtasks` (array)

  - `subtasks.description` (string)
    Identifies the subtask.
    Example: "Assess risks"

  - `subtasks.completed` (boolean)
    This is true if the subtask is done; otherwise, it's false.

  - `body` (Assignment - percent-based allocation (object) or Assignment - fixed-hours-based allocation (object) or Assignment - hours-per-day-based allocation (object)) — one of:
    - Assignment - percent-based allocation:
      - `allocation_mode` (string, required)
        This indicates that a percentage of the resource's time is allocated to the corresponding assignment.
        Enum: "percent"
      - `percent` (number, required)
        The percentage of time the resource is allocated to the corresponding assignment. 

Note: This property is only present when allocation_mode is "percent".
        Example: 0.2
      - `starts_at` (string, required)
        The assignment's effective start date.
        Example: "2025-09-17"
      - `ends_at` (string, required)
        The assignment's effective end date.
        Example: "2025-12-17"
      - `repetition_id` (integer,null)
        A unique identifier for a series of repeating assignments. If the assignment is part of a repeating series, this is the parent assignment's unique ID. Otherwise, it's null.

Note: This ID is the same for all assignments within the same repeating series.
        Example: 886
      - `resource_request_id` (integer,null)
      - `bill_rate_id` (integer,null)
        Example: 58776516
      - `status` (any,null)
      - `status_option_id` (integer,null)
        The ID of the status option associated with the assignment.
        Example: 1234567890
      - `description` (string)
        Describes the assignment.
      - `note` (boolean,null)
        Calls out ancillary information about the assignment.
    - Assignment - fixed-hours-based allocation:
      - `allocation_mode` (string, required)
        This indicates that a fixed number of the resource's hours is allocated to the corresponding assignment.
        Enum: "fixed_hours"
      - `fixed_hours` (number, required)
        The number of hours the resource is allocated to a corresponding assignment. 

Note: This property is only present when allocation_mode is "fixed_hours".
        Example: 20
      - `starts_at` (string, required)
        The assignment's effective start date.
        Example: "2025-09-17"
      - `ends_at` (string, required)
        The assignment's effective end date.
        Example: "2025-12-17"
      - `repetition_id` (integer,null)
        A unique identifier for a series of repeating assignments. If the assignment is part of a repeating series, this is the parent assignment's unique ID. Otherwise, it's null.

Note: This ID is the same for all assignments within the same repeating series.
        Example: 886
      - `resource_request_id` (integer,null)
      - `bill_rate_id` (integer,null)
        Example: 58776516
      - `status` (any,null)
      - `status_option_id` (integer,null)
        The ID of the status option associated with the assignment.
        Example: 1234567890
      - `description` (string)
        Describes the assignment.
      - `note` (boolean,null)
        Calls out ancillary information about the assignment.
    - Assignment - hours-per-day-based allocation:
      - `allocation_mode` (string, required)
        This indicates that a number of the resource's daily hours is allocated to the corresponding assignment.
        Enum: "hours_per_day"
      - `hours_per_day` (number, required)
        The number of hours per day that the resource is allocated to a corresponding assignment. 

Note: This property is only present when allocation_mode is "hours_per_day".
        Example: 6
      - `starts_at` (string, required)
        The assignment's effective start date.
        Example: "2025-09-17"
      - `ends_at` (string, required)
        The assignment's effective end date.
        Example: "2025-12-17"
      - `repetition_id` (integer,null)
        A unique identifier for a series of repeating assignments. If the assignment is part of a repeating series, this is the parent assignment's unique ID. Otherwise, it's null.

Note: This ID is the same for all assignments within the same repeating series.
        Example: 886
      - `resource_request_id` (integer,null)
      - `bill_rate_id` (integer,null)
        Example: 58776516
      - `status` (any,null)
      - `status_option_id` (integer,null)
        The ID of the status option associated with the assignment.
        Example: 1234567890
      - `description` (string)
        Describes the assignment.
      - `note` (boolean,null)
        Calls out ancillary information about the assignment.

## Response 200 fields (application/json):

  - `subtasks` (object)

  - `subtasks.paging` (object)

  - `subtasks.paging.per_page` (integer)
    The maximum number of items to show per response page.
    Example: 100

  - `subtasks.paging.page` (integer)
    The current response page number.
    Example: 1

  - `subtasks.paging.previous` (string,null)
    If you're on the first page, this value is null; otherwise the value is the path and query parameters to get the previous page of items.
    Example: "/api/v1/users?per_page=1000&page=1"

  - `subtasks.paging.self` (string)
    The path and query parameters to get the current page of items.
    Example: "/api/v1/users?per_page=1000&page=2"

  - `subtasks.paging.next` (string,null)
    If there are more items, this value is the path and query parameters to get the next page of items; otherwise, it's null.
    Example: "/api/v1/users?per_page=1000&page=3"

  - `subtasks.paging.count` (integer,null)
    The total number of items in all the pages.

  - `subtasks.data` (array)

  - `subtasks.data.id` (integer)
    The unique identifier for the subtask.
    Example: 6789012345

  - `subtasks.data.assignment_id` (integer)
    The ID of the assignment to which this subtask belongs.
    Example: 5612

  - `subtasks.data.assignable_id` (integer)
    The ID of the project, phase, or leave type to which the the assignment applies.
    Example: 1234

  - `subtasks.data.description` (string)
    Identifies the subtask.
    Example: "Assess risks"

  - `subtasks.data.completed` (boolean)
    This is true if the subtask is done; otherwise, it's false.

  - `subtasks.data.updated_at` (string)
    The time of the last update.
    Example: "2025-08-27T12:00:00Z"

  - `subtasks.data.created_at` (string)
    The time of creation.
    Example: "2025-08-27T12:00:00Z"

  - `subtasks.data.updated_by` (integer)
    The ID of the user who last updated this subtask.
    Example: 1234567

  - `body` (Assignment - percent-based allocation (object) or Assignment - fixed-hours-based allocation (object) or Assignment - hours-per-day-based allocation (object)) — one of:
    - Assignment - percent-based allocation:
      - `allocation_mode` (string, required)
        This indicates that a percentage of the resource's time is allocated to the corresponding assignment.
        Enum: same as `allocation_mode` in "Assignment - percent-based allocation" (1 values)
      - `percent` (number, required)
        The percentage of time the resource is allocated to the corresponding assignment. 

Note: This property is only present when allocation_mode is "percent".
        Example: 0.2
      - `id` (integer)
        The unique identifier for the assignment.
        Example: 889
      - `user_id` (integer)
        The ID of the user this assignment belongs to.
        Example: 5612
      - `assignable_id` (integer)
        The ID of the project, phase, or leave type to which the the assignment applies.
        Example: 1234
      - `starts_at` (string, required)
        The assignment's effective start date.
        Example: "2025-09-17"
      - `ends_at` (string, required)
        The assignment's effective end date.
        Example: "2025-12-17"
      - `repetition_id` (integer,null)
        A unique identifier for a series of repeating assignments. If the assignment is part of a repeating series, this is the parent assignment's unique ID. Otherwise, it's null.

Note: This ID is the same for all assignments within the same repeating series.
        Example: 886
      - `created_at` (string)
        The time of creation.
        Example: "2025-08-27T12:00:00Z"
      - `updated_at` (string)
        The time of the last update.
        Example: "2025-08-27T12:00:00Z"
      - `all_day_assignment` (boolean)
        Example: true
      - `resource_request_id` (integer,null)
      - `bill_rate` (number,null)
        The cost value.
        Example: 100
      - `bill_rate_id` (integer,null)
        Example: 58776516
      - `status` (any,null)
      - `status_option_id` (integer,null)
        The ID of the status option associated with the assignment.
        Example: 1234567890
      - `description` (string)
        Describes the assignment.
      - `note` (boolean,null)
        Calls out ancillary information about the assignment.
    - Assignment - fixed-hours-based allocation:
      - `allocation_mode` (string, required)
        This indicates that a fixed number of the resource's hours is allocated to the corresponding assignment.
        Enum: same as `allocation_mode` in "Assignment - fixed-hours-based allocation" (1 values)
      - `fixed_hours` (number, required)
        The number of hours the resource is allocated to a corresponding assignment. 

Note: This property is only present when allocation_mode is "fixed_hours".
        Example: 20
      - `id` (integer)
        The unique identifier for the assignment.
        Example: 889
      - `user_id` (integer)
        The ID of the user this assignment belongs to.
        Example: 5612
      - `assignable_id` (integer)
        The ID of the project, phase, or leave type to which the the assignment applies.
        Example: 1234
      - `starts_at` (string, required)
        The assignment's effective start date.
        Example: "2025-09-17"
      - `ends_at` (string, required)
        The assignment's effective end date.
        Example: "2025-12-17"
      - `repetition_id` (integer,null)
        A unique identifier for a series of repeating assignments. If the assignment is part of a repeating series, this is the parent assignment's unique ID. Otherwise, it's null.

Note: This ID is the same for all assignments within the same repeating series.
        Example: 886
      - `created_at` (string)
        The time of creation.
        Example: "2025-08-27T12:00:00Z"
      - `updated_at` (string)
        The time of the last update.
        Example: "2025-08-27T12:00:00Z"
      - `all_day_assignment` (boolean)
        Example: true
      - `resource_request_id` (integer,null)
      - `bill_rate` (number,null)
        The cost value.
        Example: 100
      - `bill_rate_id` (integer,null)
        Example: 58776516
      - `status` (any,null)
      - `status_option_id` (integer,null)
        The ID of the status option associated with the assignment.
        Example: 1234567890
      - `description` (string)
        Describes the assignment.
      - `note` (boolean,null)
        Calls out ancillary information about the assignment.
    - Assignment - hours-per-day-based allocation:
      - `allocation_mode` (string, required)
        This indicates that a number of the resource's daily hours is allocated to the corresponding assignment.
        Enum: same as `allocation_mode` in "Assignment - hours-per-day-based allocation" (1 values)
      - `hours_per_day` (number, required)
        The number of hours per day that the resource is allocated to a corresponding assignment. 

Note: This property is only present when allocation_mode is "hours_per_day".
        Example: 6
      - `id` (integer)
        The unique identifier for the assignment.
        Example: 889
      - `user_id` (integer)
        The ID of the user this assignment belongs to.
        Example: 5612
      - `assignable_id` (integer)
        The ID of the project, phase, or leave type to which the the assignment applies.
        Example: 1234
      - `starts_at` (string, required)
        The assignment's effective start date.
        Example: "2025-09-17"
      - `ends_at` (string, required)
        The assignment's effective end date.
        Example: "2025-12-17"
      - `repetition_id` (integer,null)
        A unique identifier for a series of repeating assignments. If the assignment is part of a repeating series, this is the parent assignment's unique ID. Otherwise, it's null.

Note: This ID is the same for all assignments within the same repeating series.
        Example: 886
      - `created_at` (string)
        The time of creation.
        Example: "2025-08-27T12:00:00Z"
      - `updated_at` (string)
        The time of the last update.
        Example: "2025-08-27T12:00:00Z"
      - `all_day_assignment` (boolean)
        Example: true
      - `resource_request_id` (integer,null)
      - `bill_rate` (number,null)
        The cost value.
        Example: 100
      - `bill_rate_id` (integer,null)
        Example: 58776516
      - `status` (any,null)
      - `status_option_id` (integer,null)
        The ID of the status option associated with the assignment.
        Example: 1234567890
      - `description` (string)
        Describes the assignment.
      - `note` (boolean,null)
        Calls out ancillary information about the assignment.


