You need a Gavel API key to authenticate every request. See Creating an API key below.
Authentication
All API endpoints authenticate via theX-Api-Key request header. Pass your Gavel API key as the value of this header on every request.
https://yourdomain.gavel.io.
Creating an API key
1
Log in as a Builder or Admin
Sign in to your Gavel account with a Builder or Admin seat.
2
Open Settings > API Keys
In the left sidebar, click Settings, then select API Keys.
3
Create and copy the key
Enter a name for the key (for your reference only), click Create a Key, and immediately copy the value shown.
4
Use the key
Paste the key into the
X-Api-Key header of your API requests, or use it to connect the Word add-in or Zapier integration.Endpoints
1. Create a workflow session with pre-filled data
Use this endpoint to create a new session for a workflow and populate it with data from your system. When all variables are provided, the returnedcontinuation_url takes the user directly to the document download page. When some variables are missing, Gavel prompts the user only for the missing answers before generating documents.
string
required
The URL-encoded, case-sensitive name of the workflow. For example,
My%20Gavel%20Workflow.Request body
The body contains a singlevariables object. Keys are variable names; values are the data to pre-fill.
Variable type rules
Variable type rules
- Text / Number: Pass a plain string or number.
- Date: Use the format
"2024-05-30T"(ISO 8601 date with a trailingT). - Date Time: Use full ISO 8601 format, e.g.
"2021-05-01T23:02:02.098Z". - Multi Select: Pass an array of strings matching the exact option labels in your question. Strings that do not match an option are ignored.
- Repeating Items: Pass an array of objects, one per row. Each object’s keys are the attribute variable names for that repeating item. Optional repeating items with no rows can be set to
[]. - Nested Repeating Items: Gavel supports one level of nesting. Add the nested repeating item as a key inside each parent repeating item object, using the same array-of-objects format.
hsl_review_answers: Set totrueto skip the final “Please review your answers” page. Gavel recommends using the Skip the final review page workflow setting instead whenever possible.- Invisible Logic variables: You can post data into Invisible Logic variables by referencing them in single curly brackets inside your workflow, e.g.
{clientnumber}.
Example request
The example below shows a workflow named My Gavel Workflow with every supported variable type.Example response
string
A URL you can redirect the user to. If all variables were supplied, this lands on the document download page. If variables are missing, the user is prompted to fill in only the missing answers.
string
The unique identifier for the session. Use this to retrieve documents after the session is complete.
2. Retrieve document metadata from a session
After a workflow session is complete, use this endpoint to get metadata — name, format, type, and download URL — for every document associated with the session.string
required
The URL-encoded, case-sensitive name of the workflow.
string
required
The session ID returned by the Create Workflow Session endpoint.
Example response
array
An array of document objects for the session.
string
File format:
docx or pdf.string
The output file name.
string
The source template file name, or
uploadedFile[n] for user-uploaded files.string
Either
outputDocument (a generated document) or fileUpload (a file the user attached during the workflow).string
The URL to download this document binary. Pass this to the Download Document endpoint.
3. Download a document
Download the binary contents of a generated or uploaded document. In practice, you should use theurl field returned by the Retrieve Document Metadata endpoint rather than constructing this URL manually.
string
required
The internal workflow ID (appears in the metadata response URL).
string
required
The session ID associated with the document.
integer
required
An internal number associated with the specific document.
string
required
The file name of the document.
string
required
The file extension (e.g.
docx, pdf).4. List workflow names
Returns an array of all workflow names available on your account. Use these names to construct paths for the other endpoints.Example response
The names returned include the
.yml extension. Use the full string (e.g. Divorce Workflow.yml) as the pgtypes parameter in the List Workflow Variables endpoint.5. List workflow variables
Returns the variable schema for a specific workflow — including each variable’s name, data type, input type, label, and whether it is required. Use this to understand what data to pass when creating a session.string
required
The workflow name as returned by the List Workflow Names endpoint, including the
.yml extension. Example: Divorce Workflow.yml.Example response
This endpoint also powers the Gavel Word add-in. The response may include additional metadata for button and instruction block elements used in the add-in, which you can safely ignore when building integrations.

