---
title: "Unarchive an agent"
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.cloudraker.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Unarchive an agent

Path: CloudRaker Workspace API › Workspace Agents

`POST /agents/{agentRef}/unarchive`

Clears `archivedAt` and puts the published version back in service, so directory visibility and runnability agree again. The agent keeps its handle and its version history. Authorization: organization administrators only. A `private` agent is visible only to its owner; every other caller gets 404. Response: `{ data: Agent }`.

## Authentication

- `bearerAuth`, http, header `Authorization`

## Path parameters

- `agentRef` (`unarchivePaperworkAgent.path.agentRef`; string, required)

## Code samples

### cURL

```bash
curl --request POST \
  --url 'https://api.cloudraker.com/agents/<agentRef>/unarchive' \
  --header 'Authorization: Bearer <token>'
```

### TypeScript

```typescript
const url = 'https://api.cloudraker.com/agents/<agentRef>/unarchive';
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.cloudraker.com/agents/<agentRef>/unarchive"

headers = {"Authorization": "Bearer <token>"}

response = requests.post(url, headers=headers)

print(response.text)
```

## Responses

### 200

The unarchived agent.

#### Example

```json
{
  "data": {
    "id": "string",
    "handle": "string",
    "name": "string",
    "role": "string",
    "avatar": {
      "kind": "initials",
      "color": "string"
    },
    "visibility": "org",
    "ownerUserId": "string",
    "publishedVersionId": "string",
    "documentAgent": true,
    "draftVersionId": "string",
    "emailTriggerId": "string",
    "sourcePlaybookId": "string",
    "createdAt": "2019-08-24T14:15:22Z",
    "updatedAt": "2019-08-24T14:15:22Z",
    "createdBy": "string",
    "archivedAt": "2019-08-24T14:15:22Z"
  }
}
```

- `data` (`unarchivePaperworkAgent.response.200.data`; object, required)
  - `id` (`unarchivePaperworkAgent.response.200.data.id`; string, required)
  - `handle` (`unarchivePaperworkAgent.response.200.data.handle`; string, required) — Unique per org, derived from the name when not given (`mike`, `mike-2`, …).
  - `name` (`unarchivePaperworkAgent.response.200.data.name`; string, required)
  - `role` (`unarchivePaperworkAgent.response.200.data.role`; string, required)
  - `avatar` (`unarchivePaperworkAgent.response.200.data.avatar`; object, required)
    - `kind` (`unarchivePaperworkAgent.response.200.data.avatar.kind`; string, required)
      - one of `"initials"`, `"generated"`
    - `color` (`unarchivePaperworkAgent.response.200.data.avatar.color`; string, optional)
      - pattern `^#[0-9a-fA-F]{6}$`
  - `visibility` (`unarchivePaperworkAgent.response.200.data.visibility`; string, required)
    - one of `"org"`, `"private"`
  - `ownerUserId` (`unarchivePaperworkAgent.response.200.data.ownerUserId`; string, required)
  - `publishedVersionId` (`unarchivePaperworkAgent.response.200.data.publishedVersionId`; string | null, required) — The `agv_` id a run is started with. Null until the agent is published.
  - `draftVersionId` (`unarchivePaperworkAgent.response.200.data.draftVersionId`; string, required)
  - `emailTriggerId` (`unarchivePaperworkAgent.response.200.data.emailTriggerId`; string | null, required)
  - `sourcePlaybookId` (`unarchivePaperworkAgent.response.200.data.sourcePlaybookId`; string | null, required) — Set on agents created by the playbook migration; null otherwise.
  - `createdAt` (`unarchivePaperworkAgent.response.200.data.createdAt`; string, required)
    - format `date-time`; pattern `^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$`
  - `updatedAt` (`unarchivePaperworkAgent.response.200.data.updatedAt`; string, required)
    - format `date-time`; pattern `^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z))$`
  - `createdBy` (`unarchivePaperworkAgent.response.200.data.createdBy`; string, required)
  - `archivedAt` (`unarchivePaperworkAgent.response.200.data.archivedAt`; any of, required)
    - any of: `string`, `null`
  - `documentAgent` (`unarchivePaperworkAgent.response.200.data.documentAgent`; boolean, optional)

### 404

`not_found` — no such agent in this organization.


Source: https://docs.cloudraker.com/workspace/api/workspace-agents/unarchive-paperwork-agent/index.md
