# Organization API: Customer Portal: Files

> The 15 Organization API operations for files.

Source: https://docs.coritan.com/api/reference/organizations/customer-portal/servers-files/

Part of [Customer Portal](/api/reference/organizations/customer-portal/).

## Operations

| Method | Path | Summary |
| --- | --- | --- |
| POST | [`/api/v1/orgs/{org_slug}/portal/servers/{uuid}/files/chmod`](#op-post-api-v1-orgs-org-slug-portal-servers-uuid-files-chmod) | Chmod files |
| POST | [`/api/v1/orgs/{org_slug}/portal/servers/{uuid}/files/compress`](#op-post-api-v1-orgs-org-slug-portal-servers-uuid-files-compress) | Compress files |
| GET | [`/api/v1/orgs/{org_slug}/portal/servers/{uuid}/files/contents`](#op-get-api-v1-orgs-org-slug-portal-servers-uuid-files-contents) | File contents |
| POST | [`/api/v1/orgs/{org_slug}/portal/servers/{uuid}/files/copy`](#op-post-api-v1-orgs-org-slug-portal-servers-uuid-files-copy) | Copy file |
| POST | [`/api/v1/orgs/{org_slug}/portal/servers/{uuid}/files/decompress`](#op-post-api-v1-orgs-org-slug-portal-servers-uuid-files-decompress) | Decompress file |
| POST | [`/api/v1/orgs/{org_slug}/portal/servers/{uuid}/files/delete`](#op-post-api-v1-orgs-org-slug-portal-servers-uuid-files-delete) | Delete files |
| GET | [`/api/v1/orgs/{org_slug}/portal/servers/{uuid}/files/download`](#op-get-api-v1-orgs-org-slug-portal-servers-uuid-files-download) | Download file |
| GET | [`/api/v1/orgs/{org_slug}/portal/servers/{uuid}/files/list`](#op-get-api-v1-orgs-org-slug-portal-servers-uuid-files-list) | List files |
| POST | [`/api/v1/orgs/{org_slug}/portal/servers/{uuid}/files/mkdir`](#op-post-api-v1-orgs-org-slug-portal-servers-uuid-files-mkdir) | Mkdir |
| POST | [`/api/v1/orgs/{org_slug}/portal/servers/{uuid}/files/pull`](#op-post-api-v1-orgs-org-slug-portal-servers-uuid-files-pull) | Pull file |
| POST | [`/api/v1/orgs/{org_slug}/portal/servers/{uuid}/files/pull/cancel`](#op-post-api-v1-orgs-org-slug-portal-servers-uuid-files-pull-cancel) | Cancel pull |
| GET | [`/api/v1/orgs/{org_slug}/portal/servers/{uuid}/files/pull/status`](#op-get-api-v1-orgs-org-slug-portal-servers-uuid-files-pull-status) | Pull status |
| POST | [`/api/v1/orgs/{org_slug}/portal/servers/{uuid}/files/rename`](#op-post-api-v1-orgs-org-slug-portal-servers-uuid-files-rename) | Rename files |
| POST | [`/api/v1/orgs/{org_slug}/portal/servers/{uuid}/files/upload`](#op-post-api-v1-orgs-org-slug-portal-servers-uuid-files-upload) | Upload files |
| POST | [`/api/v1/orgs/{org_slug}/portal/servers/{uuid}/files/write`](#op-post-api-v1-orgs-org-slug-portal-servers-uuid-files-write) | Write file |

### Chmod files {#op-post-api-v1-orgs-org-slug-portal-servers-uuid-files-chmod}

`POST /api/v1/orgs/{org_slug}/portal/servers/{uuid}/files/chmod`

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `uuid` | path | string | yes |
| `org_slug` | path | string | yes |

#### Request body

`application/json` (required)

| Field | Type | Required |
| --- | --- | --- |
| `root` | string | no |
| `files` | array of object | yes |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

### Compress files {#op-post-api-v1-orgs-org-slug-portal-servers-uuid-files-compress}

`POST /api/v1/orgs/{org_slug}/portal/servers/{uuid}/files/compress`

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `uuid` | path | string | yes |
| `org_slug` | path | string | yes |

#### Request body

`application/json` (required)

| Field | Type | Required |
| --- | --- | --- |
| `root` | string | no |
| `files` | array of string | yes |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

### File contents {#op-get-api-v1-orgs-org-slug-portal-servers-uuid-files-contents}

`GET /api/v1/orgs/{org_slug}/portal/servers/{uuid}/files/contents`

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `uuid` | path | string | yes |
| `org_slug` | path | string | yes |
| `path` | query | string | yes |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

### Copy file {#op-post-api-v1-orgs-org-slug-portal-servers-uuid-files-copy}

`POST /api/v1/orgs/{org_slug}/portal/servers/{uuid}/files/copy`

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `uuid` | path | string | yes |
| `org_slug` | path | string | yes |

#### Request body

`application/json` (required)

| Field | Type | Required |
| --- | --- | --- |
| `location` | string | yes |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

### Decompress file {#op-post-api-v1-orgs-org-slug-portal-servers-uuid-files-decompress}

`POST /api/v1/orgs/{org_slug}/portal/servers/{uuid}/files/decompress`

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `uuid` | path | string | yes |
| `org_slug` | path | string | yes |

#### Request body

`application/json` (required)

| Field | Type | Required |
| --- | --- | --- |
| `root` | string | no |
| `file` | string | yes |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

### Delete files {#op-post-api-v1-orgs-org-slug-portal-servers-uuid-files-delete}

`POST /api/v1/orgs/{org_slug}/portal/servers/{uuid}/files/delete`

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `uuid` | path | string | yes |
| `org_slug` | path | string | yes |

#### Request body

`application/json` (required)

| Field | Type | Required |
| --- | --- | --- |
| `root` | string | no |
| `files` | array of string | yes |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

### Download file {#op-get-api-v1-orgs-org-slug-portal-servers-uuid-files-download}

`GET /api/v1/orgs/{org_slug}/portal/servers/{uuid}/files/download`

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `uuid` | path | string | yes |
| `org_slug` | path | string | yes |
| `path` | query | string | yes |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

### List files {#op-get-api-v1-orgs-org-slug-portal-servers-uuid-files-list}

`GET /api/v1/orgs/{org_slug}/portal/servers/{uuid}/files/list`

#### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `uuid` | path | string | yes |  |
| `org_slug` | path | string | yes |  |
| `directory` | query | string | no | Default: `/`. |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

### Mkdir {#op-post-api-v1-orgs-org-slug-portal-servers-uuid-files-mkdir}

`POST /api/v1/orgs/{org_slug}/portal/servers/{uuid}/files/mkdir`

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `uuid` | path | string | yes |
| `org_slug` | path | string | yes |

#### Request body

`application/json` (required)

| Field | Type | Required |
| --- | --- | --- |
| `root` | string | no |
| `name` | string | yes |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

### Pull file {#op-post-api-v1-orgs-org-slug-portal-servers-uuid-files-pull}

`POST /api/v1/orgs/{org_slug}/portal/servers/{uuid}/files/pull`

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `uuid` | path | string | yes |
| `org_slug` | path | string | yes |

#### Request body

`application/json` (required)

| Field | Type | Required |
| --- | --- | --- |
| `url` | string | yes |
| `destination_path` | string | yes |
| `filename` | string or null | no |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

### Cancel pull {#op-post-api-v1-orgs-org-slug-portal-servers-uuid-files-pull-cancel}

`POST /api/v1/orgs/{org_slug}/portal/servers/{uuid}/files/pull/cancel`

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `uuid` | path | string | yes |
| `org_slug` | path | string | yes |
| `download_id` | query | string | yes |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

### Pull status {#op-get-api-v1-orgs-org-slug-portal-servers-uuid-files-pull-status}

`GET /api/v1/orgs/{org_slug}/portal/servers/{uuid}/files/pull/status`

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `uuid` | path | string | yes |
| `org_slug` | path | string | yes |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

### Rename files {#op-post-api-v1-orgs-org-slug-portal-servers-uuid-files-rename}

`POST /api/v1/orgs/{org_slug}/portal/servers/{uuid}/files/rename`

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `uuid` | path | string | yes |
| `org_slug` | path | string | yes |

#### Request body

`application/json` (required)

| Field | Type | Required |
| --- | --- | --- |
| `root` | string | no |
| `files` | array of object | yes |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

### Upload files {#op-post-api-v1-orgs-org-slug-portal-servers-uuid-files-upload}

`POST /api/v1/orgs/{org_slug}/portal/servers/{uuid}/files/upload`

#### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `uuid` | path | string | yes |  |
| `org_slug` | path | string | yes |  |
| `directory` | query | string | no | Default: `/`. |

#### Request body

`multipart/form-data` (required)

| Field | Type | Required |
| --- | --- | --- |
| `files` | array of string (binary) | yes |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

### Write file {#op-post-api-v1-orgs-org-slug-portal-servers-uuid-files-write}

`POST /api/v1/orgs/{org_slug}/portal/servers/{uuid}/files/write`

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `uuid` | path | string | yes |
| `org_slug` | path | string | yes |

#### Request body

`application/json` (required)

| Field | Type | Required |
| --- | --- | --- |
| `path` | string | yes |
| `content` | string | no |
| `expected_hash` | string or null | no |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |
