{"info":{"version":"v1","description":"Generated from the digid API group registry. A group not enabled for the organization, or not allowed on the API key, answers 403 api_group_disabled.","title":"digid API"},"components":{"securitySchemes":{"bearer":{"scheme":"bearer","type":"http","description":"sid_sk_ (API key) or sid_ust_ (staff session token)."}}},"paths":{"/org/invitations/{id}/revoke":{"post":{"description":"Cancels a pending invitation so its link stops working. Owners and admins only. Errors: 404 not_found, 422 invitation_not_pending.","parameters":[{"in":"path","name":"id","description":"Invitation id.","required":true,"schema":{"type":"string"}}],"summary":"Revoke an invitation","tags":["Team & approvals"],"security":[{"bearer":[]}],"operationId":"post_org_invitations_id_revoke","responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"branch_id":"9d2a6b1c-3e4f-4a5b-9c8d-7e6f5a4b3c2d","branch_role":"viewer","email":null,"expires_at":"2026-10-31T07:00:00Z","id":"f1a27d8e-9f0a-4b1c-8d2e-3f4a5b6c7d8e","inserted_at":"2026-10-24T07:00:00Z","organization_id":"0b7e4c1a-2d3f-4e5a-8b9c-1d2e3f4a5b6c","phone":"+255712000002","role":"member","status":"canceled","updated_at":"2026-10-24T09:00:00Z"}}}}},"403":{"description":"Forbidden, including api_group_disabled."}}}},"/approval-requests":{"get":{"description":"Pending maker-checker requests in the caller's scope, newest first, not paged; can_check says whether the caller may decide each one. Branch managers (and owners and admins) may read the queue; branch_manager API keys too.","parameters":[],"summary":"List pending approval requests","tags":["Team & approvals"],"security":[{"bearer":[]}],"operationId":"get_approval_requests","responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":[{"action_code":"branch.member.add","amount":null,"approval_mode":"standard","approved_count":0,"branch":{"id":"9d2a6b1c-3e4f-4a5b-9c8d-7e6f5a4b3c2d","name":"Central branch"},"can_check":true,"changes_requested":null,"created_at":"2026-10-24T07:42:10Z","decisions":[],"entity_id":"9d2a6b1c-3e4f-4a5b-9c8d-7e6f5a4b3c2d","entity_label":"Central branch","entity_type":"branch","id":"55c49f0a-1b2c-4d3e-8f4a-5b6c7d8e9f0a","maker":{"id":"6f1c2a3b-4d5e-4f6a-8b7c-9d0e1f2a3b4c","name":"Asha Mwakyusa"},"object":"approval_request","payload":{"role":"viewer","user_id":"d3f45b6c-7d8e-4f9a-8b0c-1d2e3f4a5b6c"},"previous_request_id":null,"required_checkers":1,"resubmitted_request_id":null,"status":"pending"}]}}}},"403":{"description":"Forbidden, including api_group_disabled."}}}},"/licences/{id}":{"get":{"description":"One licence. Errors: 404 not_found.","parameters":[{"in":"path","name":"id","description":"Licence id, with or without its lic_ prefix.","required":true,"schema":{"type":"string"}}],"summary":"Get a licence","tags":["Licences"],"security":[{"bearer":[]}],"operationId":"get_licences_id","responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"activated_at":"2026-10-29T07:00:00Z","apps":{"android":[{"cert_sha256":["AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67:89"],"package":"tz.co.example.app"}],"ios":[{"bundle_id":"tz.co.example.app","team_id":"ABCDE12345"}],"web":[{"origin":"https://kyc.example.co.tz"}]},"created_at":"2026-10-29T06:50:00Z","env":"production","features":["card_ocr","face_match","liveness"],"id":"lic_0b8f2c3e-1d4a-4b5c-9e6f-7a8b9c0d1e2f","last_minted_at":"2026-10-29T07:05:00Z","name":"KYC app, production","object":"licence","organization_id":"org_5e6f7a8b-9c0d-4e1f-8a2b-3c4d5e6f7a8b","revoked_at":null,"status":"active","updated_at":"2026-10-29T07:05:00Z","valid_from":"2026-10-31T21:00:00Z","valid_until":"2027-01-30T20:59:59Z"}}}}},"403":{"description":"Forbidden, including api_group_disabled."}}}},"/approval-requests/{id}":{"get":{"description":"One request plus history, the earlier requests in its resubmission chain. Those who read the queue see any request; anyone else only the requests they raised. Errors: 403 forbidden, 404 not_found.","parameters":[{"in":"path","name":"id","description":"Approval request id.","required":true,"schema":{"type":"string"}}],"summary":"Get an approval request","tags":["Team & approvals"],"security":[{"bearer":[]}],"operationId":"get_approval_requests_id","responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"action_code":"branch.member.add","amount":null,"approval_mode":"standard","approved_count":0,"branch":{"id":"9d2a6b1c-3e4f-4a5b-9c8d-7e6f5a4b3c2d","name":"Central branch"},"can_check":true,"changes_requested":null,"created_at":"2026-10-24T07:42:10Z","decisions":[],"entity_id":"9d2a6b1c-3e4f-4a5b-9c8d-7e6f5a4b3c2d","entity_label":"Central branch","entity_type":"branch","history":[],"id":"55c49f0a-1b2c-4d3e-8f4a-5b6c7d8e9f0a","maker":{"id":"6f1c2a3b-4d5e-4f6a-8b7c-9d0e1f2a3b4c","name":"Asha Mwakyusa"},"object":"approval_request","payload":{"role":"viewer","user_id":"d3f45b6c-7d8e-4f9a-8b0c-1d2e3f4a5b6c"},"previous_request_id":null,"required_checkers":1,"resubmitted_request_id":null,"status":"pending"}}}}},"403":{"description":"Forbidden, including api_group_disabled."}}}},"/staff/auth/code/verify":{"post":{"description":"Exchanges a sign-in code (valid 5 minutes) for a staff session, answering 201 with the staff session body or 403 no_workspace. Errors: 401 invalid_code or code_expired, 429 too_many_attempts, 422 missing_field.","parameters":[],"summary":"Verify a sign-in code","tags":["Sign-in & sessions"],"security":[],"operationId":"post_staff_auth_code_verify","responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"actor":"staff","branchId":"9d2a6b1c-3e4f-4a5b-9c8d-7e6f5a4b3c2d","branchName":"Central branch","organizationId":"0b7e4c1a-2d3f-4e5a-8b9c-1d2e3f4a5b6c","organizationName":"Acme Fintech","organizationType":"business","permissions":["read:branches","read:approval_requests","read:audit_log"],"raises_approvals":true,"setup":{"state":"ready"},"token":"sid_ust_Zx8Kq2LmN4pR7tV1wY5bC9dF","user":{"email":"asha@example.com","id":"6f1c2a3b-4d5e-4f6a-8b7c-9d0e1f2a3b4c","name":"Asha Mwakyusa","orgRole":"member","phone":"+255712000001","role":"viewer"}}}}}},"403":{"description":"Forbidden, including api_group_disabled."}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["identifier","code"],"properties":{"code":{"type":"string","description":"The 6-digit code."},"device_label":{"type":"string","description":"Labels the session in the sessions list, e.g. \"Pixel 8\" (up to 80 characters)."},"device_platform":{"type":"string","description":"ios, android or web."},"identifier":{"type":"string","description":"The email or phone the code was sent to."}}},"example":{"code":"482913","identifier":"0712000001"}}}}}},"/staff/onboarding/invitations/{id}/decline":{"post":{"description":"Declines one of the person's pending invitations. Takes the sid_onb_ grant or a staff session token. Errors: 404 invitation_not_found.","parameters":[{"in":"path","name":"id","description":"Invitation id.","required":true,"schema":{"type":"string"}}],"summary":"Decline an invitation","tags":["Sign-in & sessions"],"security":[],"operationId":"post_staff_onboarding_invitations_id_decline","responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"status":"declined"}}}}},"403":{"description":"Forbidden, including api_group_disabled."}}}},"/approval-rules":{"get":{"description":"The Approval Rules page, read-only: for each action, which roles may make and check it at a branch or organization-wide, plus people named one by one. Owners and admins only.","parameters":[{"in":"query","name":"branch_id","description":"A branch id; leave out for the organization-wide rules.","required":false,"schema":{"type":"string"}}],"summary":"Get the approval rules","tags":["Team & approvals"],"security":[{"bearer":[]}],"operationId":"get_approval_rules","responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"actions":[{"action_code":"branch.member.add","checkers":["admin"],"label":"Branch staff added","makers":["branch_manager"]}],"assignments":[{"action_code":"branch.member.add","branch_id":null,"can_check":false,"can_make":true,"label":"Branch staff added","user":{"id":"6f1c2a3b-4d5e-4f6a-8b7c-9d0e1f2a3b4c","name":"Asha Mwakyusa"}}],"branch_id":null,"object":"approval_rules","roles":[{"label":"Owner","role":"owner"},{"label":"Branch manager","role":"branch_manager"}]}}}}},"403":{"description":"Forbidden, including api_group_disabled."}}}},"/me/phone/verify":{"post":{"description":"Checks the code sent by POST /me/phone and swaps the phone on the account. Staff session only. Errors (all 422): invalid, expired, too_many_attempts, phone_taken, verification_failed, missing_field.","parameters":[],"summary":"Confirm a phone number change","tags":["Staff sessions"],"security":[{"bearer":[]}],"operationId":"post_me_phone_verify","responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"status":"verified"}}}}},"403":{"description":"Forbidden, including api_group_disabled."}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["code"],"properties":{"code":{"type":"string","description":"The code texted to the new number."}}},"example":{"code":"482913"}}}}}},"/licences/renew":{"post":{"description":"Takes the SDK's renewal request (digidrenew1.…, from renewLicence / renewal_request in every SDK) and answers with the phone's next licence token. The app treats request and response as opaque; a backend can forward both server-to-server. No API key: the licence token inside authenticates it. The request carries the phone's signed usage reports (counts only), which are applied first. Pay as you go: no report, no renewal. Each phone has a random counter id; a phone that renewed before must have a report (zero counts included) for every business day since its last renewal, a new phone for every day since the token it holds was issued (at most 7 days), and never more than the last 35 days. Monthly and Enterprise licences renew without that check. Errors: 409 usage_report_missing (details.missing_days, ISO dates), 402 insufficient_credit, 422 malformed, bad_signature, invalid_token, invalid_report, app_not_licensed, invalid_counter, invalid_day, invalid_count, licence_not_active, licence_expired, missing_field.","parameters":[],"summary":"Renew a licence token","tags":["Usage reports"],"security":[],"operationId":"post_licences_renew","responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"expires_at":"2026-11-06T07:05:00Z","issued_at":"2026-10-30T07:05:00Z","licence_id":"lic_0b8f2c3e-1d4a-4b5c-9e6f-7a8b9c0d1e2f","object":"licence_token","plan":"payg","token":"digidlic1.eyJ2IjoxLCJraWQiOiIyMDI2LTEwIiwi….Cgm58rk8NVk6kEOfrojOd4jX77csfYG_RFE1WsQoA6o7NwUy5tUMyNW7J-buXbPOu51Cbro3E6CJ-czi8Y4ECQ"}}}}},"403":{"description":"Forbidden, including api_group_disabled."}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["request"],"properties":{"request":{"type":"string","description":"The SDK's renewal request: digidrenew1.<base64url body>.<base64url MAC>."}}},"example":{"request":"digidrenew1.eyJ2IjoxLCJsaWMiOiJsaWNfMGI4ZjJjM2UiLCJhcHAiOiJ0ei5jby5leGFtcGxlLmFwcCIsImN0ciI6IjNmOWExYzA0ZDJlNzQ4YjUiLCJkYXkiOiIyMDI2LTEwLTMwIiwicmVwb3J0cyI6W10sInRva2VuIjoiZGlnaWRsaWMxLuKApiJ9.q5k2H1sV0Jc8oQyXl7pN4mZ2tR9wE3uA6bD0fG1hI2Y"}}}}}},"/staff/onboarding/invitations/{id}/accept":{"post":{"description":"Joins the organization and answers 201 with a staff session body bound to the invitation's branch; a staff session token sent is revoked. Takes the sid_onb_ grant or a staff session token. An invitation with no branch answers 403 no_workspace with a fresh onboarding_token; other errors are 404 invitation_not_found and 422 invitation_expired.","parameters":[{"in":"path","name":"id","description":"Invitation id.","required":true,"schema":{"type":"string"}}],"summary":"Accept an invitation","tags":["Sign-in & sessions"],"security":[],"operationId":"post_staff_onboarding_invitations_id_accept","responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"actor":"staff","branchId":"9d2a6b1c-3e4f-4a5b-9c8d-7e6f5a4b3c2d","branchName":"Central branch","organizationId":"0b7e4c1a-2d3f-4e5a-8b9c-1d2e3f4a5b6c","organizationName":"Acme Fintech","organizationType":"business","permissions":["read:branches","read:approval_requests","read:audit_log"],"raises_approvals":true,"setup":{"state":"ready"},"token":"sid_ust_Zx8Kq2LmN4pR7tV1wY5bC9dF","user":{"email":"asha@example.com","id":"6f1c2a3b-4d5e-4f6a-8b7c-9d0e1f2a3b4c","name":"Asha Mwakyusa","orgRole":"member","phone":"+255712000001","role":"viewer"}}}}}},"403":{"description":"Forbidden, including api_group_disabled."}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"device_label":{"type":"string","description":"Labels the session in the sessions list, e.g. \"Pixel 8\" (up to 80 characters)."},"device_platform":{"type":"string","description":"ios, android or web."}}}}}}}},"/org/branches":{"get":{"description":"The organization's branches as stored records. Any role may read branches.","parameters":[],"summary":"List branches","tags":["Team & approvals"],"security":[{"bearer":[]}],"operationId":"get_org_branches","responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":[{"address":"Station Road","code":"CEN","email":"central@example.com","id":"9d2a6b1c-3e4f-4a5b-9c8d-7e6f5a4b3c2d","inserted_at":"2026-06-01T08:00:00Z","is_head_office":true,"manager_id":null,"name":"Central branch","organization_id":"0b7e4c1a-2d3f-4e5a-8b9c-1d2e3f4a5b6c","phone":"+255700000000","status":"active","town":"Arusha","updated_at":"2026-06-01T08:00:00Z"}]}}}},"403":{"description":"Forbidden, including api_group_disabled."}}}},"/staff/session":{"post":{"description":"Issues a new staff session token bound to another organization and branch and revokes the token sent; the old session's device label carries over. Staff session only (an API key gets 403 forbidden). Errors: 403 workspace_not_found, 422 missing_field.","parameters":[],"summary":"Switch workspace","tags":["Sign-in & sessions"],"security":[{"bearer":[]}],"operationId":"post_staff_session","responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"actor":"staff","branchId":"9d2a6b1c-3e4f-4a5b-9c8d-7e6f5a4b3c2d","branchName":"Central branch","organizationId":"0b7e4c1a-2d3f-4e5a-8b9c-1d2e3f4a5b6c","organizationName":"Acme Fintech","organizationType":"business","permissions":["read:branches","read:approval_requests","read:audit_log"],"raises_approvals":true,"setup":{"state":"ready"},"token":"sid_ust_Zx8Kq2LmN4pR7tV1wY5bC9dF","user":{"email":"asha@example.com","id":"6f1c2a3b-4d5e-4f6a-8b7c-9d0e1f2a3b4c","name":"Asha Mwakyusa","orgRole":"member","phone":"+255712000001","role":"viewer"}}}}}},"403":{"description":"Forbidden, including api_group_disabled."}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["organization_id"],"properties":{"branch_id":{"type":"string","description":"A branch id. Default: the first branch the person can open."},"organization_id":{"type":"string","description":"From GET /me/workspaces."}}},"example":{"branch_id":"9d2a6b1c-3e4f-4a5b-9c8d-7e6f5a4b3c2d","organization_id":"0b7e4c1a-2d3f-4e5a-8b9c-1d2e3f4a5b6c"}}}}}},"/me/revoke-sessions":{"post":{"description":"Signs the person out of every browser and every other app session; the calling token stays. Staff session only.","parameters":[],"summary":"Sign out everywhere else","tags":["Staff sessions"],"security":[{"bearer":[]}],"operationId":"post_me_revoke_sessions","responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"status":"revoked"}}}}},"403":{"description":"Forbidden, including api_group_disabled."}}}},"/me/sessions/{id}":{"delete":{"description":"Revokes one of the person's app sessions. Staff session only. Errors: 404 not_found.","parameters":[{"in":"path","name":"id","description":"Session id from GET /me/sessions.","required":true,"schema":{"type":"string"}}],"summary":"Sign one session out","tags":["Staff sessions"],"security":[{"bearer":[]}],"operationId":"delete_me_sessions_id","responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"status":"revoked"}}}}},"403":{"description":"Forbidden, including api_group_disabled."}}}},"/org/branches/{id}":{"get":{"description":"One branch with its profile and staff.","parameters":[{"in":"path","name":"id","description":"Branch id.","required":true,"schema":{"type":"string"}}],"summary":"Get a branch","tags":["Team & approvals"],"security":[{"bearer":[]}],"operationId":"get_org_branches_id","responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"address":null,"code":"CEN","email":"central@example.com","id":"9d2a6b1c-3e4f-4a5b-9c8d-7e6f5a4b3c2d","is_head_office":true,"name":"Central branch","object":"branch","phone":"+255700000000","staff":[{"email":"asha@example.com","name":"Asha Mwakyusa","phone":"+255712000001","role":"viewer","user_id":"6f1c2a3b-4d5e-4f6a-8b7c-9d0e1f2a3b4c"}],"status":"active","town":"Arusha"}}}}},"403":{"description":"Forbidden, including api_group_disabled."}}}},"/notifications/{id}/read":{"post":{"description":"Marks one notification item as read for the caller. The item comes back unread when its count changes.","parameters":[{"in":"path","name":"id","description":"Notification item id, e.g. invite-f1a27d8e-9f0a-4b1c-8d2e-3f4a5b6c7d8e.","required":true,"schema":{"type":"string"}}],"summary":"Mark a notification read","tags":["Notifications & audit"],"security":[{"bearer":[]}],"operationId":"post_notifications_id_read","responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"notification_id":"invite-f1a27d8e-9f0a-4b1c-8d2e-3f4a5b6c7d8e","read_at":"2026-10-24T07:45:00Z"}}}}},"403":{"description":"Forbidden, including api_group_disabled."}}}},"/me/sessions":{"get":{"description":"The person's live app sessions, most recently used first; current marks the calling one. Staff session only.","parameters":[],"summary":"List my sessions","tags":["Staff sessions"],"security":[{"bearer":[]}],"operationId":"get_me_sessions","responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":[{"created_at":"2026-10-01T06:00:00Z","current":true,"device_label":"Pixel 8","expires_at":"2026-10-31T06:00:00Z","id":"2b8e0a1b-2c3d-4e4f-9a5b-6c7d8e9f0a1b","last_used_at":"2026-10-24T07:42:10Z","object":"session","organization_id":"0b7e4c1a-2d3f-4e5a-8b9c-1d2e3f4a5b6c","organization_name":"Acme Fintech","platform":"android"}]}}}},"403":{"description":"Forbidden, including api_group_disabled."}}}},"/me/workspaces":{"get":{"description":"Every organization the person can work in, with its branches; organizations where they can open no branch are left out. For a digid person it lists every organization. Staff session only.","parameters":[],"summary":"List workspaces","tags":["Sign-in & sessions"],"security":[{"bearer":[]}],"operationId":"get_me_workspaces","responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":[{"branch_id":"9d2a6b1c-3e4f-4a5b-9c8d-7e6f5a4b3c2d","branch_name":"Central branch","branch_role":"viewer","branches":[{"id":"9d2a6b1c-3e4f-4a5b-9c8d-7e6f5a4b3c2d","name":"Central branch"}],"current":true,"object":"workspace","organization_id":"0b7e4c1a-2d3f-4e5a-8b9c-1d2e3f4a5b6c","organization_name":"Acme Fintech","organization_type":"business","role":"member"}]}}}},"403":{"description":"Forbidden, including api_group_disabled."}}}},"/approval-requests/{id}/approve":{"post":{"description":"Records an approval; when quorum is met the action runs and the status is executed, otherwise pending with the approved count. The caller must be a checker for the action under the Approval Rules and not its maker. Errors: 403 forbidden, 404 not_found, 422 not_pending, already_decided, maker_cannot_check or not_a_checker.","parameters":[{"in":"path","name":"id","description":"Approval request id.","required":true,"schema":{"type":"string"}}],"summary":"Approve a request","tags":["Team & approvals"],"security":[{"bearer":[]}],"operationId":"post_approval_requests_id_approve","responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"id":"55c49f0a-1b2c-4d3e-8f4a-5b6c7d8e9f0a","status":"executed"}}}}},"403":{"description":"Forbidden, including api_group_disabled."}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","description":"Why."}}},"example":{"reason":"Arrears confirmed"}}}}}},"/me":{"delete":{"description":"Deletes the person's staff account once the texted code checks out. Staff session only. Errors: 422 last_owner (details.organizations lists them), invalid_code or code_expired, 429 too_many_attempts.","parameters":[],"summary":"Delete my account","tags":["Staff sessions"],"security":[{"bearer":[]}],"operationId":"delete_me","responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"status":"deleted"}}}}},"403":{"description":"Forbidden, including api_group_disabled."}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["code"],"properties":{"code":{"type":"string","description":"The code from POST /me/deletion-code."}}},"example":{"code":"482913"}}}}},"get":{"description":"Who the credential is. A staff session gets a staff_session object with its organization, branch, setup state and permissions; an API key gets an api_client object with its role and key_prefix.","parameters":[],"summary":"Get the current credential","tags":["Sign-in & sessions"],"security":[{"bearer":[]}],"operationId":"get_me","responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"actor":"staff","branch":{"code":"CEN","id":"9d2a6b1c-3e4f-4a5b-9c8d-7e6f5a4b3c2d","name":"Central branch"},"id":"6f1c2a3b-4d5e-4f6a-8b7c-9d0e1f2a3b4c","name":"Asha Mwakyusa","object":"staff_session","orgRole":"member","organization":{"branch_roles":["branch_manager","viewer"],"currency":"TZS","email":"info@example.com","id":"0b7e4c1a-2d3f-4e5a-8b9c-1d2e3f4a5b6c","name":"Acme Fintech","phone":"+255700000000","registration_number":null,"slug":"acme-fintech","tin":null,"type":"business"},"permissions":["read:branches","read:approval_requests","read:audit_log"],"raises_approvals":true,"role":"viewer","setup":{"state":"ready"}}}}}},"403":{"description":"Forbidden, including api_group_disabled."}}},"patch":{"description":"Changes the signed-in person's display name. Staff session only (an API key gets 403). Errors: 422 invalid_name, validation_failed.","parameters":[],"summary":"Change my display name","tags":["Staff sessions"],"security":[{"bearer":[]}],"operationId":"patch_me","responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"id":"6f1c2a3b-4d5e-4f6a-8b7c-9d0e1f2a3b4c","name":"Asha M. Mwakyusa"}}}}},"403":{"description":"Forbidden, including api_group_disabled."}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string","description":"2 to 120 characters."}}},"example":{"name":"Asha M. Mwakyusa"}}}}}},"/approval-requests/{id}/request-changes":{"post":{"description":"Sends the request back to its maker with a required reason; only some actions can be sent back. Errors: 422 reason_required or changes_not_supported, plus the approve errors.","parameters":[{"in":"path","name":"id","description":"Approval request id.","required":true,"schema":{"type":"string"}}],"summary":"Send a request back for changes","tags":["Team & approvals"],"security":[{"bearer":[]}],"operationId":"post_approval_requests_id_request_changes","responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"id":"55c49f0a-1b2c-4d3e-8f4a-5b6c7d8e9f0a","status":"changes_requested"}}}}},"403":{"description":"Forbidden, including api_group_disabled."}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["reason"],"properties":{"reason":{"type":"string","description":"What to change."}}},"example":{"reason":"Attach the seal number"}}}}}},"/org/invitations/{id}/resend":{"post":{"description":"Sends a pending invitation again with a fresh expiry. Owners and admins only. Errors: 404 not_found, 422 invitation_not_pending or rate_limited (3 resends per invitation per hour).","parameters":[{"in":"path","name":"id","description":"Invitation id.","required":true,"schema":{"type":"string"}}],"summary":"Resend an invitation","tags":["Team & approvals"],"security":[{"bearer":[]}],"operationId":"post_org_invitations_id_resend","responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"branch":null,"branch_id":"9d2a6b1c-3e4f-4a5b-9c8d-7e6f5a4b3c2d","branch_role":"viewer","email":null,"expires_at":"2026-10-31T07:00:00Z","id":"f1a27d8e-9f0a-4b1c-8d2e-3f4a5b6c7d8e","inserted_at":"2026-10-24T07:00:00Z","invited_by_id":"6f1c2a3b-4d5e-4f6a-8b7c-9d0e1f2a3b4c","organization_id":"0b7e4c1a-2d3f-4e5a-8b9c-1d2e3f4a5b6c","phone":"+255712000002","role":"member","status":"pending","updated_at":"2026-10-24T07:00:00Z"}}}}},"403":{"description":"Forbidden, including api_group_disabled."}}}},"/approval-requests/{id}/reject":{"post":{"description":"One rejection ends the request and unwinds anything the maker staged. Same checker rules and errors as approve, plus 422 reason_required where the action needs a reason.","parameters":[{"in":"path","name":"id","description":"Approval request id.","required":true,"schema":{"type":"string"}}],"summary":"Reject a request","tags":["Team & approvals"],"security":[{"bearer":[]}],"operationId":"post_approval_requests_id_reject","responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"id":"55c49f0a-1b2c-4d3e-8f4a-5b6c7d8e9f0a","status":"rejected"}}}}},"403":{"description":"Forbidden, including api_group_disabled."}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","description":"Why."}}},"example":{"reason":"Staff member left the branch"}}}}}},"/me/deletion-code":{"post":{"description":"Texts a deletion code to the person's verified phone and answers 202; confirm with DELETE /me. Staff session only. Errors: 422 no_phone, 429 rate_limited, 503 delivery_failed.","parameters":[],"summary":"Request an account deletion code","tags":["Staff sessions"],"security":[{"bearer":[]}],"operationId":"post_me_deletion_code","responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"status":"code_sent"}}}}},"403":{"description":"Forbidden, including api_group_disabled."}}}},"/audit/events":{"get":{"description":"The organization's activity log for the caller's branch, newest first; organization-level events with no branch are not listed. Branch managers and accountants (and owners and admins) may read it. Bad paging answers 422 invalid_pagination; from and to are accepted but have no effect yet.","parameters":[{"in":"query","name":"user_id","description":"Actor id.","required":false,"schema":{"type":"string"}},{"in":"query","name":"action","description":"e.g. api_client.created, membership.removed, invitation.created.","required":false,"schema":{"type":"string"}},{"in":"query","name":"entity_type","description":"e.g. service_account.","required":false,"schema":{"type":"string"}},{"in":"query","name":"entity_id","description":"An entity id.","required":false,"schema":{"type":"string"}},{"in":"query","name":"request_id","description":"An approval request id.","required":false,"schema":{"type":"string"}},{"in":"query","name":"category","description":"A timeline category.","required":false,"schema":{"type":"string"}},{"in":"query","name":"result","description":"success, failure, denied or pending.","required":false,"schema":{"type":"string"}},{"in":"query","name":"source","description":"api, ui, system or worker.","required":false,"schema":{"type":"string"}},{"in":"query","name":"search","description":"Free text.","required":false,"schema":{"type":"string"}},{"in":"query","name":"page","description":"Page number, from 1. A page past the end returns the last page.","required":false,"schema":{"type":"integer"}},{"in":"query","name":"page_size","description":"10, 25, 50 or 100. Default 25.","required":false,"schema":{"type":"integer"}}],"summary":"List audit events","tags":["Notifications & audit"],"security":[{"bearer":[]}],"operationId":"get_audit_events","responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":[{"action":"api_client.created","actor_type":"customer","branch_id":"9d2a6b1c-3e4f-4a5b-9c8d-7e6f5a4b3c2d","changes":{},"created_at":"2026-10-24T07:42:10Z","entity_id":"e5c23a4b-5c6d-4e7f-8a9b-0c1d2e3f4a5b","entity_type":"api_client","id":"6d7e6a7b-8c9d-4e0f-9a1b-2c3d4e5f6a7b","ip_address":null,"metadata":{},"organization_id":"0b7e4c1a-2d3f-4e5a-8b9c-1d2e3f4a5b6c","request_id":null,"result":"success","source":"api","user":{"id":"c41d1b2c-3d4e-4f5a-8b6c-7d8e9f0a1b2c","name":"API · Back office"},"user_agent":null,"user_id":"c41d1b2c-3d4e-4f5a-8b6c-7d8e9f0a1b2c"}],"meta":{"page":1,"page_count":1,"page_size":25,"total":1}}}}},"403":{"description":"Forbidden, including api_group_disabled."}}}},"/notifications/read-all":{"post":{"description":"Marks the current items as read, taking the same limit and branch_id as the list. An API key's read state belongs to its service user.","parameters":[],"summary":"Mark all notifications read","tags":["Notifications & audit"],"security":[{"bearer":[]}],"operationId":"post_notifications_read_all","responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"marked_count":1,"read_at":"2026-10-24T07:45:00Z"}}}}},"403":{"description":"Forbidden, including api_group_disabled."}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"branch_id":{"type":"string","description":"Must be the caller's branch if given."},"limit":{"type":"integer","description":"1 to 30, default 10."}}}}}}}},"/licences/{id}/tokens":{"post":{"description":"Signs a fresh offline licence token (digidlic1.…) for an active licence; pass it to the SDK (Engine::new / Digid.init). Its exp is the licence's valid_until and nbf its valid_from, so a backend can mint after every renewal and serve the token to its apps; its plan claim says monthly, payg or enterprise. A pay-as-you-go product's token lives 7 days (with a grace claim of 3 days offline) and is minted only while the product has credit; here it is a bootstrap token, at most once every 30 days per licence, which new phones start from: phones then renew theirs with their usage reports (POST /licences/renew). Tokens are not stored and minting is audited. Owners, admins, branch managers and branch-manager keys only. Errors: 402 insufficient_credit (pay as you go, no credit left: top up), 403 forbidden, 404 not_found, 409 bootstrap_limit, 422 licence_not_active, licence_expired or no_signing_key.","parameters":[{"in":"path","name":"id","description":"Licence id, with or without its lic_ prefix.","required":true,"schema":{"type":"string"}}],"summary":"Mint a licence token","tags":["Licences"],"security":[{"bearer":[]}],"operationId":"post_licences_id_tokens","responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"expires_at":"2027-01-30T20:59:59Z","issued_at":"2026-10-29T07:05:00Z","kid":"2026-10","licence_id":"lic_0b8f2c3e-1d4a-4b5c-9e6f-7a8b9c0d1e2f","object":"licence_token","token":"digidlic1.eyJ2IjoxLCJraWQiOiIyMDI2LTEwIiwi….Cgm58rk8NVk6kEOfrojOd4jX77csfYG_RFE1WsQoA6o7NwUy5tUMyNW7J-buXbPOu51Cbro3E6CJ-czi8Y4ECQ"}}}}},"403":{"description":"Forbidden, including api_group_disabled."}}}},"/licences":{"get":{"description":"The organization's SDK licences, active first: environment (sandbox or production), status (draft, active, revoked, expired), features, app bindings and term. Licences are per app and per term, not metered. Any member or key may read them.","parameters":[],"summary":"List licences","tags":["Licences"],"security":[{"bearer":[]}],"operationId":"get_licences","responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":[{"activated_at":"2026-10-29T07:00:00Z","apps":{"android":[{"cert_sha256":["AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67:89:AB:CD:EF:01:23:45:67:89"],"package":"tz.co.example.app"}],"ios":[{"bundle_id":"tz.co.example.app","team_id":"ABCDE12345"}],"web":[{"origin":"https://kyc.example.co.tz"}]},"created_at":"2026-10-29T06:50:00Z","env":"production","features":["card_ocr","face_match","liveness"],"id":"lic_0b8f2c3e-1d4a-4b5c-9e6f-7a8b9c0d1e2f","last_minted_at":"2026-10-29T07:05:00Z","name":"KYC app, production","object":"licence","organization_id":"org_5e6f7a8b-9c0d-4e1f-8a2b-3c4d5e6f7a8b","revoked_at":null,"status":"active","updated_at":"2026-10-29T07:05:00Z","valid_from":"2026-10-31T21:00:00Z","valid_until":"2027-01-30T20:59:59Z"}]}}}},"403":{"description":"Forbidden, including api_group_disabled."}}}},"/me/phone":{"post":{"description":"Texts a code to the new number and answers 202; confirm with POST /me/phone/verify. Staff session only. Errors (all 422): invalid_phone, phone_taken, rate_limited, delivery_failed, missing_field.","parameters":[],"summary":"Start a phone number change","tags":["Staff sessions"],"security":[{"bearer":[]}],"operationId":"post_me_phone","responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"status":"code_sent"}}}}},"403":{"description":"Forbidden, including api_group_disabled."}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["phone"],"properties":{"phone":{"type":"string","description":"The new Tanzanian phone number."}}},"example":{"phone":"0712000009"}}}}}},"/staff/auth/sign-in":{"post":{"description":"Signs a staff member in with an email or Tanzanian phone and a password and answers 201 with the staff session body (camelCase keys). A digid support person signing in by email gets 200 with a choice_token and the organizations they may open instead. Errors: 401 invalid_credentials, 403 password_setup_required or no_workspace (with an onboarding_token), 429 after 10 attempts per 15 minutes.","parameters":[],"summary":"Sign in with a password","tags":["Sign-in & sessions"],"security":[],"operationId":"post_staff_auth_sign_in","responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"actor":"staff","branchId":"9d2a6b1c-3e4f-4a5b-9c8d-7e6f5a4b3c2d","branchName":"Central branch","organizationId":"0b7e4c1a-2d3f-4e5a-8b9c-1d2e3f4a5b6c","organizationName":"Acme Fintech","organizationType":"business","permissions":["read:branches","read:approval_requests","read:audit_log"],"raises_approvals":true,"setup":{"state":"ready"},"token":"sid_ust_Zx8Kq2LmN4pR7tV1wY5bC9dF","user":{"email":"asha@example.com","id":"6f1c2a3b-4d5e-4f6a-8b7c-9d0e1f2a3b4c","name":"Asha Mwakyusa","orgRole":"member","phone":"+255712000001","role":"viewer"}}}}}},"403":{"description":"Forbidden, including api_group_disabled."}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["identifier","password"],"properties":{"device_label":{"type":"string","description":"Labels the session in the sessions list, e.g. \"Pixel 8\" (up to 80 characters)."},"device_platform":{"type":"string","description":"ios, android or web."},"identifier":{"type":"string","description":"Email, or a Tanzanian phone in any format."},"password":{"type":"string","description":"Password."}}},"example":{"device_label":"Pixel 8","device_platform":"android","identifier":"asha@example.com","password":"correct horse battery"}}}}}},"/staff/auth/code":{"post":{"description":"Sends a one-time 6-digit sign-in code by SMS or email. Always answers 202 for valid input, whether or not an account exists. Errors: 422 invalid_identifier, invalid_channel or missing_field, 429 rate_limited.","parameters":[],"summary":"Send a sign-in code","tags":["Sign-in & sessions"],"security":[],"operationId":"post_staff_auth_code","responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"status":"sent"}}}}},"403":{"description":"Forbidden, including api_group_disabled."}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["identifier"],"properties":{"channel":{"type":"string","description":"sms or email. Defaults to the identifier's kind."},"identifier":{"type":"string","description":"Email or phone."}}},"example":{"channel":"sms","identifier":"0712000001"}}}}}},"/usage":{"post":{"description":"Takes one of the SDK's signed daily usage reports (digidusage1.…, from usage_reports in every SDK) and records its count: completed verifications under a licence, in one app, on one business day (Africa/Dar_es_Salaam), for one anonymous counter. Counts only; no personal data. No API key: the licence token inside the report authenticates it, and the report must name the token's licence and an app the token binds. Re-posting the same licence, app, day and counter replaces the count (it never goes down); it does not add. Pay-as-you-go products' credits go down by the increase; monthly products are measured against the fair-use cap, which never blocks. Errors: 422 malformed, bad_signature, invalid_token, invalid_report, app_not_licensed, invalid_day (in the future, over 35 days old or outside the token's validity), invalid_count (0–10,000 per counter and day), invalid_batch, missing_field.","parameters":[],"summary":"Report daily usage","tags":["Usage reports"],"security":[],"operationId":"post_usage","responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"app":"tz.co.example.app","batch":"3f9a1c04d2e748b5","count":12,"day":"2026-10-30","licence_id":"lic_0b8f2c3e-1d4a-4b5c-9e6f-7a8b9c0d1e2f","object":"usage_report"}}}}},"403":{"description":"Forbidden, including api_group_disabled."}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["report"],"properties":{"report":{"type":"string","description":"The SDK's report: digidusage1.<base64url body>.<base64url MAC>."}}},"example":{"report":"digidusage1.eyJ2IjoxLCJsaWMiOiJsaWNfMGI4ZjJjM2UiLCJhcHAiOiJ0ei5jby5leGFtcGxlLmFwcCIsImRheSI6IjIwMjYtMTAtMzAiLCJiYXRjaCI6IjNmOWExYzA0ZDJlNzQ4YjUiLCJjb3VudCI6MTIsInRva2VuIjoiZGlnaWRsaWMxLuKApiJ9.q5k2H1sV0Jc8oQyXl7pN4mZ2tR9wE3uA6bD0fG1hI2Y"}}}}}},"/approval-requests/{id}/resubmit":{"post":{"description":"Always refused: a returned request is revised and raised again from its record. Answers 422 not_returned or resubmit_not_supported.","parameters":[{"in":"path","name":"id","description":"Approval request id.","required":true,"schema":{"type":"string"}}],"summary":"Resubmit a request","tags":["Team & approvals"],"security":[{"bearer":[]}],"operationId":"post_approval_requests_id_resubmit","responses":{"200":{"description":"OK"},"403":{"description":"Forbidden, including api_group_disabled."}}}},"/org/members":{"get":{"description":"The organization's memberships with their users, oldest first. Owners and admins only, so no API key can call it (403 forbidden).","parameters":[],"summary":"List members","tags":["Team & approvals"],"security":[{"bearer":[]}],"operationId":"get_org_members","responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":[{"branch_assignment":null,"id":"71b38e9f-0a1b-4c2d-9e3f-4a5b6c7d8e9f","inserted_at":"2026-06-01T08:00:00Z","organization_id":"0b7e4c1a-2d3f-4e5a-8b9c-1d2e3f4a5b6c","role":"member","updated_at":"2026-06-01T08:00:00Z","user":{"email":"asha@example.com","id":"6f1c2a3b-4d5e-4f6a-8b7c-9d0e1f2a3b4c","name":"Asha Mwakyusa","phone":"+255712000001"},"user_id":"6f1c2a3b-4d5e-4f6a-8b7c-9d0e1f2a3b4c"}]}}}},"403":{"description":"Forbidden, including api_group_disabled."}}}},"/me/notification-preferences":{"get":{"description":"The person's push notification categories, all on until turned off. Staff session only.","parameters":[],"summary":"Get my push preferences","tags":["Staff sessions"],"security":[{"bearer":[]}],"operationId":"get_me_notification_preferences","responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"approvals":false,"channel":"email","object":"notification_preferences"}}}}},"403":{"description":"Forbidden, including api_group_disabled."}}},"put":{"description":"Turns push categories on or off; categories left out keep their value. Staff session only. Errors: 422 validation_failed for a non-boolean value.","parameters":[],"summary":"Update my push preferences","tags":["Staff sessions"],"security":[{"bearer":[]}],"operationId":"put_me_notification_preferences","responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"approvals":false,"channel":"email","object":"notification_preferences"}}}}},"403":{"description":"Forbidden, including api_group_disabled."}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"approvals":{"type":"boolean","description":"Approval request and decision emails."}}},"example":{"approvals":false}}}}}},"/approval-policies":{"get":{"description":"The organization's stored maker-checker policies, by action code. Owners and admins only, so no API key can call it.","parameters":[],"summary":"List approval policies","tags":["Team & approvals"],"security":[{"bearer":[]}],"operationId":"get_approval_policies","responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":[{"action_code":"branch.member.add","amount_max":null,"amount_min":null,"id":"3b4c7d8e-9f0a-4b1c-8d2e-3f4a5b6c7d8f","inserted_at":"2026-06-01T08:00:00Z","is_active":true,"organization_id":"0b7e4c1a-2d3f-4e5a-8b9c-1d2e3f4a5b6c","required_checkers":1,"updated_at":"2026-06-01T08:00:00Z"}]}}}},"403":{"description":"Forbidden, including api_group_disabled."}}}},"/staff/auth/phone-code/verify":{"post":{"description":"Exchanges a phone code for a staff session, answering 201 with the staff session body or 403 no_workspace. Errors: 401 invalid_code or code_expired, 429 too_many_attempts, 422 missing_field.","parameters":[],"summary":"Verify a phone sign-in code","tags":["Sign-in & sessions"],"security":[],"operationId":"post_staff_auth_phone_code_verify","responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"actor":"staff","branchId":"9d2a6b1c-3e4f-4a5b-9c8d-7e6f5a4b3c2d","branchName":"Central branch","organizationId":"0b7e4c1a-2d3f-4e5a-8b9c-1d2e3f4a5b6c","organizationName":"Acme Fintech","organizationType":"business","permissions":["read:branches","read:approval_requests","read:audit_log"],"raises_approvals":true,"setup":{"state":"ready"},"token":"sid_ust_Zx8Kq2LmN4pR7tV1wY5bC9dF","user":{"email":"asha@example.com","id":"6f1c2a3b-4d5e-4f6a-8b7c-9d0e1f2a3b4c","name":"Asha Mwakyusa","orgRole":"member","phone":"+255712000001","role":"viewer"}}}}}},"403":{"description":"Forbidden, including api_group_disabled."}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["phone","code"],"properties":{"code":{"type":"string","description":"The 6-digit code."},"device_label":{"type":"string","description":"Labels the session in the sessions list, e.g. \"Pixel 8\" (up to 80 characters)."},"device_platform":{"type":"string","description":"ios, android or web."},"phone":{"type":"string","description":"The phone."},"purpose":{"type":"string","description":"sign_in (default) or sign_up."}}},"example":{"code":"482913","phone":"0712000001","purpose":"sign_in"}}}}}},"/staff/onboarding/invitations":{"get":{"description":"The signed-in person's pending invitations, for someone with no workspace yet. Public route that takes the sid_onb_ grant from a 403 no_workspace, or a live staff session token; anything else gets 401 invalid_onboarding_token.","parameters":[],"summary":"List pending invitations","tags":["Sign-in & sessions"],"security":[],"operationId":"get_staff_onboarding_invitations","responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":[{"branch_id":"9d2a6b1c-3e4f-4a5b-9c8d-7e6f5a4b3c2d","branch_name":"Central branch","branch_role":"viewer","expires_at":"2026-10-31T07:00:00Z","id":"f1a27d8e-9f0a-4b1c-8d2e-3f4a5b6c7d8e","object":"invitation","organization_id":"0b7e4c1a-2d3f-4e5a-8b9c-1d2e3f4a5b6c","organization_name":"Acme Fintech","organization_type":"business","role":"member"}]}}}},"403":{"description":"Forbidden, including api_group_disabled."}}}},"/org/members/{id}":{"delete":{"description":"Removes a member and their branch access through the maker-checker policy: 200 when done, 202 while it waits for a checker. Owners and admins only. Errors: 403 forbidden, 404 not_found, 422 last_owner.","parameters":[{"in":"path","name":"id","description":"Membership id.","required":true,"schema":{"type":"string"}}],"summary":"Remove a member","tags":["Team & approvals"],"security":[{"bearer":[]}],"operationId":"delete_org_members_id","responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"action_code":null,"approval_request_id":null,"status":"executed"}}}}},"403":{"description":"Forbidden, including api_group_disabled."}}},"patch":{"description":"Changes a membership's organization role through the maker-checker policy: 200 when it took effect, 202 while it waits for a checker. Only owners may make or change owners and the last owner cannot be demoted. Errors: 403 forbidden, 404 not_found, 422 last_owner.","parameters":[{"in":"path","name":"id","description":"Membership id.","required":true,"schema":{"type":"string"}}],"summary":"Change a member's role","tags":["Team & approvals"],"security":[{"bearer":[]}],"operationId":"patch_org_members_id","responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"action_code":"organization.member.update_role","approval_request_id":"55c49f0a-1b2c-4d3e-8f4a-5b6c7d8e9f0a","status":"pending"}}}}},"403":{"description":"Forbidden, including api_group_disabled."}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["role"],"properties":{"role":{"type":"string","description":"owner, admin or member."}}},"example":{"role":"admin"}}}}}},"/me/security-events":{"get":{"description":"The person's last 25 sign-in and account-security events, newest first. Staff session only.","parameters":[],"summary":"List my security events","tags":["Staff sessions"],"security":[{"bearer":[]}],"operationId":"get_me_security_events","responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":[{"event":"password_changed","id":"8a9b0c1d-2e3f-4a5b-8c6d-7e8f9a0b1c2d","inserted_at":"2026-10-24T07:42:10Z","metadata":{},"surface":"customer","user_id":"6f1c2a3b-4d5e-4f6a-8b7c-9d0e1f2a3b4c"}]}}}},"403":{"description":"Forbidden, including api_group_disabled."}}}},"/staff/auth/phone-code":{"post":{"description":"The phone-only form of the sign-in code request. Answers 202 whether or not an account uses the phone. Errors: 422 invalid_phone, 429 rate_limited.","parameters":[],"summary":"Send a phone sign-in code","tags":["Sign-in & sessions"],"security":[],"operationId":"post_staff_auth_phone_code","responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"status":"sent"}}}}},"403":{"description":"Forbidden, including api_group_disabled."}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["phone"],"properties":{"phone":{"type":"string","description":"Tanzanian phone in any format."}}},"example":{"phone":"0712000001"}}}}}},"/me/password":{"post":{"description":"Changes the password after checking the current one; web sessions and every other app session are signed out and an email confirms the change. Staff session only. Errors: 422 invalid_current_password, password_too_short or missing_field.","parameters":[],"summary":"Change my password","tags":["Staff sessions"],"security":[{"bearer":[]}],"operationId":"post_me_password","responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"status":"changed"}}}}},"403":{"description":"Forbidden, including api_group_disabled."}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["current_password","password"],"properties":{"current_password":{"type":"string","description":"The current password."},"password":{"type":"string","description":"The new password, at least 12 characters."}}},"example":{"current_password":"old horse battery","password":"correct horse battery staple"}}}}}},"/org/invitations":{"get":{"description":"All of the organization's invitations, newest first, without their tokens. Owners and admins only.","parameters":[],"summary":"List invitations","tags":["Team & approvals"],"security":[{"bearer":[]}],"operationId":"get_org_invitations","responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":[{"branch":null,"branch_id":"9d2a6b1c-3e4f-4a5b-9c8d-7e6f5a4b3c2d","branch_role":"viewer","email":"grace@example.com","expires_at":"2026-10-31T07:00:00Z","id":"f1a27d8e-9f0a-4b1c-8d2e-3f4a5b6c7d8e","inserted_at":"2026-10-24T07:00:00Z","invited_by_id":"6f1c2a3b-4d5e-4f6a-8b7c-9d0e1f2a3b4c","organization_id":"0b7e4c1a-2d3f-4e5a-8b9c-1d2e3f4a5b6c","phone":null,"role":"member","status":"pending","updated_at":"2026-10-24T07:00:00Z"}]}}}},"403":{"description":"Forbidden, including api_group_disabled."}}},"post":{"description":"Invites a person by email or phone through the organization's approval rules: 201 with the invitation when it goes out at once, or 202 with a pending approval request. Owners and admins only. Errors: 422 invalid_recipient, invalid_branch_assignment, branch_inactive or validation_failed, 404 branch_not_found.","parameters":[],"summary":"Invite a staff member","tags":["Team & approvals"],"security":[{"bearer":[]}],"operationId":"post_org_invitations","responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"branch":null,"branch_id":"9d2a6b1c-3e4f-4a5b-9c8d-7e6f5a4b3c2d","branch_role":"viewer","email":null,"expires_at":"2026-10-31T07:00:00Z","id":"f1a27d8e-9f0a-4b1c-8d2e-3f4a5b6c7d8e","inserted_at":"2026-10-24T07:00:00Z","invited_by_id":"6f1c2a3b-4d5e-4f6a-8b7c-9d0e1f2a3b4c","organization_id":"0b7e4c1a-2d3f-4e5a-8b9c-1d2e3f4a5b6c","phone":"+255712000002","role":"member","status":"pending","updated_at":"2026-10-24T07:00:00Z"}}}}},"403":{"description":"Forbidden, including api_group_disabled."}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["recipient","role"],"properties":{"branch_id":{"type":"string","description":"Starting branch for a member; send with branch_role or not at all."},"branch_role":{"type":"string","description":"Starting branch role for a member, e.g. cashier."},"recipient":{"type":"string","description":"An email address or a Tanzanian phone number."},"role":{"type":"string","description":"owner, admin or member."}}},"example":{"branch_id":"9d2a6b1c-3e4f-4a5b-9c8d-7e6f5a4b3c2d","branch_role":"viewer","recipient":"0712000002","role":"member"}}}}}},"/staff/auth/digid-session":{"post":{"description":"A digid support person opens an organization after sign-in, using the choice_token as the credential. Answers 201 with a staff session body (actor digid, role digid_admin) valid for 12 hours. Errors: 401 invalid_grant, 403 workspace_not_found, 422 missing_field.","parameters":[],"summary":"Open an organization as a digid person","tags":["Sign-in & sessions"],"security":[],"operationId":"post_staff_auth_digid_session","responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"actor":"digid","branchId":"9d2a6b1c-3e4f-4a5b-9c8d-7e6f5a4b3c2d","branchName":"Head Office","organizationId":"0b7e4c1a-2d3f-4e5a-8b9c-1d2e3f4a5b6c","organizationName":"Acme Fintech","organizationType":"business","permissions":["manage:organization","read:branches"],"raises_approvals":false,"setup":{"state":"ready"},"token":"sid_gst_Hq3Lm8Np2Rt6Vx0Zb4Df","user":{"email":"peter@example.com","id":"7c2d1e0f-9a8b-4c7d-8e6f-5a4b3c2d1e0f","name":"Peter Kamau","orgRole":"admin","phone":null,"role":"digid_admin"}}}}}},"403":{"description":"Forbidden, including api_group_disabled."}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["choice_token","organization_id"],"properties":{"branch_id":{"type":"string","description":"A branch id. Default: the head office, else the first branch."},"choice_token":{"type":"string","description":"From the sign-in response; valid 15 minutes."},"device_label":{"type":"string","description":"Labels the session in the sessions list, e.g. \"Pixel 8\" (up to 80 characters)."},"device_platform":{"type":"string","description":"ios, android or web."},"organization_id":{"type":"string","description":"An organization from the sign-in response's workspaces."}}},"example":{"branch_id":"9d2a6b1c-3e4f-4a5b-9c8d-7e6f5a4b3c2d","choice_token":"SFMyNTY.g2gDbQAAACQ","organization_id":"0b7e4c1a-2d3f-4e5a-8b9c-1d2e3f4a5b6c"}}}}}},"/notifications":{"get":{"description":"The staff notification bell, generated from the caller's work queues (pending invitations, for owners and admins), with read state per person. Errors: 422 forbidden for a branch_id other than the caller's branch.","parameters":[{"in":"query","name":"limit","description":"1 to 30, default 10.","required":false,"schema":{"type":"integer"}},{"in":"query","name":"branch_id","description":"Must be the caller's branch if given.","required":false,"schema":{"type":"string"}}],"summary":"List notifications","tags":["Notifications & audit"],"security":[{"bearer":[]}],"operationId":"get_notifications","responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"generated_at":"2026-10-24T07:42:10Z","items":[{"branch_id":null,"created_at":"2026-10-24T07:42:10Z","id":"invite-f1a27d8e-9f0a-4b1c-8d2e-3f4a5b6c7d8e","is_read":false,"kind":"team_invitation_pending","message":"asha@example.com has not accepted the invitation yet.","path":"/customer/dashboard/acme-fintech/9d2a6b1c-3e4f-4a5b-9c8d-7e6f5a4b3c2d/settings/team","severity":"info","title":"Pending team invitation"}],"unread_count":1}}}}},"403":{"description":"Forbidden, including api_group_disabled."}}}},"/staff/auth/sign-out":{"post":{"description":"Revokes the staff session token sent. With an API key it answers the same and revokes nothing; revoke a key in Settings instead.","parameters":[],"summary":"Sign out","tags":["Sign-in & sessions"],"security":[{"bearer":[]}],"operationId":"post_staff_auth_sign_out","responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"status":"signed_out"}}}}},"403":{"description":"Forbidden, including api_group_disabled."}}}}},"tags":[{"name":"Sign-in & sessions","description":"Staff sign-in, onboarding and the session's own identity. Always available."},{"name":"Team & approvals","description":"Members, invitations, branches, and the maker-checker approval queue."},{"name":"Notifications & audit","description":"In-app notifications and the audit trail."},{"name":"Licences","description":"The organization's SDK licences, and fresh signed tokens for them so a backend can rotate the token its apps use."},{"name":"Usage reports","description":"The SDK's signed daily usage counts (licence, app, day, count; no personal data), posted by the app or relayed by your backend. Authenticated by the licence token inside each report. Always available."},{"name":"Staff sessions","description":"Staff sign in with their own account (sid_ust_ tokens) and reach what their role allows. Includes the staff account endpoints (profile, password, sessions)."},{"name":"Webhooks","description":"Events digid pushes to your HTTPS endpoints, set up under Settings → Webhooks. Outbound only; documented here for reference."}],"servers":[{"url":"https://digid-production.up.datahuru.com/api/v1"}],"openapi":"3.0.3"}