Docs

Import file to doc

Changed on

Create a new doc by importing 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).

Supported file types include documents (PDF, DOCX), audio files (MP3, WAV, M4A), and video files (MP4, MOV).

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

The doc can be placed inside a project (via project_id) or a folder (via folder_id), but not both.

mime_type is only used when importing from url; it is ignored when importing by file_id (the file already carries its own metadata).

Returns the newly created doc 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

The URL must use HTTPS and resolve to a public address; Dovetail rejects URLs that point to private, loopback, or link-local addresses. Only 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.

📘 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.

Required scope: doc:file_import

post/v1/docs/import/file

Request

  • Base URL
    https://dovetail.com/api
  • URL
    https://dovetail.com/api/v1/docs/import/file
  • Auth
    HTTP bearer

Request body

mime_typestring

The nature and format of the file you want to import. Only used when importing from url.

project_idstring nullable

Unique identifier of the project that the doc is associated with. Cannot be used together with folder_id.

folder_idstring nullable

Unique identifier of the folder to place the doc in. Cannot be used together with project_id.

author_idstring

Unique identifier of the user to set as the author. Only workspace admins can use this field. If omitted, defaults to the authenticated user. Can only be set at creation time. The author is also recorded as a contributor, alongside the authenticated user. When an admin sets this field, the author change is recorded in workspace audit logs with the API user as the actor, so overrides remain traceable.

titlestring required

The doc's title.

urlstring uri

Publicly accessible HTTPS url of the file that you want to import. Provide exactly one of url or file_id.

file_idstring

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.

cover_image_file_idstring nullable

Unique identifier of a file to use as the doc's cover image.

Example request

{
  "title": "My doc"
}

Response

201

Changes

    • breaking

      added subschema #1 subschema #2 to the / response property oneOf list for the response status

    • breaking

      the / response's property type changed from object to no type for status

    • breaking

      removed the required property // from the response with the status

    • breaking

      removed the required property // from the response with the status

    • warning

      removed the optional property // from the response with the status

    • info

      added the new optional request property

    • info

      the request property became optional