canonical: https://jentic.com/apis/docassemble.org/docassemble

# Docassemble API

Docassemble is an open-source platform for guided interviews that assemble legal documents and intake forms. Its API exposes 25 endpoints for starting and stepping through interview sessions, managing users, files, packages, the playground and server configuration. Authenticated via the X-API-Key header, it lets external apps embed legal-tech intake flows, automate document generation pipelines, and synchronise users with a host docassemble server.

## For AI agents

Drive guided interviews and document assembly on a docassemble server, manage users and files, and automate intake-to-document pipelines.

## Scope

Does not handle e-signature, court e-filing, payment processing, or general-purpose word-processor editing - use for guided interview and document assembly only.

## Capabilities

- Start a new interview session from a YAML interview file
- Step through interview questions, posting answers to advance the session
- Go back to a previous interview screen or trigger a defined action
- Upload and download files attached to an interview session
- List and create users on the docassemble server
- Pull and update server configuration and packages
- Use the playground endpoints for development workflows

## Use cases

### Embedded Legal Intake

A legal aid organisation can embed a docassemble interview into its website and step the user through it via the API rather than redirecting to the docassemble UI. POST /api/session/new starts the interview, GET /api/session/question reads the next question, and POST /api/session submits answers. The result is a branded intake flow that still benefits from the underlying interview logic.

Example prompt: POST /api/session/new with the interview filename, then loop calling /api/session/question and POST /api/session until completion.

### Document Assembly Pipeline

Use the API to script document generation in batch - for example, generating tenant notices, immigration forms or contracts from CSV input. A worker process starts a session per row, posts the answers, and retrieves the assembled PDF from /api/file/{file_number}. Cuts manual drafting time on repetitive document workflows.

Example prompt: For each row in a CSV, start a new session, post answers, then call /api/file/{file_number} to download the resulting PDF and save it under the row id.

### User and Server Administration

Operations teams running a multi-tenant docassemble server can automate user provisioning, package updates and configuration changes via the API. Endpoints under /api/user, /api/user_list and the configuration routes let an admin script bulk-add users from an HR feed or roll a new package version across instances.

Example prompt: Iterate the HR export and POST /api/user/new for each new hire, then GET /api/user_list to verify the count matches.

### AI Agent Legal Tech Assistant

Through Jentic, an AI assistant can guide a user through a docassemble interview by translating natural-language replies into the structured answers the API expects. The agent searches Jentic for the interview intent, loads the session operations, and posts answers back. This combines docassemble's structured legal logic with conversational UX.

Example prompt: Use Jentic to search 'docassemble session question', load /api/session/question, and execute it after each user reply, posting answers back to /api/session.

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | /api/session/new | Start a new interview session |
| GET | /api/session/question | Get the current question for a session |
| POST | /api/session | Submit answers to advance the session |
| POST | /api/session/back | Go back to the previous question |
| POST | /api/session/action | Trigger a defined interview action |
| GET | /api/interviews | List interviews on the server |
| GET | /api/file/{file_number} | Download an assembled file |
| POST | /api/user/new | Create a new user on the server |

## Key resources

- **Sessions** — Start, step, navigate and end interview sessions
- **Interviews** — List interviews available on the server
- **Users** — Create, list and update server users
- **Files** — Upload and download files associated with a session
- **Playground** — Development workflows for interview authors
- **Configuration** — Server configuration and package management

## Why Jentic

- **Setup:** Wiring Docassemble by hand means carrying its X-API-Key header, pointing at your own server host, and stepping through session state yourself. Through Jentic you install once, import the Docassemble API from the API Directory, store the key once, and your agent calls it.
- **Permission scoping:** Docassemble drives interviews through session operations, so scope your agent to the operations it needs, such as starting a new session or submitting answers. You choose the operations it may call, so creating a user is not included unless you add it.
- **Credential handling:** Your Docassemble X-API-Key is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'start a docassemble interview' or 'submit interview answers', and Jentic returns the matching Docassemble operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **Open edX LMS API** — Open-source education platform - pairs with docassemble for legal-education interview content
- **Concord** — Commercial contract lifecycle management platform - alternative when teams need e-signature and post-execution tracking on assembled documents
- **GitHub REST API** — Manage docassemble interviews stored as GitHub repositories.
- **Twilio API** — Trigger SMS reminders from a docassemble interview workflow.

## FAQ

### What authentication does the Docassemble API use?

Docassemble uses an API key in the X-API-Key header. Keys are issued per user on the host docassemble server. When called through Jentic, the key lives in your Jentic One instance and the agent receives only a scoped reference.

### Can I drive an entire interview through the Docassemble API?

Yes. Start the session with POST /api/session/new, then loop calling GET /api/session/question to read the next prompt and POST /api/session with the answers. /api/session/back and /api/session/action handle navigation and custom triggers.

### What are the rate limits for the Docassemble API?

Docassemble is typically self-hosted, so rate limits are governed by the host server's resources rather than a vendor quota. Treat heavy batch jobs carefully and watch CPU on the docassemble worker nodes.

### How do I retrieve an assembled document with the Docassemble API through Jentic?

After completing an interview, call GET /api/file/{file_number} to download the assembled PDF or DOCX. Through Jentic, search 'docassemble download file', load the operation and execute it with the file number returned by the session.

### Can I create users on a Docassemble server with the API?

Yes. POST /api/user/new creates a new user account on the server, and GET /api/user_list returns the current roster, which makes it straightforward to sync users from an HR or directory system.

### Is the Docassemble API free?

Docassemble itself is open source and free to self-host, so API access has no vendor cost. Your only costs are the server hosting and any commercial extensions you install on top.

### Can I limit what my agent is allowed to do with the Docassemble API?

Yes. Because Jentic One is self-hosted, you decide which Docassemble operations your agent may call and which credentials it may use, so you can grant only session operations such as starting an interview with POST /api/session/new and submitting answers with POST /api/session. Higher-impact operations like creating a user with POST /api/user/new stay off limits unless you explicitly add them to the agent's scope. Your X-API-Key is stored by your own Jentic One instance and injected at execution, so the agent works within the exact set of operations you allow.
