> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vern.so/llms.txt
> Use this file to discover all available pages before exploring further.

# Write to an API

> Build a writer once, then push cleaned workbook data straight into your app's API.

A **writer** is a reusable connection that pushes cleaned rows into an external API. You point it at an API once, an agent figures out how to call it, and from then on you can export any workbook's data through it.

There's nothing to build on your side: instead of standing up an endpoint for Vern to send data to, you let Vern call your existing API directly.

You'll find writers under **Writers** in the sidebar. You can also ask [Home](https://docs.vern.so/help-center/home/overview.md) to build one for you. Building, editing and running writers is **Admin-only** — see [Team](https://docs.vern.so/help-center/settings/team.md).

## Build a writer

**1. Point it at an API**

Click **New writer**. Under **Search for the API**, tell Vern where the API is and press **Enter**. Any of these work:

* An **OpenAPI / Swagger URL** (the spec itself).
* A **docs URL** for the API.
* Just the **API name** — type `Stripe payments` and the agent finds the spec for you.

Add more queries if the API is spread across several specs. Or choose **Or upload an OpenAPI / Swagger file**.

**2. Pick the templates it covers**

Choose which of your templates this writer knows how to write, then click **Build writer**. Each template becomes one mapping — a sheet of that type can be written through this writer.

**3. Let the agent build it**

Vern opens the writer on its **Build** tab and the agent gets to work. For each template it:

* discovers the API's **write endpoints** (POST / PUT / PATCH) and picks the best one,
* maps your template columns onto the endpoint's request body,
* writes the payload code, and
* runs a **dry run** to confirm the payload validates against the schema.

A template with no suitable endpoint is marked **unmatched** — you can prompt the agent to revisit it or leave it out. You can chat with the agent at any time to correct a mapping (for example, *"nest address under contact"* or *"send phone as E.164"*), and you can **stop** it mid-build.

**4. Add credentials**

Open the **Auth** tab. Vern shows the auth schemes it read from the spec and asks only for what they need. Fill in your **Base URL** and credentials:

* **API key** — sent in a header or query parameter.
* **Bearer token**.
* **Basic auth** — username and password.
* **OAuth 2.0 client credentials** — client ID, client secret and token URL; Vern fetches tokens itself.

Secrets are stored write-only in a secret vault — you can replace or remove them but never read them back. OAuth flows that need someone to sign in interactively (authorization code, implicit, OpenID Connect) aren't supported; use an API key, a token or client credentials instead.

## The writer's anatomy

A writer has two top-level tabs: **Build**, where you chat with the agent, and **Test**, which opens once the agent has found a spec. Under **Test** you'll find:

* **Run** — a live test against sample rows (below).
* **Script** — the code the executor runs for each row. The agent authors this; you rarely need to touch it.
* **Auth** — the base URL and credentials (above).
* **Templates** — the per-template endpoint pairings the agent chose, and any left unmatched.
* **Constants** — writer-level values reused on every write (for example a fixed `board_id` or `account_id`). Edit these inline.

## Test before you commit

Open **Test → Run** and run the writer live against a handful of sample rows. You'll see the real requests and responses.

If something's off, click **Send to agent to fix** (or **Send results to agent** when the run was clean) to hand the results back to the build agent — it reads the actual API errors and fixes the mapping or payload, then you test again. Repeat until the test run is clean.

> [!TIP]
>
> Point the Base URL at a sandbox environment while you test, then switch it to production once the writer is solid.

## Write a workbook through it

Once a writer tests clean, you use it from a workbook:

**1. Open Export**

Click **Export** in the workbook header and choose the **Writer** tab.

**2. Pick the writer**

Select your writer. Vern prefills its base URL and credentials for this run — edits here are temporary and aren't saved back to the writer.

**3. Check the mapping**

Vern auto-maps each sheet in the workbook to one of the writer's templates. Any sheet the writer has no mapping for is flagged so you don't silently skip it.

**4. Export**

Click **Write to API**. Vern writes the rows to your API and streams progress live, grouping any failures so you can see exactly which rows the API rejected and why.

## Writer or CSV

Not sure which export path fits? [Export a workbook](https://docs.vern.so/help-center/send/export-a-workbook.md) lays out CSV and writer side by side.

## Next

* [Export a workbook](https://docs.vern.so/help-center/send/export-a-workbook.md) — the full export dialog, including CSV.
* [Home](https://docs.vern.so/help-center/home/overview.md) — ask the agent to build or fix a writer for you.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.