# Change an open attachment

Page: https://app.myclaimhouse.com/docs/api/updateAttachment

`PATCH /api/v1/attachments/{id}`

Changes an open attachment not yet being sent: its narrative, and, for one made for no claim or for a claim that was voided, its patient, subscriber and service_dates (the network's record needs them; send the fields to change). One made for a claim takes its patient from the claim (409). Needs an Idempotency-Key header and a key with the submit permission.

Needs a key with `submit` permission.

## Request

### Headers

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `Idempotency-Key` | string | Yes | Makes the request safe to repeat: a request with the same key and body returns the first answer (the reply has an idempotent-replayed header), and the same key with a different request is refused. 1 to 255 printable characters; a UUID is a good choice. At least 1 character. At most 255 characters. Matches `^[\x21-\x7e]{1,255}$`. |

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | Yes | An attachment ID (att_...). |

### Body

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `narrative` | string | No | What the documents show, in words: at most 2000 characters. |
| `patient` | object | No | The patient, for an attachment made for no claim (required then; one made for a claim takes the claim's). |
| `patient.first_name` | string | Yes |  |
| `patient.last_name` | string | Yes |  |
| `patient.date_of_birth` | string (date) | Yes |  |
| `subscriber` | object | No | The insured, for an attachment made for no claim (required then). |
| `subscriber.first_name` | string | Yes |  |
| `subscriber.last_name` | string | Yes |  |
| `subscriber.member_id` | string | Yes |  |
| `subscriber.relationship` | string | Yes | The patient's relationship to the insured. One of: `self`, `spouse`, `child`, `other`. |
| `service_dates` | object | No | The dates of service the documents are about, for an attachment made for no claim (required then). |
| `service_dates.from` | string (date) | Yes |  |
| `service_dates.to` | string (date) | Yes |  |

## Response

The attachment. Status `200`.

| Name | Type | Description |
| --- | --- | --- |
| `id` | string | An ID that starts with att_. |
| `object` | string | Always `attachment`. |
| `state` | string | open while documents can be added; closed once sent, with its number. Nothing changes after closing. One of: `open`, `closed`. |
| `kind` | string | unsolicited (sent with a claim); solicited (answering a payer request: never on a claim file). One of: `unsolicited`, `solicited`. |
| `claim_id` | string or null | The claim it was made for, if any. Which claims carry it is the claim's attachments field. |
| `office_id` | string | An ID that starts with off_. |
| `payer` | object |  |
| `payer.id` | string | An ID that starts with pyr_. |
| `payer.payer_id` | string | The payer's own payer ID. |
| `payer.name` | string |  |
| `payer_request_id` | string or null | An ID that starts with prq_. |
| `payer_reference` | value | The payer's reference number, for a solicited attachment. |
| `narrative` | string | What the documents show, in words: at most 2000 characters. |
| `documents` | array of object |  |
| `documents[].id` | string | An ID that starts with doc_. |
| `documents[].object` | string | Always `attachment_document`. |
| `documents[].document_type` | string | The document type code (GET /attachments/document_types). |
| `documents[].medium` | string | film (an X-ray or a photo: has an image date and an orientation) or paper. One of: `film`, `paper`. |
| `documents[].image_date` | string (date) or null |  |
| `documents[].orientation` | string or null | One of: `left`, `right`. |
| `documents[].file_name` | string | The name the file was sent with, for display: the last part of it, without control characters. The stored file is named by the document ID. |
| `documents[].converted_from` | string or null | png when the upload was a PNG, converted to the JPEG that is stored and sent; pdf when it was a PDF, rendered to one JPEG for each page; null when it was a JPEG. One of: `png`, `pdf`. |
| `documents[].pages` | integer | How many pages the document has: 1 for an image, the PDF's page count for a PDF. Each page is one image, previewed by page and sent with the document. At least 1. |
| `documents[].size` | integer | The size in bytes of the image as stored and sent: the upload rewritten without its metadata (a PNG converted to a JPEG first). For a PDF, size is the total of its page images and md5 is that of its first page's image. At least -9007199254740991. |
| `documents[].md5` | string | The MD5 of the stored image (the JPEG), lower-case hex. For a PDF, size is the total of its page images and md5 is that of its first page's image. |
| `documents[].sent_to_network` | boolean | True once the document has been sent to the attachment network (closing sends it). |
| `documents[].created_at` | string (date-time) |  |
| `attachment_number` | value | The number the attachment network gave when it closed; null while open. |
| `claim_file` | object or null | How a claim carrying it refers to it; null while open. |
| `claim_file.pwk` | string | What the claim file carries in PWK06 (loop 2300). |
| `claim_file.nte` | string | The note the claim file carries for it (NTE, loop 2300). |
| `request_id` | string or null | The API request that made it; null for one made in the dashboard. |
| `created_at` | string (date-time) |  |
| `updated_at` | string (date-time) |  |
| `closed_at` | string (date-time) or null |  |

## Errors

| HTTP status | Code | What it means |
| --- | --- | --- |
| 401 | `UNAUTHORIZED` | A valid API key is required. Send it as "Authorization: Bearer <key>". |
| 403 | `PERMISSION_DENIED` | This API key is not allowed to do that. |
| 404 | `NOT_FOUND` | Not found. |
| 422 | `INVALID_REQUEST` | The request is not valid. |
| 400 | `IDEMPOTENCY_KEY_REQUIRED` | This request needs an Idempotency-Key header: a value you make up (a UUID is good), new for each new request. |
| 400 | `IDEMPOTENCY_KEY_INVALID` | The Idempotency-Key header must be 1 to 255 printable characters. |
| 422 | `IDEMPOTENCY_KEY_REUSED` | That Idempotency-Key was already used with a different request. |
| 409 | `IDEMPOTENCY_KEY_IN_USE` | A request with that Idempotency-Key is still running. Send it again with the same key after Retry-After seconds. |
| 429 | `TOO_MANY_REQUESTS` | Too many requests of this kind lately. Wait, then try again. |
| 413 | `PAYLOAD_TOO_LARGE` | The request body is larger than 1 MB. |
| 504 | `TIMEOUT` | The request took too long. Send it again with the same Idempotency-Key and body after Retry-After seconds: a 409 means it is still finishing (wait and send again), and any other answer is final. If this 504 comes back, find what the request made by listing with ?idempotency_key=<the key>. |
| 503 | `ATTACHMENTS_UNAVAILABLE` | Attachments are not available in live mode yet. Use a test key. |
| 409 | `CONFLICT` | The resource is not in a state that allows this, or it changed while the request was handled. Read it, then decide whether to send the request again. |
| 500 | `INTERNAL` | Something went wrong on our side. Quote the request ID if you contact us. |

## Example

### Example request

```bash
curl -X PATCH "https://app.myclaimhouse.com/api/v1/attachments/att_01JM000000E00800000000003G" \
  -H "Authorization: Bearer $CLAIMHOUSE_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "patient": {
    "first_name": "Alex",
    "last_name": "Example",
    "date_of_birth": "1985-04-12"
  }
}'
```

### Example response: 200

```json
{
  "id": "att_01JM000000E00800000000003G",
  "object": "attachment",
  "state": "open",
  "kind": "unsolicited",
  "claim_id": "clm_01JM000000E00800000000002G",
  "office_id": "off_01JM000000E008000000000003",
  "payer": {
    "id": "pyr_01JM000000E008000000000004",
    "payer_id": "00000",
    "name": "Example Dental Plan"
  },
  "payer_request_id": null,
  "payer_reference": null,
  "narrative": "Fractured distal cusp on tooth 3, shown on the bitewing.",
  "documents": [],
  "attachment_number": null,
  "claim_file": null,
  "request_id": "req_01JM000000E00800000000003K",
  "created_at": "2026-09-24T20:57:00.000000+00:00",
  "updated_at": "2026-09-24T20:57:00.000000+00:00",
  "closed_at": null
}
```
