---
title: "Export workbook as an .xlsx file"
method: POST
path: "/v1/workbooks/{id}/export"
tags: ["workbooks"]
---

# Export workbook as an .xlsx file

`POST /v1/workbooks/{id}/export`

Export a workbook as an .xlsx file. Cells can be updated before the
workbook is exported.

## Path parameters

- `id` string, required

## Request body

- ExportRequest — Request body for exporting a workbook as an .xlsx file. Cells can be updated before reading the workbook, and a goal seek function can be used to calculate the required input value for a formula to achieve a specified target result.
  - `apply` DataTransformation[], nullable — Cells to update before exporting.
    - `target` union, required — Reference for the cell to write to
      - string — A1-style string reference with optional sheet prefix
      - ReferenceObject — A reference to a range of spreadsheet cells.
        - `cells` string, required — Unprefixed A1-style range, id, or name
        - `sheet` string, nullable, required — Name of the sheet to reference
    - `value` union, required — Value to write to the target cell
      - integer
      - number
      - string
      - boolean
  - `goalSeek` QueryRequestGoalSeek — Goal seek. Use this to calculate the required input value for a formula to achieve a specified target result. This is particularly useful when the desired outcome is known, but the corresponding input is not.
    - `targetCell` union, required — Reference for the cell that contains the formula you want to resolve
      - string — A1-style string reference with optional sheet prefix
      - ReferenceObject — A reference to a range of spreadsheet cells.
        - `cells` string, required — Unprefixed A1-style range, id, or name
        - `sheet` string, nullable, required — Name of the sheet to reference
    - `targetValue` union, required — The value you want the formula to return
      - integer
      - number
    - `controlCell` union, required — Reference for the cell that will contain the solution
      - string — A1-style string reference with optional sheet prefix
      - ReferenceObject — A reference to a range of spreadsheet cells.
        - `cells` string, required — Unprefixed A1-style range, id, or name
        - `sheet` string, nullable, required — Name of the sheet to reference

## Response `200`

Workbook exported as an .xlsx file

## Other responses

- `400` — Error returned when you make a bad request
- `403` — Error returned when you don't have permission to query a workbook
- `429` — Error returned when you exceed your API rate limit

## Changes

- **2025-04-11** `81154a75608f` — 3 breaking, 3 info
  - the `apply/anyOf[subschema #1]/items/target` request property type/format changed from `string`/`` to ``/``
  - the `goalSeek/anyOf[subschema #1: QueryRequestGoalSeek]/controlCell` request property type/format changed from `string`/`` to ``/``
  - the `goalSeek/anyOf[subschema #1: QueryRequestGoalSeek]/targetCell` request property type/format changed from `string`/`` to ``/``
  - added `#/components/schemas/ReferenceObject, subschema #1` to the `apply/anyOf[subschema #1]/items/target` request property `anyOf` list
  - …2 more
- **2025-03-27** `f9fd5fb43d56` — 2 info
  - the endpoint scheme security `apiKey` was added to the API
  - the endpoint scheme security `HTTPBearer` was removed from the API
- **2025-02-20** `4f7e4249cd44` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/grid-is/apis/grid-api/changes/v1/workbooks/:id/export/post.md)

---

[API](https://skmtc.dev/grid-is/apis/grid-api.md) · [All operations](https://skmtc.dev/grid-is/apis/grid-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/grid-is/grid-api/revisions/2f55490ab23d/schema)
