# Updating an existing Assignment

This endpoint returns structured Assignment objects.
As with all Kantata OX API endpoints, the returned data will be referenced in sorted order in the results array
and will be indexed by ID in the assignments top-level JSON key.
Please see our Response Format section for more information.

Endpoint: PUT /assignments/{id}
Version: 1.0.0

## Path parameters:

  - `id` (integer, required)
    The ID of the Model.

## Query parameters:

  - `include` (string)
    Any of the below associations can be included in your request by providing the include param, e.g. include=association1,association2.
- assignee (User) - Retrieves the user assigned to the task. The response will include assignee_id, which references the data in the users top-level key.
- external_references (ExternalReference) - Includes references to external integrations for this object.
- story (Story) - Retrieves the task. The response will include story_id, which references the data in the stories top-level key.
- story_allocation_days (StoryAllocationDay) - Retrieves the Story Allocation Days (i.e. Daily Scheduled Hours) for the resource assigned to the task. When using this
value, the plannable filter must be set to true. To retrieve story allocation days for unnamed resources, also set
the include_unnamed filter to true. The response will include story_allocation_day_ids, which references the data
in the story_allocation_days top-level key.

## Request fields (application/json):

  - `assignment` (object)

  - `assignment.assignee_id` (integer)
    The ID of the user the assignment is for.
Do not specify an assignee_id if a resource_id is also specified.
When both parameters are specified, assignee_id is overridden by resource_id.

  - `assignment.resource_id` (integer)
    The ID of the resource the assignment is for.

  - `assignment.current` (boolean)
    Whether the assignment is active. Set as true to assign the resource to the task. Set as false to unassign the resource from the task.

  - `assignment.estimated_minutes` (integer)
    The number of minutes the resource is estimated to work on the task.

  - `assignment.external_reference` (object)
    Typically populated programmatically by a third party system via an integration, this is an optional
object that holds data from an external system. It connects objects in an external system with objects in
Kantata OX (for example, to connect a Jira issue to a Kantata OX Project).

  - `assignment.external_reference.service_name` (string, required)
    The provider name of the integration. If you are adding multiple external references to the same object, the service_name must be unique.

  - `assignment.external_reference.service_model` (string, required)
    The object type of the external object this external reference belongs to.

  - `assignment.external_reference.service_model_ref` (string, required)
    The object ID of the external object this external reference belongs to.

  - `assignment.external_reference.external_message` (string)
    The message on the external object.

  - `assignment.external_reference.external_link` (string)
    The link to the external object.

  - `assignment.external_reference.external_status` (string)
    The status of the external object in the external system.

  - `assignment.external_reference.locked` (boolean)
    Whether the subject is locked.

## Response 200 fields (application/json):

  - `count` (integer)

  - `meta` (object)

  - `meta.count` (integer)

  - `meta.page_count` (integer)

  - `meta.page_number` (integer)

  - `meta.page_size` (integer)

  - `results` (array)

  - `results.key` (string)

  - `results.id` (string)

  - `assignments` (object)

  - `external_references` (object)

  - `stories` (object)

  - `users` (object)

  - `story_allocation_days` (object)

## Response 400 fields (application/json):

  - `errors` (array)

  - `errors.type` (string)

  - `errors.message` (string)


