## Upload an attachment

**post** `/v1/attachments`

Uploads an attachment. Reference the returned `att_id` from message
parts.

**Requirements**

- The request body is the raw bytes: no multipart, no JSON wrapper.
- `content-type` declares the attachment's MIME type; `x-filename`
  declares its name.
- Maximum 100,000,000 bytes (100 MB). Larger payloads return HTTP 413
  `too_large`. An empty body returns HTTP 400 `code` 1017.
- No `Idempotency-Key`: the server neither requires nor consults one
  here.

**Behavior**

- Uploads are idempotent over your brand and the bytes: the `att_id` is
  derived from them, so re-uploading a file you already hold returns the
  same id and stores nothing twice. A retry is free and needs no key.
- The stored `mime` and `name` stay the first upload's, and the response
  reports the stored values: a later upload declaring a different
  `content-type` gets the original back. To change a stored type, upload
  altered bytes, which are a different attachment.
- Attachments are scoped to your brand. Another brand uploading the
  identical file gets a different id and its own copy.

### Header Parameters

- `"x-filename": optional string`

### Returns

- `id: string`

  Attachment id (`att_…`) to reference from parts.

- `mime: string`

  The STORED MIME type: the same value `GET /v1/attachments/{att}` reports,
  not an echo of the request header. It is your `content-type` when you sent
  one, `application/octet-stream` when you did not, and on a duplicate upload
  it is the type the FIRST upload of these bytes declared.

- `size: number`

  Stored size in bytes.

### Example

```http
curl https://messages.api.linqapp.com/v1/attachments \
    -H 'Content-Type: */*' \
    -H "Authorization: Bearer $LINQ_AMB_API_KEY" \
    -d '{}'
```

#### Response

```json
{
  "id": "att_1a3f77",
  "mime": "image/png",
  "size": 20481
}
```
