Loading FlowZen
Getting your workspace ready...
Getting your workspace ready...
Manage document requests, document categories, and letter requests.
/api/documents/myGet current user's document requests.
/api/hr/document-categoriesGet all document categories for the company.
/api/hr/document-categoriesUpdate document categories (HR only).
| Field | Type | Required | Description |
|---|---|---|---|
categories | string[] | Required | Array of category names |
/api/hr/document-letterGet all letter requests for the company.
HR and admins see every letter in the company. Anyone else sees the letters they requested plus any letter they are listed on in signatories[] — a nominated co-approver has to be able to open the letter in order to sign it, even though they did not request it. Nobody else can see it.
Pass ?plan=1 to preview the approver plan that would be assigned to the current requester: { region, primary: { id, name, role } | null, teamOwner: { user, slot, name, role } | null, teamOwnerBlockedReason, maxCoApprovers }. This is what powers the one-click “add my team owner” suggestion — the server never adds anyone automatically.
teamOwnerBlockedReason is "out-of-region" when the requester has a team owner who cannot be nominated because they are outside the requester's region. The team owner is then omitted from teamOwner and the modal shows the suggestion disabled with a reason, instead of a button that would be silently dropped. It is "" whenever a teamOwner is returned.
/api/hr/document-letterCreate a new letter request (experience, salary, etc.).
The approving HR is required and is the only gate — the letter is issued as soon as they approve. The primary is never the requester: the order is another in-region HR, an in-region admin, any company HR, then any company admin. An explicit approverId is rejected with 400 unless it is an HR in the requester's region (a senior security user is also accepted for junior-security requesters).
Co-approvers are optional, manual, and never block. Nothing is added for you: the requester picks up to 3 co-approvers via coApproverIds, all region-scoped, and the modal also offers their team owner as a one-click suggestion (teamOwnerId) that counts toward the same cap of 3. The team owner is skipped when the requester manages that team themselves, and is only accepted when it really is their team owner. If their team owner sits in another region the modal shows the suggestion greyed out with the reason instead of adding them. They are notified as soon as the letter is requested and can sign or decline straight away — before HR approves it on /letter/[id]?draft=1, or after on /letter/[id]; a signature given early is carried onto the letter when it is issued. Their silence or a decline never delays, blocks or reverts the letter. Eligible co-approver roles are human-resource, finance, admin, project-manager, qa-tester and it-admin. The primary approver, the requester and duplicates are dropped automatically. When your own region is the main office, a co-approver who has no region set on their profile counts as being in it, which matches the region shown on their profile.
Signatures are recorded with PATCH /api/approvals/[id] and a sign boolean — see Approvals. Re-submitting the same letter type while one is pending reuses that request and keeps signatures already collected: a row still in the new plan and already signed or declined keeps its status and timestamp. Only genuinely new nominees start as pending.
| Field | Type | Required | Description |
|---|---|---|---|
requester | string | Required | User ID requesting the letter |
letterType | string | Required | Type of letter (experience/salary) |
approverId | string | Optional | Explicit primary approver. Must be human-resource in the requester's region (a senior security user is also accepted for junior-security requesters), otherwise 400 |
coApproverIds | string[] | Optional | Up to 3 advisory co-approvers, in the requester's region, in the order picked. A lone string or a single coApproverId value is also accepted |
teamOwnerId | string | Optional | The requester's team owner, from the one-click suggestion. Ignored unless it really is their team owner, and ignored when they are out of region |
/api/hr/document-letter/[id]Update letter request status (approve/reject).
/api/approvals/[id]Record an advisory co-signature on a document letter you were nominated on.
| Field | Type | Required | Description |
|---|---|---|---|
sign | boolean | Required | true signs, false declines to sign |
This takes an early return before any status transition, so a co-approver can never approve, reject or otherwise advance a request. It is only valid for document letters, and the caller must hold a pending signatories row on the request — otherwise 403. Signing is open while the letter is pending, hr-approved or approved; any other status is 409, because a rejected letter will never be issued. Letters awaiting your signature are listed in your own inbox via GET /api/approvals — see Approvals.
/api/profile/id-card/requestRequest a new ID card. The approver is region-scoped exactly like a document letter.
Eligible approver roles are human-resource, finance, admin, project-manager, qa-tester and it-admin. A junior security requester may also assign to a senior security member. An out-of-region pick is rejected with 400 — but only when the requester's region actually has an eligible approver, otherwise nobody there could submit a request at all.
/api/documents/verify-bankVerify bank details for a document.