# Get Files of a Test Plan

This endpoint retrieves a list of files associated with a specific test plan. The user must have the `PLAN_UPDATE` authority to access this endpoint.

***

### Endpoint Information

* **URL**: `https://testinium.io/Testinium.RestApi/api/plans/{planId}/planFile`
* **Method**: `GET`
* **Authentication**: Required (`Bearer Token`)
* **Headers**: Required (`current-company-id: <your_company_id>`)

***

### Path Parameters

| Parameter | Type   | Required | Description                     |
| --------- | ------ | -------- | ------------------------------- |
| `planId`  | `Long` | Yes      | The unique ID of the test plan. |

***

### Response

The response contains a list of files associated with the specified test plan. If the company does not have the `FILE_UPLOAD` plugin enabled, the response will return an empty list.

```
[]
```

#### Response Fields

| Field | Type   | Description                |
| ----- | ------ | -------------------------- |
| `id`  | `Long` | The unique ID of the file. |

### Error Codes

| HTTP Code | Error Message           | Description                                      |
| --------- | ----------------------- | ------------------------------------------------ |
| `404`     | `PLAN_NOT_FOUND`        | The specified test plan ID was not found.        |
| `403`     | `ACCESS_DENIED`         | User lacks `PLAN_UPDATE` authority.              |
| `500`     | `INTERNAL_SERVER_ERROR` | An unexpected error occurred on the server side. |

***

### Example Request

```bash
curl --location 'https://testinium.io/Testinium.RestApi/api/plans/{planId}/planFile' \
--header 'Authorization: Bearer <your_access_token>' \
--header 'current-company-id: <your_company_id>'
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://testinium.gitbook.io/testinium/apis/plan/get-files-of-a-test-plan.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
