# Create an Attachment **POST /attachments** The attachment resource connects uploads on Arta to shipment or request resources. Attached uploads are visible in the Arta Dashobard under the "Documents" tab on the shipment and request detail pages. Each upload may be attached to many requests or shipments. Each request or shipment may have many associated uploads. To create an attachment via the API you can must send an authenticated request to the `POST /attachments` endpoint with a body that includes one of two different payload schema. To attach an upload to a shipment, the attachment payload must include `upload_id` and `shipment_id` attributes. This payload must not include a `request_id` attribute. For example: ```json { "attachment": { "shipment_id": "506d79b6-1e5e-4e8c-a266-74658fdaf4ee", "upload_id": 5285 } } ``` To attach an upload to a request, the attachment payload must include `upload_id` and `request_id` attributes. This payload must not include a `shipment_id` attribute. For example: ```json { "attachment": { "request_id": "506d79b6-1e5e-4e8c-a266-74658fdaf4ee", "upload_id": 5285 } } ``` ## Servers - https://api.arta.io: https://api.arta.io () ## Parameters ### Headers - **Authorization** (string) Authorize your API calls with an Arta API token ### Body: application/json (object) - **attachment** (object) ## Responses ### 201 The created attachment #### Headers - **content-type** (string) - **x-arta-request-id** (string) A unique identifier for the Arta API call #### Body: application/json (object) - **created_at** (string) - **id** (integer) - **request_id** (string | null) The string ID of the request resource associated to an upload via this attachment. Null if this attachment associate a shipment - **shipment_id** (string | null) The string ID of the shipment resource associated to an upload via this attachment. Null if this attachment associate a request - **updated_at** (string) - **upload_id** (integer) The integer ID of the Upload resource associated with either a shipment or request via this attachment ### 400 Bad Request #### Headers - **content-type** (string) - **x-arta-request-id** (string) A unique identifier for the Arta API call #### Body: application/json (object) - **errors** (object) [Powered by Bump.sh](https://bump.sh)