> 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/file-version/create-a-file-version.md).

# Create a File Version

**Please note:** All new File Versions will be content checked for Adult, Violent and Spoofing content.

<mark style="color:green;">`POST`</mark> `https://{region}.getafile.io/api/v1/teams/:team_id/fileversion`

This endpoint allows you to create a new File Version.

#### Request Body

<table><thead><tr><th width="243">Name</th><th width="140">Type</th><th>Description</th></tr></thead><tbody><tr><td>file_id</td><td>integer</td><td>ID of the File</td></tr><tr><td>filename</td><td>string</td><td>Name of the file you are uploading</td></tr><tr><td>fileversion</td><td>string</td><td>Base64 encoded file data</td></tr><tr><td>version_name</td><td>string</td><td>Name of the version</td></tr><tr><td>version_description</td><td>string</td><td>Description of the version</td></tr><tr><td>active</td><td>integer</td><td>1 for active, 0 for inactive<br><em>*Please note: Files with the serving type of "content" will always be made active upon version creation</em></td></tr><tr><td>content</td><td>string</td><td>Code content of the version when the file serving type is <strong>content</strong></td></tr></tbody></table>

{% tabs %}
{% tab title="201 File Version created successfully." %}

```json
{
    "id": 1,
    "file_id": 5,
    "user_id": 1,
    "filename": "Testing-1.png",
    "active": 1,
    "verified": 1,
    "stats": {
        "sizeHuman": "285.2 KB",
        "size": 285210,
        "ext": ".png",
        "dimensions": {
            "height": 1024,
            "width": 1024
        }
    },
    "created_at": "2024-04-18T19:16:05.000+10:00",
    "updated_at": "2024-04-18T19:16:05.000+10:00",
    "size": 285210,
    "meta": {},
    "version_name": "Version 1.0",
    "version_description": "Version description",
    "content": null
}
```

{% endtab %}

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

```
[
    {
        "message": "You must include a valid file type",
        "field": "filename",
        "validation": "checkFileVersionType"
    }
]
```

{% 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/file-version/create-a-file-version.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.
