> For the complete documentation index, see [llms.txt](https://developers.getafile.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.getafile.io/files/update-a-file.md).

# Update a File

<mark style="color:orange;">`PUT`</mark> `https://{region}.getafile.io/api/v1/teams/:team_id/file/:id`

This endpoint allows you to update a File in your account.

#### Path Parameters

<table><thead><tr><th width="249">Name</th><th width="122">Type</th><th>Description</th></tr></thead><tbody><tr><td>id<mark style="color:red;">*</mark></td><td>integer</td><td>ID of the File</td></tr><tr><td>team_id<mark style="color:red;">*</mark></td><td>integer</td><td>ID of the Team</td></tr></tbody></table>

#### Request Body

<table><thead><tr><th width="251">Name</th><th width="125">Type</th><th>Description</th></tr></thead><tbody><tr><td>description<mark style="color:red;">*</mark></td><td>string</td><td>Description of the file for social sharing</td></tr><tr><td>published<mark style="color:red;">*</mark></td><td>string</td><td>Published: 1 or 0</td></tr><tr><td>type<mark style="color:red;">*</mark></td><td>string</td><td>Type of File (image, document, video)</td></tr><tr><td>name<mark style="color:red;">*</mark></td><td>string</td><td>Reference name for the File</td></tr><tr><td>url<mark style="color:red;">*</mark></td><td>string</td><td>URL where the File can be accessed</td></tr><tr><td>domain_id<mark style="color:red;">*</mark></td><td>integer</td><td>ID of the Domain</td></tr><tr><td>path_id</td><td>string</td><td>ID of the File Path</td></tr><tr><td>ips</td><td>string</td><td>Restrict access to the File to IP addresses: eg. xx.xxx.xx.xx, xxx.xx.xxx.x</td></tr><tr><td>password</td><td>string</td><td>Password protect the File</td></tr><tr><td>download_only<mark style="color:red;">*</mark></td><td>integer</td><td>Download only: 1 or 0</td></tr><tr><td>external_id</td><td>string</td><td>External ID from another platform for reference</td></tr><tr><td>filereferrer</td><td>array</td><td>An array of <a href="/pages/tKd17mGsVICTwGIFCT5E">referrer</a> IDs</td></tr></tbody></table>

{% tabs %}
{% tab title="200 File successfully updated." %}

```json
{
    "id": 64,
    "user_id": 1,
    "domain_id": 8,
    "name": "Test",
    "path_id": null,
    "tags": null,
    "url": "test",
    "fullurl": "test",
    "published": 1,
    "type": "document",
    "discoverable": 0,
    "password": null,
    "ips": null,
    "external_id": null,
    "created_at": "2020-10-04T06:01:11.000Z",
    "updated_at": "2020-10-04T06:01:11.000Z",
    "uri": "https://sandbox-getafile-online.getafile.online/test",
    "statusping": 1,
    "statusping_config": {
      "retries": 3,
      "retries_pause": 3,
      "emails": ["test@example.com"],
    },
    "serving_type": "file",
    "content": null
}
```

{% endtab %}

{% tab title="400 There was an issue with the JSON payload." %}

```
[
    {
        "message": "That URL is already in use for this domain",
        "field": "url",
        "validation": "checkFileUrl"
    }
]
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://developers.getafile.io/files/update-a-file.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
