---
title: "Download an artifact"
---

> 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.

# Download an artifact

Path: CloudRaker Workspace API › Documents

`GET /workspace/sessions/{sessionId}/artifacts/{artifactId}/file`

The stored bytes of ANY artifact of this session, under their own content type — the composed PDF the Workspace viewer opens, the redlined `.docx` the export produced, the markdown itself. Nothing is minted: the response IS the file. **Authorization:** the same gate as every session route — `work_session:read` (or `comment` to write) on the session, OR `space:contribute` on one of its linked spaces; a desk session only for its owner. Any denial is 404.

## Authentication

- `bearerAuth`, http, header `Authorization`

## Path parameters

- `sessionId` (`readWorkspaceArtifactFile.path.sessionId`; string, required)
- `artifactId` (`readWorkspaceArtifactFile.path.artifactId`; string, required)

## Code samples

### cURL

```bash
curl --request GET \
  --url 'https://api.cloudraker.com/workspace/sessions/<sessionId>/artifacts/<artifactId>/file' \
  --header 'Authorization: Bearer <token>'
```

### TypeScript

```typescript
const url = 'https://api.cloudraker.com/workspace/sessions/<sessionId>/artifacts/<artifactId>/file';
const options = {method: 'GET', 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/workspace/sessions/<sessionId>/artifacts/<artifactId>/file"

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

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

print(response.text)
```

## Responses

### 200

The artifact bytes.

### 404

No such session or artifact, or the caller may not see it.

#### Example

```json
{
  "error": "string",
  "error_code": "string",
  "issues": [
    {
      "path": "string",
      "code": "string",
      "message": "string"
    }
  ]
}
```

- `error` (`readWorkspaceArtifactFile.response.404.error`; string, required) — The sentence a human reads.
- `error_code` (`readWorkspaceArtifactFile.response.404.error_code`; string, required) — The stable snake_case branch key.
- `issues` (`readWorkspaceArtifactFile.response.404.issues`; array<object>, optional) — Per-field detail, present only on a validation failure.
  - `path` (`readWorkspaceArtifactFile.response.404.issues.path`; string, required)
  - `code` (`readWorkspaceArtifactFile.response.404.issues.code`; string, required)
  - `message` (`readWorkspaceArtifactFile.response.404.issues.message`; string, required)

### 409

`artifact_not_ready` — the bytes are not stored or parsed yet (retryable); `document_version_conflict` — a save whose `baseVersion` is behind the current version.

#### Example

```json
{
  "error": "string",
  "error_code": "string",
  "issues": [
    {
      "path": "string",
      "code": "string",
      "message": "string"
    }
  ]
}
```

- `error` (`readWorkspaceArtifactFile.response.409.error`; string, required) — The sentence a human reads.
- `error_code` (`readWorkspaceArtifactFile.response.409.error_code`; string, required) — The stable snake_case branch key.
- `issues` (`readWorkspaceArtifactFile.response.409.issues`; array<object>, optional) — Per-field detail, present only on a validation failure.
  - `path` (`readWorkspaceArtifactFile.response.409.issues.path`; string, required)
  - `code` (`readWorkspaceArtifactFile.response.409.issues.code`; string, required)
  - `message` (`readWorkspaceArtifactFile.response.409.issues.message`; string, required)


Source: https://docs.cloudraker.com/workspace/api/documents/read-workspace-artifact-file/index.md
