---
title: "Import file to data"
method: POST
path: "/v1/data/import/file"
tags: ["Data"]
---

# Import file to data

`POST /v1/data/import/file`

Create a new data entry from a file. Provide the file in **exactly one** of two ways:

- `url` — a publicly accessible URL that Dovetail downloads and imports, or
- `file_id` — the id of a file you have already uploaded via the file upload API (the upload must be complete).

The data entry must be associated with a project via `project_id`. Supported file types include documents (PDF, DOCX), audio files (MP3, WAV, M4A), and video files (MP4, MOV).

If the file is audio or video, Dovetail will automatically queue it for transcription. The resulting transcript will be added to the data body once processing completes.

When importing from `url`, optionally set `created_at` to backdate the entry and `author_id` to attribute it to a specific user. These, along with `mime_type`, are ignored when importing by `file_id` (the file already carries its own metadata).

Returns the newly created data object (without content).

> 🚧 Permissions
>
> Please check you have the relevant permissions required to access this resource. This may include specific permissions on the object itself or its parent, or having the correct user role if you're making updates.


> 🚧 Supported URLs
>
> Only publicly accessible URLs that link directly to a downloadable file are supported. If the URL does not include a file extension, you must provide the `mime_type` parameter so Dovetail can determine how to process the file.

> 🚧 Fields
>
> Only existing and unique fields can be referenced. This endpoint will not create new fields, or attempt to differentiate between duplicate field labels.

> 📘 Transcription notifications
>
> When a transcription completes or fails, the account linked to the API token will receive a notification. You can manage notification preferences in [notification settings](https://dovetail.com/settings/user/notifications).

## Request body

- object
  - `fields` object[] — The data's fields.
    - `label` string, required — The field's label (name). Must match an existing field label when updating, or will create a new field when creating.
    - `value` union, required — The field's value. Type depends on the field type: string for TEXT/EMAIL/URL/PHONE, boolean for BOOLEAN, number for NUMBER/NPS, string (ISO 8601) for DATETIME, string array for SELECT, or string (contact name) for PERSON. Null to clear the value.
      - string
      - boolean
      - number
      - string[]
    - `type` 'BOOLEAN' | 'DATETIME' | 'EMAIL' | 'NPS' | 'NUMBER' | 'PERSON' | 'PHONE' | 'SELECT' | 'TEXT' | 'URL' — Include the desired type when creating a new field. If omitted or left empty, the field type defaults to TEXT. Do not include this property when referencing an existing field.
  - `mime_type` string — The nature and format of the file you want to import. Only used when importing from `url`.
  - `project_id` string, required — Unique identifier of the project that the data is associated with.
  - `title` string, required — The data's title.
  - `url` string, uri — Public url to the file that you want to import. Provide exactly one of `url` or `file_id`.
  - `file_id` string — Unique identifier of a file already uploaded via the file upload API. The upload must be complete. Provide exactly one of `url` or `file_id`.
  - `created_at` string — The creation date and time to associate with the file, in ISO 8601 format. Only used when importing from `url`.
  - `author_id` string — Unique identifier of the Dovetail user that the file is associated with. Only used when importing from `url`.

## Response `201`

201

- object
  - `data` object, required
    - `id` string, required
    - `url` string — The URL of this resource in the Dovetail web app. This field is experimental and may change without notice.
    - `type` 'data', required
    - `title` string, required
    - `project` object, required
      - `id` string, required
      - `title` string, required
    - `fields` object[], required
      - `label` string, required — The field's label (name). Must match an existing field label when updating, or will create a new field when creating.
      - `value` union, required — The field's value. Type depends on the field type: string for TEXT/EMAIL/URL/PHONE, boolean for BOOLEAN, number for NUMBER/NPS, string (ISO 8601) for DATETIME, string array for SELECT, or string (contact name) for PERSON. Null to clear the value.
        - string
        - boolean
        - number
        - string[]
      - `type` 'BOOLEAN' | 'DATETIME' | 'EMAIL' | 'NPS' | 'NUMBER' | 'PERSON' | 'PHONE' | 'SELECT' | 'TEXT' | 'URL' — Include the desired type when creating a new field. If omitted or left empty, the field type defaults to TEXT. Do not include this property when referencing an existing field.
    - `files` object[], required
      - `id` string, required — Unique identifier of the file.
      - `name` string, required — The file's original name.
      - `type` string, nullable, required — The file's MIME type (e.g. 'image/png', 'video/mp4'). Null if unknown.
      - `size` number, nullable, required — Size of the file in bytes. Null if unknown.
      - `status` 'completed' | 'pending' | 'failed', required — Processing status of the file. 'pending' while being processed, 'completed' when ready, or 'failed' if processing encountered an error.
      - `author` union, required — The user who uploaded the file, or null if the author is unknown.
        - object
          - `id` string, required
          - `name` string
        - string, null, nullable
      - `created_at` union, required — ISO 8601 timestamp when the file was created.
        - string
        - string, null, nullable
      - `url` string, nullable, required — Permanent URL pointing at the **Download a file** endpoint. Safe to cache and store — the URL itself never expires, but calling it requires the same authentication as other API endpoints and returns a short-lived presigned URL each time. The endpoint performs its own readiness and access checks.
    - `created_at` string, required
    - `deleted` boolean, required
    - `folder` object, nullable, required
      - `id` string, required

## Other responses

- `400` — 400
- `401` — 401
- `403` — 403
- `404` — 404
- `422` — 422
- `429` — 429
- `500` — 500

---

[API](https://skmtc.net/dovetail/apis/dovetail-public-api.md) · [All operations](https://skmtc.net/dovetail/apis/dovetail-public-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/dovetail/dovetail-public-api/versions/4107f5fdf8b2/schema)
