# Files

Source: https://docs.elnora.ai/docs/api/reference/files
Last modified: 2026-09-14T10:17:43-06:00

> Files endpoints of the Elnora REST API.

Base URL `https://platform.elnora.ai/api/v1`. Authenticate every request with the `X-API-Key` header — see [Authentication](https://docs.elnora.ai/docs/get-started/authentication).

## `GET` /attachments/search

Search the org's rendered agent exports (task attachments) by name for the @-mention picker.

```bash
curl https://platform.elnora.ai/api/v1/attachments/search \
  -H "X-API-Key: $ELNORA_API_KEY"
```

**Parameters**

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `q` | query | string | no |
| `limit` | query | int32 | no |

**Responses**: `200`

## `POST` /files

Create a file (markdown/document).

```bash
curl -X POST https://platform.elnora.ai/api/v1/files \
  -H "X-API-Key: $ELNORA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "name": "...", "fileType": "..." }'
```

**Request body**

| Field | Type | Required |
| --- | --- | --- |
| `name` | string | yes |
| `description` | string | no |
| `fileType` | string | yes |
| `contentType` | string | no |
| `folderId` | uuid | no |
| `tags` | string[] | no |
| `content` | string | no |

**Responses**: `201` · `400`

## `GET` /files/&#123;id&#125;

Get file detail with version info.

```bash
curl https://platform.elnora.ai/api/v1/files/{id} \
  -H "X-API-Key: $ELNORA_API_KEY"
```

**Parameters**

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `id` | path | uuid | yes |

**Responses**: `200` · `400`

## `PUT` /files/&#123;id&#125;

Update file metadata.

```bash
curl -X PUT https://platform.elnora.ai/api/v1/files/{id} \
  -H "X-API-Key: $ELNORA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ ... }'
```

**Parameters**

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `id` | path | uuid | yes |

**Request body**

| Field | Type | Required |
| --- | --- | --- |
| `name` | string | no |
| `description` | string | no |
| `folderId` | uuid | no |
| `clearFolder` | boolean | no |
| `tags` | string[] | no |

**Responses**: `200` · `400`

## `DELETE` /files/&#123;id&#125;

Soft-delete a file.

```bash
curl -X DELETE https://platform.elnora.ai/api/v1/files/{id} \
  -H "X-API-Key: $ELNORA_API_KEY"
```

**Parameters**

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `id` | path | uuid | yes |

**Responses**: `204` · `403` · `404`

## `GET` /files/&#123;id&#125;/access

"Who has access" (KB Sharing v3): the full EFFECTIVE access list for a file — every principal who can reach it, each labelled direct (granted on the file) or inherited (from its folder).

```bash
curl https://platform.elnora.ai/api/v1/files/{id}/access \
  -H "X-API-Key: $ELNORA_API_KEY"
```

**Parameters**

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `id` | path | uuid | yes |

**Responses**: `200` · `403` · `404`

## `POST` /files/&#123;id&#125;/commit

Commit working copy changes to the original published file.

```bash
curl -X POST https://platform.elnora.ai/api/v1/files/{id}/commit \
  -H "X-API-Key: $ELNORA_API_KEY" \
  -H "Content-Type: application/json"
```

**Parameters**

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `id` | path | uuid | yes |

**Responses**: `201` · `400`

## `GET` /files/&#123;id&#125;/content

Get file content (presigned download URL).

```bash
curl https://platform.elnora.ai/api/v1/files/{id}/content \
  -H "X-API-Key: $ELNORA_API_KEY"
```

**Parameters**

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `id` | path | uuid | yes |

**Responses**: `200` · `400`

## `GET` /files/&#123;id&#125;/download

Stream file download through the backend.

```bash
curl https://platform.elnora.ai/api/v1/files/{id}/download \
  -H "X-API-Key: $ELNORA_API_KEY"
```

**Parameters**

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `id` | path | uuid | yes |

**Responses**: `200` · `400`

## `POST` /files/&#123;id&#125;/fork

Fork a file to another project.

```bash
curl -X POST https://platform.elnora.ai/api/v1/files/{id}/fork \
  -H "X-API-Key: $ELNORA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ ... }'
```

**Parameters**

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `id` | path | uuid | yes |

**Request body**

| Field | Type | Required |
| --- | --- | --- |
| `newName` | string | no |
| `targetFolderId` | uuid | no |

**Responses**: `201` · `400`

## `PATCH` /files/&#123;id&#125;/move

Move a file to a new workspace-model parent folder.

```bash
curl -X PATCH https://platform.elnora.ai/api/v1/files/{id}/move \
  -H "X-API-Key: $ELNORA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "parentFolderId": "00000000-0000-0000-0000-000000000000" }'
```

**Parameters**

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `id` | path | uuid | yes |

**Request body**

| Field | Type | Required |
| --- | --- | --- |
| `parentFolderId` | uuid | yes |

**Responses**: `200` · `400` · `403` · `404`

## `POST` /files/&#123;id&#125;/promote

Promote file visibility.

```bash
curl -X POST https://platform.elnora.ai/api/v1/files/{id}/promote \
  -H "X-API-Key: $ELNORA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "visibility": "..." }'
```

**Parameters**

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `id` | path | uuid | yes |

**Request body**

| Field | Type | Required |
| --- | --- | --- |
| `visibility` | string | yes |
| `orgFolderId` | uuid | no |

**Responses**: `200` · `400`

## `POST` /files/&#123;id&#125;/share

Share a file with a specific user, a team, or the whole org (default role: editor).

```bash
curl -X POST https://platform.elnora.ai/api/v1/files/{id}/share \
  -H "X-API-Key: $ELNORA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "role": "..." }'
```

**Parameters**

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `id` | path | uuid | yes |

**Request body**

| Field | Type | Required |
| --- | --- | --- |
| `userId` | int32 | no |
| `teamId` | uuid | no |
| `isOrgWide` | boolean | no |
| `role` | string | yes |

**Responses**: `201` · `400` · `403` · `404`

## `DELETE` /files/&#123;id&#125;/share/&#123;aceId&#125;

Revoke a file share by ace id.

```bash
curl -X DELETE https://platform.elnora.ai/api/v1/files/{id}/share/{aceId} \
  -H "X-API-Key: $ELNORA_API_KEY"
```

**Parameters**

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `id` | path | uuid | yes |
| `aceId` | path | uuid | yes |

**Responses**: `204` · `403` · `404`

## `GET` /files/&#123;id&#125;/shares

List the current shares on a file (with resolved principal name/email).

```bash
curl https://platform.elnora.ai/api/v1/files/{id}/shares \
  -H "X-API-Key: $ELNORA_API_KEY"
```

**Parameters**

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `id` | path | uuid | yes |

**Responses**: `200` · `403` · `404`

## `POST` /files/&#123;id&#125;/upload/confirm

Confirm upload completed.

```bash
curl -X POST https://platform.elnora.ai/api/v1/files/{id}/upload/confirm \
  -H "X-API-Key: $ELNORA_API_KEY" \
  -H "Content-Type: application/json"
```

**Parameters**

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `id` | path | uuid | yes |
| `versionId` | query | uuid | no |

**Responses**: `200` · `400`

## `GET` /files/&#123;id&#125;/versions

List version history.

```bash
curl https://platform.elnora.ai/api/v1/files/{id}/versions \
  -H "X-API-Key: $ELNORA_API_KEY"
```

**Parameters**

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `id` | path | uuid | yes |

**Responses**: `200` · `400`

## `POST` /files/&#123;id&#125;/versions

Create a new version (manual edit).

```bash
curl -X POST https://platform.elnora.ai/api/v1/files/{id}/versions \
  -H "X-API-Key: $ELNORA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ ... }'
```

**Parameters**

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `id` | path | uuid | yes |

**Request body**

| Field | Type | Required |
| --- | --- | --- |
| `content` | string | no |
| `contentBase64` | string | no |
| `changeSummary` | string | no |
| `changeSource` | string | no |
| `baseVersionId` | uuid | no |

**Responses**: `201` · `400`

## `GET` /files/&#123;id&#125;/versions/&#123;versionId&#125;/content

Get specific version content (presigned download URL).

```bash
curl https://platform.elnora.ai/api/v1/files/{id}/versions/{versionId}/content \
  -H "X-API-Key: $ELNORA_API_KEY"
```

**Parameters**

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `id` | path | uuid | yes |
| `versionId` | path | uuid | yes |

**Responses**: `200` · `400`

## `POST` /files/&#123;id&#125;/versions/&#123;versionId&#125;/restore

Restore a previous version (creates new version with old content).

```bash
curl -X POST https://platform.elnora.ai/api/v1/files/{id}/versions/{versionId}/restore \
  -H "X-API-Key: $ELNORA_API_KEY" \
  -H "Content-Type: application/json"
```

**Parameters**

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `id` | path | uuid | yes |
| `versionId` | path | uuid | yes |

**Responses**: `201` · `400`

## `POST` /files/&#123;id&#125;/working-copy

Create a working copy of a published file for editing within a task.

```bash
curl -X POST https://platform.elnora.ai/api/v1/files/{id}/working-copy \
  -H "X-API-Key: $ELNORA_API_KEY" \
  -H "Content-Type: application/json"
```

**Parameters**

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `id` | path | uuid | yes |
| `taskId` | query | uuid | no |

**Responses**: `201` · `400`

## `GET` /files/search

Search the org's files by name (KB + task inputs/results) for the @-mention picker.

```bash
curl https://platform.elnora.ai/api/v1/files/search \
  -H "X-API-Key: $ELNORA_API_KEY"
```

**Parameters**

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `q` | query | string | no |
| `limit` | query | int32 | no |

**Responses**: `200`

## `POST` /files/upload

Initiate a file upload (get presigned URL).

```bash
curl -X POST https://platform.elnora.ai/api/v1/files/upload \
  -H "X-API-Key: $ELNORA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "fileName": "...", "contentType": "...", "fileSizeBytes": "..." }'
```

**Request body**

| Field | Type | Required |
| --- | --- | --- |
| `fileName` | string | yes |
| `contentType` | string | yes |
| `fileSizeBytes` | int64 | yes |
| `folderId` | uuid | no |
| `taskId` | uuid | no |

**Responses**: `200` · `400`

## `POST` /files/upload/batch

Batch initiate uploads for multiple files (max 50).

```bash
curl -X POST https://platform.elnora.ai/api/v1/files/upload/batch \
  -H "X-API-Key: $ELNORA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "items": [] }'
```

**Request body**

| Field | Type | Required |
| --- | --- | --- |
| `items` | InitiateUpload[] | yes |

**Responses**: `400`

## `GET` /organizations/&#123;orgId&#125;/files

List ALL files across projects (org admin compliance view).

```bash
curl https://platform.elnora.ai/api/v1/organizations/{orgId}/files \
  -H "X-API-Key: $ELNORA_API_KEY"
```

**Parameters**

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `orgId` | path | uuid | yes |
| `Page` | query | int32 | no |
| `PageSize` | query | int32 | no |
| `SortBy` | query | string | no |
| `SortDirection` | query | string | no |

**Responses**: `200`

## `POST` /tasks/&#123;taskId&#125;/files/rendered

User-initiated rendered file write (e.g.

```bash
curl -X POST https://platform.elnora.ai/api/v1/tasks/{taskId}/files/rendered \
  -H "X-API-Key: $ELNORA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ ... }'
```

**Parameters**

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `taskId` | path | uuid | yes |

**Request body**

| Field | Type | Required |
| --- | --- | --- |
| `fileName` | string | no |
| `contentType` | string | no |
| `sizeBytes` | int64 | no |
| `sourceFileId` | uuid | no |
| `sourceVersionId` | uuid | no |

**Responses**: `201` · `400`

## `POST` /tasks/&#123;taskId&#125;/files/rendered/&#123;id&#125;/confirm

Confirm a user-initiated rendered file version after the presigned PUT completed.

```bash
curl -X POST https://platform.elnora.ai/api/v1/tasks/{taskId}/files/rendered/{id}/confirm \
  -H "X-API-Key: $ELNORA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ ... }'
```

**Parameters**

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `taskId` | path | uuid | yes |
| `id` | path | uuid | yes |

**Request body**

| Field | Type | Required |
| --- | --- | --- |
| `versionId` | uuid | no |

**Responses**: `200` · `400`
