---
title: "Create a File"
method: POST
path: "/api/v1/files"
tags: ["Files"]
---

# Create a File

`POST /api/v1/files`

Permissions needed: ACCESS_PATIENTS
Upload a new file and attach it to a pet

## Response `201`

successful operation

- object
  - `data` object — A file that was uploaded to the system and that is linked to a pet. No more than 10MB in size. The file can be a photo, a document, a video, etc. A file can also be associated or not with a record.
    - `id` integer
    - `pet_id` integer
    - `clinic_id` integer
    - `file_id` integer, nullable — The id of the record that the uploaded file is associated to.
    - `name` string
    - `name_without_extension` string
    - `extension` string
    - `thumbnail` string
    - `updated_at` string, date-time
    - `download_url` string
    - `preview_url` string

## Other responses

- `400` — unresolved $ref
- `401` — unresolved $ref
- `403` — unresolved $ref
- `422` — This response is sent when a request fails validation. The format is identical on all endpoints.
- `429` — unresolved $ref

---

[API](https://skmtc.net/digitail/apis/digitail-api.md) · [All operations](https://skmtc.net/digitail/apis/digitail-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/digitail/digitail-api/revisions/bd9694db5fce/schema)
