---
title: "Pin attachment to its owner contact through its note/call/deal"
description: "PATCH /attachments/{attachment_id}/pin — Pins an attachment so it surfaces on the profile of the contact it belongs to, rather than only on the note, call, meeting or deal it was uploaded to."
canonical_url: https://developer.onepagecrm.com/api/reference/attachments/patch-attachments-attachment_id-pin/
source: Markdown mirror of https://developer.onepagecrm.com/api/reference/attachments/patch-attachments-attachment_id-pin/
---

`PATCH /attachments/{attachment_id}/pin`

Pins an attachment so it surfaces on the profile of the contact it belongs to, rather than only on the note, call, meeting or deal it was uploaded to. Pinned files are listed by GET /contacts/{contact_id}/pinned_attachments.

Resource: [Attachments](https://developer.onepagecrm.com/api/reference/attachments/) · [API Reference](https://developer.onepagecrm.com/api/reference/)

## Request

```bash
curl -X PATCH "https://app.onepagecrm.com/api/v3/attachments/{attachment_id}/pin" \
  -u $user_id:$api_key
```

Authentication is HTTP Basic — `user_id` as username, `api_key` as password.
See https://developer.onepagecrm.com/api/authentication/.

## Path parameters

| Name | Type | Description |
| --- | --- | --- |
| `attachment_id` | string | Attachment ID |

## Responses

### 200

OK

```json
{
  "status": 0,
  "message": "OK",
  "timestamp": 1528373119,
  "data": {
    "id": "5afc1ea9d556730b780096db",
    "filename": "mario.jpg",
    "custom_filename": "another_mario.jpg",
    "pinned": true,
    "pinned_at": "2022-01-24T10:42:39Z",
    "size": 3841,
    "storage_provider": "amazon",
    "url": "https://{foo.bar}/mario.jpg",
    "url_expires_at": "2018-05-16T13:06:53Z",
    "thumbnail": {
      "url": "https://{foo.bar}/mario-thumbnail.jpg"
    }
  }
}
```

Standard error responses: 400, 401, 403, 404, 409, 500 — shared across the API. See https://developer.onepagecrm.com/api/errors/.

## Related guides

- [Authentication](https://developer.onepagecrm.com/api/authentication/)
- [Errors](https://developer.onepagecrm.com/api/errors/)
- [Rate limits](https://developer.onepagecrm.com/api/rate-limits/)
