---
title: "Create document"
method: POST
path: "/v1/applications/{applicationId}/documents"
tags: ["Documents"]
---

# Create document

`POST /v1/applications/{applicationId}/documents`

## Request

- Base URL: `https://api.apply.akahu.nz`
- URL: `https://api.apply.akahu.nz/v1/applications/{applicationId}/documents`
- Auth: HTTP bearer

This endpoint creates a new document record in a `pending` state.
Each document represents a single file, which needs to be uploaded shortly after document creation.

If the document file is not uploaded before the `expires_at` timestamp included in the response, the record will be automatically deleted.

The document file can be uploaded by making a `PUT` request to the `upload_url` provided in the response.
Document uploads must meet the following criteria:

 - Files have a maximum size of 50MB

 - Files must have a `content-type` of 'application/pdf'

## Path parameters

- `applicationId` string, required

## Request body

- object
  - `name` string, required: The filename of this document.

## Response `200`

Success

- object
  - `_id` string, required
  - `expires_at` string, date-time, required
  - `upload_url` string, uri, required

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not Found
- `429`: Too Many Requests
- `500`: Internal Server Error

---

[API](https://skmtc.dev/akahu/apis/akahu-apply-api.md) - [All operations](https://skmtc.dev/akahu/apis/akahu-apply-api/llms.txt) - [OpenAPI document](https://skmtc.dev/akahu/apis/akahu-apply-api/revisions/3f18eb1ead75?raw)
