---
title: "Create file"
method: POST
path: "/core/files"
tags: ["Files"]
---

# Create file

`POST /core/files`

## Request

- Base URL: `https://api.enterprise.sandbox.uphold.com`
- URL: `https://api.enterprise.sandbox.uphold.com/core/files`
- Auth: OAuth 2
  - Client credentials
  - Token URL: `/core/oauth2/token` scopes: `core.files:create`
- TypeScript: <https://skmtc.dev/uphold/apis/core-api/docs/core/files/post.ts> (a function with typed inputs; its response is checked against the schema)

Create a new file.

## Headers

- `X-On-Behalf-Of` string
- `X-Uphold-User-Ip` union
  - string, ipv4
  - string, ipv6
- `X-Uphold-User-Agent` string
- `X-Uphold-User-Origin` string
- `X-Uphold-User-Country` string
- `X-Uphold-User-Subdivision` string
- `X-Uphold-User-City` string

## Request body

- object
  - `category` 'document' | 'image' | 'video', required: The category of the file.
  - `contentType` string, required: The content type of the file.
  - `metadata` Metadata

## Response `201`

File created.

- object
  - `file` FileForUpload, required
    - `id` string, uuid, required: The id of the file.
    - `status` 'pending' | 'uploaded', required: The status of the file.
    - `category` string, required: The category of the file.
    - `contentType` string, required: The content type of the file.
    - `upload` object, required: The upload information of the file.
      - `url` string, uri, required: The pre-signed URL to upload the file to.
      - `formData` object, required: The form data to include when uploading the file.
      - `expiresAt` string, date-time, required: The date and time when the upload URL expires.
  - `errors` object: Additional contextual errors that occurred while processing the request.
    - `metadata` object: Error related to metadata processing.
      - `code` string, required: A short string with a brief explanation about the code reported.
      - `message` string, required: A human-readable message providing more details.
      - `details` object: Additional information about the feedback reported.

## Other responses

- `400`: Bad Request.
- `401`: Unauthorized.
- `403`: Forbidden.
- `409`: Business logic error.
- `429`: Too Many Requests.

---

[API](https://skmtc.dev/uphold/apis/core-api.md) - [All operations](https://skmtc.dev/uphold/apis/core-api/llms.txt) - [OpenAPI document](https://skmtc.dev/uphold/apis/core-api/revisions/6c663575c57a?raw)
