---
title: "Get a file"
---

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

# Get a file

Path: CloudRaker Paperwork API › Spaces

`GET /v1/spaces/{spaceId}/files/{id}`

Returns a file's metadata and where it is in the pipeline.

`{id}` accepts the file id or the file name. A name has to match exactly one file here, otherwise the call answers `409 ambiguous_file_name`.

`status` walks `uploading` → `processing` → `ready`, or lands on `failed` with an `error`. Poll this route after [registering a file](https://docs.cloudraker.com/paperwork/api/files/create-file) until it reads `ready`.

Once `ready`, `urls` carries signed links valid for about an hour:

- `content` — the original bytes.
- `markdown` and `json` — the parsed forms, present when the file was parsed.

**Learn more:** [Working with files](https://docs.cloudraker.com/paperwork/developers/files)

## Authentication

- `bearerAuth`, http, header `Authorization`

## Path parameters

- `id` (`spaceGetFile.path.id`; string, required)
  - minLength 1
- `spaceId` (`spaceGetFile.path.spaceId`; string, required)

## Code samples

### cURL

```bash
curl --request GET \
  --url 'https://api.cloudraker.com/v1/spaces/<spaceId>/files/<id>' \
  --header 'Authorization: Bearer <token>'
```

### TypeScript

```typescript
const url = 'https://api.cloudraker.com/v1/spaces/<spaceId>/files/<id>';
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/v1/spaces/<spaceId>/files/<id>"

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

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

print(response.text)
```

## Responses

### 200

The file.

#### Example

```json
{
  "object": "file",
  "id": "string",
  "name": "string",
  "mimeType": "string",
  "status": "uploading",
  "createdAt": "string",
  "parentFileId": "string",
  "metadata": {
    "property1": "string",
    "property2": "string"
  },
  "error": "string",
  "uploadUrl": "string",
  "uploadExpiresAt": "string",
  "urls": {
    "content": "string",
    "markdown": "string",
    "json": "string"
  }
}
```

- `object` (`spaceGetFile.response.200.object`; string, required)
- `id` (`spaceGetFile.response.200.id`; string, required)
- `name` (`spaceGetFile.response.200.name`; string, required)
- `mimeType` (`spaceGetFile.response.200.mimeType`; string, required)
- `status` (`spaceGetFile.response.200.status`; string, required)
  - one of `"uploading"`, `"processing"`, `"ready"`, `"failed"`
- `createdAt` (`spaceGetFile.response.200.createdAt`; string, required)
- `parentFileId` (`spaceGetFile.response.200.parentFileId`; string, optional)
- `metadata` (`spaceGetFile.response.200.metadata`; map<string>, optional)
- `error` (`spaceGetFile.response.200.error`; string, optional)
- `uploadUrl` (`spaceGetFile.response.200.uploadUrl`; string, optional)
- `uploadExpiresAt` (`spaceGetFile.response.200.uploadExpiresAt`; string, optional)
- `urls` (`spaceGetFile.response.200.urls`; object, optional)
  - `content` (`spaceGetFile.response.200.urls.content`; string, optional)
  - `markdown` (`spaceGetFile.response.200.urls.markdown`; string, optional)
  - `json` (`spaceGetFile.response.200.urls.json`; string, optional)

### 400

Validation Error

#### Example

```json
{
  "success": false,
  "error": [
    null
  ],
  "data": null
}
```

- `success` (`spaceGetFile.response.400.success`; boolean, required)
  - one of `false`
- `error` (`spaceGetFile.response.400.error`; array<unknown>, required)
- `data` (`spaceGetFile.response.400.data`; unknown, required)

### 404

Unknown file id (or a file outside the API workspace).

### 409

The name matches more than one file (`ambiguous_file_name`), or there are too many files to resolve a name safely (`file_listing_truncated`).

### 429

Rate limited. The `/v1` API allows at least **67 requests per minute per organization** (about 1,000 requests per 15 minutes) — a guaranteed floor, enforced per edge location, so a geographically spread caller may get more. Wait for the `Retry-After` interval and retry — the error is `retryable`.

#### Example

```json
{
  "code": "rate_limited",
  "message": "string",
  "retryable": true,
  "requestId": "string",
  "docUrl": "string"
}
```

- `code` (`spaceGetFile.response.429.code`; string, required)
  - one of `"rate_limited"`
- `message` (`spaceGetFile.response.429.message`; string, required)
- `retryable` (`spaceGetFile.response.429.retryable`; boolean, required)
  - one of `true`
- `requestId` (`spaceGetFile.response.429.requestId`; string, required)
- `docUrl` (`spaceGetFile.response.429.docUrl`; string, optional)


Source: https://docs.cloudraker.com/paperwork/api/spaces/space-get-file/index.md
