Coding agent documentation index Fetch the complete documentation index at: https://docs.worklittle.com/docs-agent-manifest.json Use this file to discover all available pages before exploring further.

Documents

HR documents and e-sign under /business/documents: templates, create from HTML, shares, PDF download.

Overview

/business/documents creates HR documents from a template or HTML, collects signatures, and returns the signed PDF.

curl -s -X POST "https://api.worklittle.com/business/documents" \
  -H "Authorization: Bearer $WORKLITTLE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Offer letter",
    "template_key": "offer_letter",
    "body_html": "<p>Hello {{employee_name}}</p>"
  }'

These routes are free of per-call API metering. Scopes still apply. To generate a resume PDF instead, see Create resumes.

Authentication

Send Authorization: Bearer sk-wl-api01-... or use a Worklittle Business session.

| Call | Scope |
| --- | --- |
| List templates, get or list documents, list shares, download PDF or .docx | `documents:read` |
| Create, update, delete, add or remove signers | `documents:read` on the key. The acting member's organization role must allow `documents:write`. |
| Upload, self-sign | `documents:write` |
| Submit a signature | None. Signed-in employees, or guests with a one-time `t` token. |

Templates and merge tags

curl -s "https://api.worklittle.com/business/documents/templates" \
  -H "Authorization: Bearer $WORKLITTLE_API_KEY"

Merge tags are resolved at sign time: {{company_name}}, {{company_logo}}, {{company_address}}, {{company_website}}, {{employee_name}}, {{employee_title}}, {{today_date}}, and the other company profile fields from your organization details.

Invite signers

PUT adds signers by employee id or email and can remove existing ones. Each new signer is emailed an invitation. Read the list back with GET, which returns { document, signatures }.

curl -s -X PUT "https://api.worklittle.com/business/documents/DOC_ID/shares" \
  -H "Authorization: Bearer $WORKLITTLE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"emails":["alex@example.com"],"employee_ids":["EMP_ID"],"message":"Please sign by Friday"}'
| Field | Type | Description |
| --- | --- | --- |
| `emails` | string[] | External signers. |
| `employee_ids` | string[] | Employees in your organization. |
| `remove_signature_ids` | string[] | Signature ids to remove. |
| `message` | string | Optional note included in the invitation. |

Create, list, and update

POST /business/documents returns 201 with { document }. title and body_html default to the template's when omitted, and an unknown template_key is a 400. PATCH /business/documents/:id accepts title, body_html, status (draft or published), and overlay_json. POST /business/documents/upload takes pdf_file as { "filename": "…", "content_base64": "…" } (PDF, up to 20 MB) and an optional title.

curl -s "https://api.worklittle.com/business/documents" \
  -H "Authorization: Bearer $WORKLITTLE_API_KEY"

The list returns every document in your organization as { documents }, most recently updated first.

Submit a signature

curl -s -X POST "https://api.worklittle.com/business/documents/signatures/SIG_ID" \
  -H "Authorization: Bearer $WORKLITTLE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"signature_png_base64":"iVBOR..."}'

Download the signed PDF with GET /business/documents/signatures/:id/download.

Routes

| Method | Path | Scope | Description |
| --- | --- | --- | --- |
| GET | `/business/documents/templates` | `documents:read` | Template catalog |
| GET | `/business/documents/templates/:key` | `documents:read` | One template |
| GET | `/business/documents` | `documents:read` | List organization documents |
| POST | `/business/documents` | `documents:read` plus role `documents:write` | Create from template or HTML |
| POST | `/business/documents/upload` | `documents:write` | Upload a file |
| GET, PATCH, DELETE | `/business/documents/:id` | `documents:read` | Detail, update, delete |
| GET, PUT | `/business/documents/:id/shares` | `documents:read` (PUT also needs role `documents:write`) | List signers, or add and remove them |
| POST | `/business/documents/:id/sign` | `documents:write` | Create your own signature row and return `signature_id`. Needs an employee profile with your email. Then submit the PNG as below. |
| GET | `/business/documents/:id/pdf` | `documents:read` | PDF with logo and side-by-side section headers |
| GET | `/business/documents/:id/download` | `documents:read` | .docx with side-by-side section layout. Uploaded PDFs return `400`. |
| GET, POST, DELETE | `/business/documents/signatures/:id` | varies | Signature copy, submit PNG, delete |
| GET | `/employees/:id/documents/employment_verification` | `jobs:applications` | Employment verification PDF, or `?format=docx`. Cannot be signed or deleted. |

SDK

import { createWorklittle } from "worklittle";

const wl = createWorklittle({ apiKey: process.env.WORKLITTLE_API_KEY });
const templates = await wl.documents.templates();
const docs = await wl.documents.list();
const created = await wl.documents.create({
  title: "Offer letter",
  template_key: "offer_letter",
});

Install and setup: SDK.