---
title: "Export an object to a file"
method: POST
path: "/api/v2/projects/{projectId}/objects/{objectId}/exports"
tags: ["Content"]
---

# Export an object to a file

`POST /api/v2/projects/{projectId}/objects/{objectId}/exports`

## Request

- Base URL: `https://davinci-app.com`
- URL: `https://davinci-app.com/api/v2/projects/{projectId}/objects/{objectId}/exports`
- Auth: HTTP bearer

Exports an object in one of the formats the editor's Export menu offers for
it, and saves the file to the project as a reference: a document as `pdf`
or `docx`, slides as `pptx` or `pdf`, a table as `xlsx`, a figure as `png`
or `svg`. The file is the one the Export menu produces, with the same
styles, page size, and headers and footers.

Download the bytes from `file.contentUrl`. PDF exports report `pageCount`,
so a caller can check that a document fits.

The export runs on the server, in the same exporters the editor uses,
whether or not anyone has the project open. The saved file is
uncommitted until the branch is committed.

## Query parameters

- `branch` string

## Request body

- ExportObjectRequest
  - `format` string, required: A format the Export menu offers for the object, such as `pdf`, `docx`, `pptx`, `xlsx`, `png`, `svg`, or `html`. Case-insensitive. Print PDF, which ends in the browser's print dialog, is not offered.
  - `displayType` string: View to export, for objects with more than one (for example `table` or `tree`). Defaults to the view the object opens in.
  - `dpi` integer: Resolution for raster content in PDF exports. Defaults to 300.
  - `parentId` string: Package to save the file in, such as the Library, `00000000-0000-0000-0000-00000library`. Defaults to the exported object's parent.

## Response `201`

The object was exported and the file saved to the project.

- ExportObjectResponse
  - `objectId` string, required
  - `format` string, required: The format exported, lower-case.
  - `file` object, required: The reference the export was saved as.
    - `id` string, required: Id of the new reference object.
    - `name` string, required
    - `mimeType` string, required
    - `size` integer, required: Size in bytes.
    - `contentUrl` string, required: API path that downloads the file's bytes.
  - `pageCount` integer, nullable, required: Number of pages, for PDF exports; null for other formats.

## Other responses

- `400`: The request body is malformed.
- `401`: No credential was supplied, or the supplied credential is malformed, expired, or revoked. A credential that is present but unusable is never downgraded to an anonymous request.
- `403`: Authenticated but not authorized. Either the acting user lacks the required resource permission, the key's scope ceiling excludes it, or the endpoint rejects this credential type (`CREDENTIAL_NOT_PERMITTED`).
- `404`: Project or object not found. Error code is `OBJECT_NOT_FOUND` when the project was readable but the object was not in it.
- `409`: The project stopped running between being opened for this request and the request reaching it. Error code is `PROJECT_NOT_RUNNING`. Retry: the next call opens it again.
- `422`: The export failed (`EXPORT_FAILED`), most often because the object does not offer the requested format; the message lists the formats it does offer.
- `429`: Request rate exceeded, either globally or for this key.
- `500`: Unexpected server error.
- `503`: The export could not run right now: the export service is unavailable (`EXPORT_UNAVAILABLE`), or the project could not save the file (`PROJECT_NOT_READY`). Retry after a moment.
- `504`: The browser did not finish the export in time (`EXPORT_TIMED_OUT`).

## Changes

- **2026-11-04** (v2) `279218ca2e8d`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/celedon-solutions/apis/davinci-public-api/changes/api/v2/projects/:projectId/objects/:objectId/exports/post.md)

---

[API](https://skmtc.dev/celedon-solutions/apis/davinci-public-api.md) - [All operations](https://skmtc.dev/celedon-solutions/apis/davinci-public-api/llms.txt) - [OpenAPI document](https://skmtc.dev/celedon-solutions/apis/davinci-public-api/revisions/279218ca2e8d?raw)
