> For the complete documentation index, see [llms.txt](https://codemash.gitbook.io/codemash/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://codemash.gitbook.io/codemash/api-reference/files/test/test-files-integration.md).

# Test Files Integration

Files.

The Files module provides cloud storage and file management — upload, download, access control, metadata, and CDN-backed delivery. Files can be referenced from Database records and follow the same identity and permission rules as the rest of the project.

This endpoint checks that a files integration really works. It runs a short live test against the storage account: it uploads a small text file, reads it back, lists the folder, and deletes the file again. The answer lists each step with its result. It is the same check as the **Test** button in Cloud, and the outcome is saved on the integration the same way ("last tested").

`POST /{version}/files/{filesIntegrationId}/test`

{% hint style="info" %}
The interactive request/response panel will appear here once this endpoint is in the published API spec. Until then, the fields are below.
{% endhint %}

### Request

| Field                | Where | Required | Description                                                                                                                                       |
| -------------------- | ----- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| `filesIntegrationId` | path  | yes      | The integration to test (`int_…`). List them with [Get Files Integrations](/codemash/api-reference/files/integrations/get-files-integrations.md). |

The body can be empty. Send your API key and project as for every other Files endpoint.

### Response

```json
{
  "items": [
    { "operation": "UploadFile",  "result": "OK" },
    { "operation": "GetFile",     "result": "OK" },
    { "operation": "GetAllFiles", "result": "OK" },
    { "operation": "DeleteFile",  "result": "OK" }
  ],
  "responseStatus": { "isSuccess": true }
}
```

| Field               | Description                                                                          |
| ------------------- | ------------------------------------------------------------------------------------ |
| `items[].operation` | The step, in this order: `UploadFile`, `GetFile`, `GetAllFiles`, `DeleteFile`.       |
| `items[].result`    | `OK`, `FAILED`, or `NOT_TESTED` — once a step fails, the steps after it are not run. |
| `items[].errors`    | The provider's error messages for a `FAILED` step.                                   |
| `responseStatus`    | `isSuccess: false` with an error when the test could not run at all — see below.     |

### Errors

| When                                          | What you get                                                        |
| --------------------------------------------- | ------------------------------------------------------------------- |
| The integration id is not in this project     | `Integration with id int_… not found`                               |
| The id is not an integration id               | `Property FilesIntegrationId creation failed`                       |
| The integration was saved without credentials | "Integration secrets are not configured. Re-save the integration…"  |
| The storage refused the connection            | the provider's message, for example a wrong key or a missing bucket |
| Your key lacks the permission                 | forbidden                                                           |

### Permission

The test **writes** a file to your storage (and deletes it again), so it needs `files:create` on the integration (`files:integration:{id}`) — the same permission as uploading a file or saving an integration. A key with only `files:read` is refused.

{% hint style="warning" %}
The test creates and deletes a real file in the bucket or folder behind the integration. Storage providers may count this as a write request.
{% endhint %}

## In Cloud

Manage this visually in Cloud — see [Files → Integrations](/codemash/cloud/files/integrations.md). The **Test** button runs the same check.

## Use it from code

Every Norbix SDK exposes this endpoint as a method — see [Test Files Integration](/codemash/sdks/files/test/test-files-integration.md) in the SDK reference, with examples in every language.
