---
title: "Assign a container party role"
method: POST
path: "/containers/{container_id}/party_roles"
tags: ["Parties"]
---

# Assign a container party role

`POST /containers/{container_id}/party_roles`

Attaches a party to the container in the given role. Roles are additive: posting a second party with the same role keeps both. To replace a party, delete its role and create a new one. Posting the same party and role twice returns `422`.

## Request body

- object
  - `data` object, required
    - `type` 'party_role', required
    - `attributes` object, required
      - `role` 'pickup_dray_carrier', required — Only `pickup_dray_carrier` is accepted. Other values return `422`.
    - `relationships` object, required
      - `party` object, required
        - `data` object, required
          - `id` string, uuid, required — ID of a party in your account. See `GET /parties`.
          - `type` 'party', required

## Response `201`

Created

- object
  - `data` PartyRole
    - `id` string, uuid
    - `type` 'party_role'
    - `attributes` object
      - `role` 'shipper' | 'consignee' | 'notify_party' | 'customs_broker' | 'customer' | 'freight_forwarder' | 'pickup_dray_carrier' — Role the party plays on the record. Shipments accept every value. Containers accept only `pickup_dray_carrier`.
      - `roleable_type` 'Shipment' | 'Cargo' — Type of the record the role is attached to. `Cargo` is returned for containers.
      - `roleable_id` string, uuid — ID of the shipment, container, or tracking request.
      - `created_at` string, date-time
      - `updated_at` string, date-time
    - `relationships` object
      - `party` object
        - `data` object
          - `id` string, uuid
          - `type` 'party'
  - `included` Party[]
    - `id` string, uuid
    - `attributes` object, required
      - `company_name` string, required — Company name
    - `type` 'party'
  - `links` LinkSelf
    - `self` string, uri

## Other responses

- `401` — Unauthorized. Also returned when the party or the record belongs to another account.
- `404` — Not Found
- `422` — Unprocessable Entity

## Changes

- **2026-09-02** `bebf7b9b8408` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/terminal49/apis/terminal49-api-reference/changes/containers/:container_id/party_roles/post.md)

---

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