# Update many links

`PATCH https://app.clik.so/api/links/bulk`

> **In short:** Moves up to 100 links to a folder, or changes their status, in one call. Use it to archive, restore or refile links in bulk.

## You need

* **API key permission:** `write`
* **Workspace role:** editor or higher
* **Plan:** any plan, including Free

## Example

```bash
curl -X PATCH "https://app.clik.so/api/links/bulk" \
  -H "Authorization: Bearer $CLIKSO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "ids": [
      "3f6c1a2e-9b4d-4e8f-a1c2-7d9e0f1a2b3c",
      "5d4c3b2a-1f0e-4d9c-8b7a-6f5e4d3c2b1a"
    ],
    "folder_id": "6b7c8d9e-0f1a-4b2c-8d3e-4f5a6b7c8d9e"
  }'
```

Response 200:

```json
{
  "status": 200,
  "success": true,
  "message": "Success",
  "data": {
    "updated_count": 2
  }
}
```

## Request body

| Field       | Type                   | Required | Description                                                             |
| ----------- | ---------------------- | -------- | ----------------------------------------------------------------------- |
| `ids`       | array of string · uuid | yes      | The links to change, at most 100. Up to 100 items                       |
| `status`    | string                 | no       | The new status for all of them. One of: `active`, `archived`, `expired` |
| `folder_id` | string · uuid or null  | no       | The new folder for all of them. `null` takes them out of their folders. |

## Common errors

| Status | Code               | When                                                                                                                            |
| ------ | ------------------ | ------------------------------------------------------------------------------------------------------------------------------- |
| 401    | `UNAUTHORIZED`     | The API key is missing, malformed or unknown.                                                                                   |
| 403    | `FORBIDDEN`        | The key only has Read permission, or its creator is a viewer in this workspace.                                                 |
| 422    | `VALIDATION_ERROR` | `ids` is empty or has more than 100 entries, neither `status` nor `folder_id` was sent, or the folder is not in this workspace. |
| 429    | `RATE_LIMITED`     | The key went over its per-minute request limit.                                                                                 |

## Good to know

* Send at most 100 ids per call. For more, split them into batches.
* Only `status` and `folder_id` can be changed in bulk. There is no bulk tagging and no bulk create.
* `folder_id: null` takes the links out of their folders.
* Ids that do not exist, belong to another workspace or are deleted are skipped silently. `updated_count` tells you how many changed.
* Archiving stops the short URLs from working. Setting `status` back to `active` turns them on again.

---

Source: https://clik.so/docs/api/links/bulk-update-links
