---
title: "POST's metadata for a file when an upload has started"
method: POST
path: "/files"
tags: ["File upload started"]
---

# POST's metadata for a file when an upload has started

`POST /files`

## Request

- Base URL: `http://localhost:26900`
- URL: `http://localhost:26900/files`
- Auth: API key in header `Authorization`

## Request body

- NewFileUpload: New file upload metadata to be POSTed
  - `path` string, required: Path to file
  - `is_publishable` boolean, required: Is the file publishable
  - `collection_id` string: The collection ID to which the file is attached
  - `bundle_id` string: The bundle ID to which the file is attached
  - `title` string: The title given to the file
  - `size_in_bytes` integer, required: Size of the file in bytes
  - `type` string, required: The file type
  - `licence` string, required: The type of licence the file has
  - `licence_url` string, required: Licence URL
  - `content_item` object: Dataset information that the file relates to
    - `dataset_id` string: The dataset ID
    - `edition` string: The edition
    - `version` string: The version

## Response `201`

OK

## Other responses

- `400`: Request could not be processed
- `401`: Authentication information is missing or invalid.
- `403`: Authoristion Failed - Check logs
- `500`: Failed to process the request due to an internal error

---

[API](https://skmtc.dev/office-of-national-statistics/apis/files-api.md) - [All operations](https://skmtc.dev/office-of-national-statistics/apis/files-api/llms.txt) - [OpenAPI document](https://skmtc.dev/office-of-national-statistics/apis/files-api/revisions/b34c9662a495?raw)
