API reference

One versioned contract. The same rules as the console.

If a person can do it in the product, an API user with the right scopes can do it over HTTPS. Bytes still travel through Casewelt. Errors still distinguish “badly formed”, “policy said no”, and “that state has already ended”. This page is the map. The pages beside it are the walks.

How to call it

HTTPS and JSON. File bytes on the transfer paths. A short code when it fails, so you know whether to fix the body, ask a person, or stop retrying.

Use this
HostThe organisation host you were issued. Or the API host plus X-Casewelt-Organisation-Id when the token already names the organisation.
VersionAll organisation paths sit under /v1.
AuthAuthorization: Bearer from client credentials. A human cookie session cannot mint this token.
JSONContent-Type: application/json, except when you PUT raw file bytes.
IdempotencyIdempotency-Key on creates you might retry. Remembered for a day. Same key, different body → conflict.
CorrelationX-Request-Id if you have one. Casewelt mints one if you do not, and returns it on the problem document as correlation_id.
Errorsapplication/problem+json with HTTP status plus a short code.
BytesNever a storage address. Transfer mode casewelt_transfer means Casewelt streams the object.
RecipientsShare, sign, and inbound upload use the public doors. Your Bearer token is not their login.

A first job

Put a pack in a folder, share version 1 with counsel, hear when they open it. Recipients still use the public doors.

01

Mint, then check

POST /v1/oauth/token, then GET /v1/session/me. Confirm organisation and scopes before you write.

02

Put the file

Open an upload session, PUT the bytes, complete. You get file_id and version_id. Files →

03

Create the share

Bind it to that version. Keep the OTP out of band if the mailbox is shared. Sharing →

04

Listen, then end it

Register a webhook. Deduplicate on event id. Revoke when the fortnight ends. A later open is denied and still arrives. Events →

If create-share is refused, read code. policy_denied — stop and tell a person. A timeout — send the same Idempotency-Key again.

Areas of the API

Who is calling

Mint a token with client credentials. Read /v1/session/me to see the organisation and scopes. Humans cannot exchange their session into this token.

Files and transfer

List workspaces and folders, open an upload session, put bytes, complete, download a named version, create a blank document, search.

Sharing and signatures

Create and revoke external shares, list internal shares, send a signature envelope. Organisation download limits apply when you omit them.

Events out

Register a URL, verify the signature, ignore duplicates, expect retries for seventy-two hours. Administrators can replay a missed delivery.

The rest of the tenant

People, roles, holds, mail, storage flags, branding, domain, usage — the organisation console, as HTTP.

Audit and evidence

Search events, pin an investigation, export a sealed package. Not a screenshot of the console.

Opening a customer

A different credential creates organisations. It cannot then read their files.

Scopes

Scope is checked first. Resource permission is still checked. A files token cannot open a workspace it was never granted.

ScopeWhat it is for
organisationThe whole tenant account: people, roles, billing, storage, mail, domain, security, secrets reveal, and every product path. Not Casewelt’s own operator API.
files / workspacesFolders, files, upload, documents, calendar, activity, notifications, file requests.
sharesExternal shares and internal shares.
signaturesSignature envelopes.
officeBrowser editing sessions.
webhooksEvent destinations.
usageRead metres: storage, signatures, credits.
aiAssistance. Credits must remain.
integrationsConnectors. Reads never return live secrets.
auditEvents, investigations, evidence packages.
reportsUsage dashboards and exports.

If you omit scopes when minting an API user, Casewelt defaults to files, shares, signatures and office — enough for a product bot, not enough to change billing.

Problem codes you will actually branch on

HTTPCodeWhat you should do
403denyThis principal may not do this to this object. Do not retry the same call.
403policy_deniedA rule refused it. The session is still valid. Tell a person, or pick another file.
4xxquota_exceeded / actor_quota_exceededStop putting bytes. Ask an administrator for headroom.
401invalid_clientRotate or re-issue the API user. Do not log the secret.
403human_api_forbiddenA person tried to become automation. Use the portal, or mint a real API user.
409conflict (idempotency)Same key, different body. Pick a new key or send the original body.

Boundaries

Field-level detail for a live tenant is in the organisation console’s Partner API reference. This map covers the organisation contract. Channel credentials that create tenants are refused here. Bytes move through Casewelt transfer.

Read it against a tenant

Mint a scoped client. Watch a policy refusal.

Bring the system that creates folders, listens for opens, or sends envelopes. We will read the problem document with you.

Discuss an integration