# Pin a document to a vendor

Admin only. Names a file already in this workspace's library - the engagement letter, the W-9 - and attaches it to the vendor. The file is not uploaded or copied here: a pin is a reference, so one document keeps one storage key. Pinning what is already pinned is the same pin.

Access class: `workspace:admin`.

## Endpoint

`POST /v1/workspace/vendors/{id}/documents`

## Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| id | path | string | Yes |

## Request body

Content type: `application/json`.

```json
{
  "body": {
    "fileId": ""
  },
  "params": {
    ":id": "string"
  },
  "query": {}
}
```

## Responses

### 201

the action's answer

Content type: `application/json`.

```json
{
  "data": {
    "active": true,
    "contactEmail": "string",
    "contactName": "string",
    "contactPhone": "string",
    "contractEndsOn": "string",
    "contractStartedOn": "string",
    "createdAt": "string",
    "createdBy": 1,
    "documents": [
      {
        "fileId": "",
        "name": "string",
        "pinnedAt": "string",
        "pinnedBy": "string"
      }
    ],
    "id": "",
    "kind": "string",
    "name": "string",
    "notes": "string",
    "updatedAt": "string"
  }
}
```

### default

a refusal: `{"error": "<what a person needs to read>"}`. 401 no credential, 402 the plan does not include this, 403 the seat does not, 404 the thing does not exist or is not yours to see.

Content type: `application/json`.

```json
{
  "error": "string"
}
```
