Use Sgileet from your own system to manage clients, create documents, and receive lifecycle events. API-key integrations are document-only; payment and payout actions stay in the Sgileet dashboard. The API works inside one Sgileet business; it is not a payment gateway, legal-advice service, or marketplace API.
Base URL: /api/v1. Create an API key from the Developers page, keep it on your server, and send it as a bearer token. The full machine-readable reference is available at OpenAPI JSON.
Authorization: Bearer sgl_...
Content-Type: application/json
Idempotency-Key: one-unique-key-per-writeUse an idempotency key for every retryable write. Repeating the same request with the same key returns the original result; reusing it for a different request returns an error.
Every request carries a bearer token: your API key, created from the Developers page. It starts with sgl_, works alongside your normal login (either can authenticate a request), and is shown to you exactly once at creation — store it like a password.
curl /api/v1/clients \
-H "Authorization: Bearer sgl_your_key_here"The endpoints are the same ones the app uses: POST /clients, POST /contracts, POST /invoices, plus their GET/PATCH counterparts. A minimal contract:
curl /api/v1/contracts \
-H "Authorization: Bearer sgl_your_key_here" \
-H "Content-Type: application/json" \
-d '{"clientId":"<uuid>","templateId":"<uuid>","value":"500000"}'A contract created this way still goes through Sgileet’s normal flow: it starts as a DRAFT, and you (or the business owner in the app) fill in placeholders and send it for signature the same way as any other contract.
source: API in Sgileet’s records, distinct from anything created in the app itself (source: APP). This is purely internal bookkeeping — it never changes what a document looks like to the client who signs it.An API key is for document automation, not payment processing. Your integration can create and update clients, contracts, and invoices, generate document outputs, and receive document webhooks.
API-key requests cannot add or change payout accounts, read the payments feed, record payments, send invoice payment links, send invoice reminders, create shareable payment links, or revoke payment links. Those actions require a normal signed-in Sgileet dashboard session.
Creating an invoice through the API does not collect money and does not give the client a checkout link. Your system can download or deliver the generated document through its own workflow. If the business wants Sgileet payment features, the owner must use the dashboard and complete payout onboarding there.
sgl_... key on your server, use the API for documents, and listen for document lifecycle webhooks.If your platform uses Sgileet on behalf of your own end-users — for example, creating an invoice for someone who has never heard of Sgileet — that person still becomes an ordinary Client record in the business’s Sgileet account, tagged with where they came from. If that same person later signs up for their own genuine Sgileet account, the tag is what lets Sgileet tell “a record my API created on someone’s behalf” apart from “a real account this person opened themselves”, so the two never collide.
Register a URL from the Developers page and Sgileet will POST a signed JSON payload to it whenever one of your subscribed events happens. Retries follow an increasing backoff (1m, 5m, 30m, 2h, 12h) if your endpoint doesn’t answer with a 2xx.
POST /your/endpoint
X-Sgileet-Event: contract.signed
X-Sgileet-Signature: sha256=<hex>
Content-Type: application/json
{"event":"contract.signed","data":{...},"timestamp":"2026-09-27T12:00:00.000Z"}Verify the signature with the secret shown once when you registered the webhook:
const expected = "sha256=" + crypto
.createHmac("sha256", YOUR_WEBHOOK_SECRET)
.update(rawRequestBody) // the exact bytes received, before JSON.parse
.digest("hex");
if (expected !== req.headers["x-sgileet-signature"]) return res.status(400).end();| EVENT | FIRES WHEN |
|---|---|
| contract.signed | The client signs. The PDF is not ready yet — wait for contract.completed if you need it. |
| contract.declined | The client declines to sign, with an optional reason. |
| contract.completed | The signed PDF has finished rendering and is ready to download. |
| invoice.paid | An invoice reaches its full amount, from any payment method. |
| payment.received | Any single payment succeeds against an invoice, even a partial one. |
| * | Every event above — useful during development, narrow it down before going live. |
Every contract or invoice you create costs one credit, whether it is made in the Sgileet app, through a public contract request or through the API. A new workspace gets 5 free credits when it signs up. After that, buy credits in packs of 100. Credits do not expire, and clients signing or paying never use one.
GET /credits or in Profile & Settings. With no credits left the API returns 402 insufficient_credits rather than silently queuing, so nothing is half-created.Every error is RFC 9457 problem+json: an HTTP status, a stable machine-readable code, and a human-readable detail. Match on code, not on the wording of detail, which can change.
{
"type": "urn:sgileet:problem:insufficient_credits",
"status": 402,
"code": "insufficient_credits",
"detail": "This workspace has no credits left. Buy a pack of 100 in Profile & Settings, under Credits, to create more documents."
}Requests are rate-limited. For 429 or retryable 503 responses, wait for Retry-After when present and retry with the same idempotency key.
Webhook destinations must be public HTTPS endpoints. Do not put API keys or webhook secrets in browser code or source control.