---
title: "Create datafile"
method: POST
path: "/v1/applications/{applicationId}/datafiles"
tags: ["Datafiles"]
---

# Create datafile

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

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

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

The datafile can be uploaded by making a `PUT` request to the `upload_url` provided in the response.
Datafile have a maximum size of 200MB.

## Path parameters

- `applicationId` string, required

## Request body

- object
  - `name` string, required — The filename of this datafile.
  - `schema` string, required — The name of the schema for this datafile.
  - `content_type` 'application/json', required — The content type of the datafile.

## 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-enduring-api.md) · [All operations](https://skmtc.dev/akahu/apis/akahu-enduring-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/akahu/akahu-enduring-api/revisions/b2de9915920d/schema)
