# Upload a file

Declare a workspace-loose file and get back its row plus a signed upload URL good for 15 minutes — the bytes go straight from the client to storage and never through this service. Needs a name and a non-negative sizeBytes; documentType, periodStart and periodEnd are optional and can be set afterwards with PATCH /v1/files/:id. Answers 503 when this deployment has no file storage configured, rather than a URL that would not work.

Access class: `workspace`.

## Endpoint

`POST /v1/files`

## Request body

Content type: `application/json`.

```json
{
  "body": {
    "contentType": "string",
    "documentType": "string",
    "name": "string",
    "periodEnd": "string",
    "periodStart": "string",
    "sizeBytes": 1
  },
  "params": {},
  "query": {}
}
```

## Responses

### 201

the action's answer

Content type: `application/json`.

```json
{}
```

### default

a refusal: `{"error": "<what a person needs to read>"}`. 401 no credential, 402 the plan does not include this, 403 the seat does not, 404 the thing does not exist or is not yours to see.

Content type: `application/json`.

```json
{
  "error": "string"
}
```
