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

Routes live under /business/documents. Create from a template or body_html, invite signers on /shares, download PDF when complete. These routes are free of per-call API metering (scopes still apply).

Authentication

| Call | Scope |
| --- | --- |
| List templates, list/create docs, shares, downloads | `documents:read` (writes also need `documents:write` where noted) |
| Upload, self-sign, update shares | `documents:write` |
| `GET /business/documents` | `employees:read` |

Bearer sk-wl-api01-... or an Worklittle Business session.

Examples

Templates

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

Create

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>"
  }'

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

Invite signers

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 '{"shares":[{"email":"alex@example.com"}]}'

List

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

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 org documents |
| POST | `/business/documents` | `documents:read` (+ write for create) | Create from template / HTML |
| POST | `/business/documents/upload` | `documents:write` | Upload a file |
| GET / PATCH / DELETE | `/business/documents/:id` | read / write | Detail, update, delete |
| GET / PUT | `/business/documents/:id/shares` | read / write | List or replace signers |
| GET | `/business/documents/:id/pdf` | `documents:read` | PDF download (formatted with logo and side-by-side section headers) |
| GET | `/platform/documents/:id/download` | `documents:read` | .docx download (formatted with side-by-side section layout) |
| GET | `/business/documents?employee_id=` | `employees:read` | Documents for one employee |
| GET | `/employees/:id/documents/employment_verification` | session | Generated employment verification PDF (also `?format=docx`). Not signable or deletable. |
| POST | `/business/documents/:id/sign` | `documents:write` | Author sign |
| GET / POST / DELETE | `/business/documents/signatures/:id` | varies | Signature copy, submit PNG, delete |

Resume PDF generation is separate: Create resumes.

Signatures

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..."}'

PDF: GET /business/documents/signatures/:id/download.

SDK

After building the monorepo client (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",
});