# SequiPay Marketplace API: full documentation Base URL: `https://{apiId}.execute-api.us-west-1.amazonaws.com/{stage}`. This file concatenates every guide and every endpoint page from https://apidocs.sequipay.com. Each section starts with a level-1 heading. The partner-facing integration API for SequiPay — the successor to the legacy marketplace-API, reading SequiPay Core's data. ## Authentication Every request carries a bearer access token: ``` Authorization: Bearer ``` An API Gateway Lambda authorizer validates the token on each request, resolves the **company** it belongs to and the **scopes** it was granted, and injects both into the request. It fails closed — a missing, expired, revoked, or malformed token is rejected with `401` before any handler runs. Tokens are minted by SequiPay Core (an access/refresh pair with per-module scopes); this API validates and reads, it does not issue tokens here. **Company isolation.** The company is taken from the token, never from the request, so a partner only ever sees its own company's data. **Revocation latency.** Authorizer decisions are cached at the edge for up to 5 minutes, so a revoke or suspension takes effect within that window. ## Scopes Access is gated per route by a `module:action` scope the token must carry (e.g. `users:read`). A token without the required scope gets `403`. Scopes are granted to the credential in Core. ## Response shape Successful and handled-error responses use the legacy envelope: ```json { "status": 200, "message": "success", "data": { } } ``` `status` mirrors the HTTP status; `data` is `null` on errors. --- # Quickstart Source: https://apidocs.sequipay.com/guides/quickstart.md Three steps from a token to reading your company's data. Most endpoints read; one path submits time entries. Every call is scoped to one SequiPay company. ## 1. Get a token Tokens are minted by **SequiPay Core**, not here — this API validates and reads, it does not issue tokens. A token is an access/refresh pair scoped to one company, and it carries a set of `module:action` scopes (for example `users:read`). Ask your SequiPay Core administrator to create a credential for your integration and grant it the scopes you need. Put the access token in an environment variable so it never lands in your code: ```bash export SEQUIFI_TOKEN="paste-your-access-token-here" ``` ## 2. Check the token works Call the health endpoint. It needs a valid token but no special scope: ```bash curl "https://{apiId}.execute-api.us-west-1.amazonaws.com/{stage}/v1/ping" \ -H "Authorization: Bearer $SEQUIFI_TOKEN" ``` Replace `{apiId}` and `{stage}` with the values for the environment you were given (staging or live). A `200` with `{"status":200,"message":"success","data":...}` means the token is valid. A `401` means it is missing, expired, revoked, or malformed. To see who the token belongs to and which scopes it carries: ```bash curl ".../v1/me" -H "Authorization: Bearer $SEQUIFI_TOKEN" curl ".../v1/scopes" -H "Authorization: Bearer $SEQUIFI_TOKEN" ``` ## 3. Read some data List the people in your company. This requires the `users:read` scope: ```bash curl "https://{apiId}.execute-api.us-west-1.amazonaws.com/{stage}/v1/users?per_page=1" \ -H "Authorization: Bearer $SEQUIFI_TOKEN" ``` A `403` here means the token is valid but was not granted `users:read` — ask your Core administrator to add it. From here, browse the API reference for the rest of the read endpoints, or read [Conventions](/guides/conventions.md) for the response envelope, pagination and filtering. --- # Authentication Source: https://apidocs.sequipay.com/guides/authentication.md Every request carries a bearer access token: ``` Authorization: Bearer ``` ## Where tokens come from Tokens are minted by **SequiPay Core** as an access/refresh pair, each scoped to one SequiPay company and granted a set of per-module scopes. This API validates and reads with a token; it does not issue tokens. To get a credential, ask your SequiPay Core administrator to create one for your integration and grant it the scopes it needs. ## How a request is checked An API Gateway Lambda authorizer validates the token on every request. It resolves the **company** the token belongs to and the **scopes** it was granted, and injects both into the request. It fails closed: a missing, expired, revoked, or malformed token is rejected with `401` before any handler runs. ## Company isolation The company is taken from the token, never from the request, so a token only ever sees its own company's data. You never pass a company id. ## Scopes Each route requires a `module:action` scope the token must carry — for example `users:read` for the users endpoints. A token without the required scope gets `403`. Scopes are granted to the credential in SequiPay Core. Call `GET /v1/scopes` to see what the current token holds. ## Revocation latency Authorizer decisions are cached at the edge for up to five minutes, so a revoke or suspension in Core takes effect within that window. See [Conventions](/guides/conventions.md) for the response envelope and [Errors and retries](/guides/errors.md) for the `401` and `403` cases. --- # Conventions Source: https://apidocs.sequipay.com/guides/conventions.md ## Base URL Every call goes to one base URL for the environment you were given: ``` https://{apiId}.execute-api.us-west-1.amazonaws.com/{stage} ``` Replace `{apiId}` and `{stage}` with the values for your environment (staging or live). ## Response envelope Successful and handled-error responses use the same envelope: ```json { "status": 200, "message": "success", "data": { } } ``` `status` mirrors the HTTP status code; `data` is `null` on errors. ## Scopes Access is gated per route by a `module:action` scope the token must carry — for example `users:read` for the users endpoints. A token without the required scope gets `403`. Scopes are granted to the credential in SequiPay Core. See [Authentication](/guides/authentication.md). ## Pagination List endpoints are paginated. Pass `page` and `per_page` as query parameters; the `data` object carries the page of results alongside the page counters: ```json { "current_page": 1, "per_page": 20, "total": 42, "last_page": 3 } ``` Request the next page by incrementing `page` until `current_page` reaches `last_page`. ## Filtering Many list endpoints accept filter query parameters (for example by status or by a related id). Each endpoint page in the reference lists the filters it supports. See [Errors and retries](/guides/errors.md) for the status codes and when to retry. --- # Errors and retries Source: https://apidocs.sequipay.com/guides/errors.md Errors use the same envelope as success, with `data` set to `null`: ```json { "status": 403, "message": "...", "data": null } ``` `status` mirrors the HTTP status code. ## Status codes - **`200`** — success. - **`400`** — the request was malformed (for example a bad query parameter). Fix the request. - **`401`** — the token is missing, expired, revoked, or malformed. Get a fresh access token from SequiPay Core. See [Authentication](/guides/authentication.md). - **`403`** — the token is valid but was not granted the `module:action` scope this route requires. Ask your Core administrator to add it. - **`404`** — the record does not exist, or is not in your company. - **`500`** — a server-side error. ## Retries Retry a `500` with exponential backoff. Do not retry `400`, `401`, `403`, or `404` — they will not change without fixing the request, the token, or the scopes. Because authorizer decisions are cached at the edge for up to five minutes, a token that was just revoked may keep working briefly, and a scope just granted may take up to five minutes to take effect. --- # Build with AI Source: https://apidocs.sequipay.com/guides/build-with-ai.md Every page on this site exists twice: once for people, and once as plain Markdown for AI tools. An agent never needs to run JavaScript or scrape HTML to learn this API. ## The machine-readable files | File | What it holds | Use it when | | --- | --- | --- | | [`/llms.txt`](/llms.txt) | One line per guide and per endpoint, each linking to its Markdown page | An agent should find the right page itself. Start here. | | [`/llms-full.txt`](/llms-full.txt) | Every guide and every endpoint page in one file | You want the whole API in one context window. | | [`/swagger.yaml`](/swagger.yaml) | The OpenAPI 3.0 spec — the source of truth for paths, fields and examples | Generating a client, an MCP server or a Postman collection. | | [`/openapi.json`](/openapi.json) | The same spec as JSON | Your tool wants JSON. | | `/reference/.md` | One endpoint: parameters, response fields, a cURL example | An agent needs one endpoint in detail. | | `/guides/.md` | One guide, like this one | An agent needs a workflow or the rules behind it. | Every endpoint has a stable `operationId` (for example `listUsers`, `getPosition`, `listTimesheets`). Generated clients and MCP tools use it as the function or tool name, and its page lives at `/reference/` plus the id in kebab case: `listUsers` is `/reference/list-users.md`. ## A starter prompt Paste this into Claude (or any assistant that can fetch URLs), then say what you want to build: ``` I'm integrating with the SequiPay Marketplace API. Read /llms.txt first, then fetch the guide and endpoint pages it links to as you need them. The base URL is https://{apiId}.execute-api.us-west-1.amazonaws.com/{stage} and every call uses "Authorization: Bearer ". Most endpoints read; one path submits time entries. Before writing code, read the Conventions and Errors guides. ``` ## The rules agents most often get wrong - **The base URL is one host, templated per environment.** Substitute `{apiId}` and `{stage}` for the environment you were given; don't invent a path. - **Every call needs `Authorization: Bearer `.** The token is scoped to one company and one set of `module:action` scopes. - **Almost every endpoint reads.** The one write path is `POST /v1/timesheets`, which submits a time entry and returns a receipt you poll at `GET /v1/timesheets/receipts/{id}`. - **Company is taken from the token.** Never send a company id. --- # Authenticated health check `GET https://{apiId}.execute-api.us-west-1.amazonaws.com/{stage}/v1/ping` Module: Health · operationId: `getPing` · Auth: `Authorization: Bearer ` Web page: https://apidocs.sequipay.com/#/api/get-ping Proves the authorizer → API Gateway chain end to end. Touches no database; echoes back the company and scopes the authorizer resolved from the token. Requires a valid token but **no specific scope**. ## Example request ```bash curl -X GET "https://{apiId}.execute-api.us-west-1.amazonaws.com/{stage}/v1/ping" \ -H "Authorization: Bearer $SEQUIFI_TOKEN" ``` ## Responses ### 200: The token is valid; the resolved identity is echoed back. - `ok` (boolean) Example: `true`. - `companyId` (string, nullable): The company the token belongs to. - `scopes` (array of string) ```json { "ok": true, "companyId": "cmp_01H8X…", "scopes": [ "users:read" ] } ``` ### 401: Missing, invalid, expired, or revoked token (from the authorizer). --- # The calling credential's identity `GET https://{apiId}.execute-api.us-west-1.amazonaws.com/{stage}/v1/me` Module: Identity · operationId: `getMe` · Auth: `Authorization: Bearer ` Web page: https://apidocs.sequipay.com/#/api/get-me Echoes back the identity the authorizer resolved from the bearer token — the company, the credential, the token, and the granted scopes. Touches no database. Requires a valid token but **no specific scope**, so a partner can always inspect its own credential. ## Example request ```bash curl -X GET "https://{apiId}.execute-api.us-west-1.amazonaws.com/{stage}/v1/me" \ -H "Authorization: Bearer $SEQUIFI_TOKEN" ``` ## Responses ### 200: The resolved identity. - `status` (integer) Example: `200`. - `message` (string) Example: `success`. - `data` (object): The identity the authorizer resolved from the token. - `company_id` (string): The company the token belongs to. Example: `cmp_01H8X…`. - `credential_id` (string, nullable): The partner credential the token was minted for. Example: `cred_01H8Y…`. - `token_id` (string, nullable): The specific token presented. Example: `tok_01H8Z…`. - `scopes` (array of string) ### 401: Missing, invalid, expired, or revoked token (from the authorizer). ### 500: An infrastructure or data error. The endpoint fails closed — a 500, never a partial or empty-looking result. ```json { "status": 500, "message": "internal error", "data": null } ``` --- # The granted scopes `GET https://{apiId}.execute-api.us-west-1.amazonaws.com/{stage}/v1/scopes` Module: Identity · operationId: `getScopes` · Auth: `Authorization: Bearer ` Web page: https://apidocs.sequipay.com/#/api/get-scopes Returns just the scopes the token carries. Touches no database. Requires a valid token but **no specific scope**. ## Example request ```bash curl -X GET "https://{apiId}.execute-api.us-west-1.amazonaws.com/{stage}/v1/scopes" \ -H "Authorization: Bearer $SEQUIFI_TOKEN" ``` ## Responses ### 200: The granted scopes. - `status` (integer) Example: `200`. - `message` (string) Example: `success`. - `data` (object) - `scopes` (array of string) ### 401: Missing, invalid, expired, or revoked token (from the authorizer). ### 500: An infrastructure or data error. The endpoint fails closed — a 500, never a partial or empty-looking result. ```json { "status": 500, "message": "internal error", "data": null } ``` --- # List employees `GET https://{apiId}.execute-api.us-west-1.amazonaws.com/{stage}/v1/users` Module: Users · operationId: `listUsers` · Auth: `Authorization: Bearer ` Web page: https://apidocs.sequipay.com/#/api/list-users Returns the authenticated company's employees, paginated. By default only **current** employees are returned; soft-deleted and draft employees are never returned. Requires the `users:read` scope. ## Query parameters - `first_name` (string): Partial, case-insensitive match on first name. Example: `ali`. - `last_name` (string): Partial, case-insensitive match on last name. - `full_name` (string): Partial, case-insensitive match on the full name. - `email` (string): Partial, case-insensitive match on email. - `status` (string): `active` (default) returns current employees; `inactive` returns only terminated employees (end date passed). One of: `active`, `inactive`. Default: `"active"`. - `onboarding_complete` (boolean): Filter by onboarding state. Truthy values (`1`, `true`, `yes`) return fully-onboarded employees; any other value returns the rest. - `page` (integer): 1-based page number. Default: `1`. Minimum: 1. - `per_page` (integer): Page size (max 200). Default: `20`. Minimum: 1. Maximum: 200. ## Example request ```bash curl -X GET "https://{apiId}.execute-api.us-west-1.amazonaws.com/{stage}/v1/users" \ -H "Authorization: Bearer $SEQUIFI_TOKEN" ``` ## Responses ### 200: A page of employees. - `status` (integer) Example: `200`. - `message` (string) Example: `success`. - `data` (object) - `users` (array of object) - `id` (integer (int64)) Example: `1024`. - `first_name` (string) Example: `Alice`. - `last_name` (string) Example: `Nguyen`. - `middle_name` (string, nullable) Example: `R`. - `name_suffix` (string, nullable) Example: `Jr`. - `email` (string (email), nullable) Example: `alice@acme.com`. - `worker_type` (string): Employment classification (Core `classification`). Example: `w2`. - `dob` (string (date), nullable) Example: `1990-05-01`. - `mobile_no` (string, nullable) Example: `555-0100`. - `home_address_line_1` (string, nullable) Example: `1 Main St`. - `home_address_line_2` (string, nullable) Example: `Apt 4`. - `home_address_city` (string, nullable) Example: `Austin`. - `home_address_state` (string, nullable) Example: `TX`. - `home_address_zip` (string, nullable) Example: `78701`. - `position_id` (integer (int64), nullable) Example: `7`. - `position_name` (string, nullable) Example: `Sales Rep`. - `status` (string): Derived from the end date — `inactive` once it has passed. One of: `active`, `inactive`. - `onboarding_complete` (boolean): True when the employee has verification steps and all are complete. - `start_date` (string (date), nullable) Example: `2024-01-15`. - `end_date` (string (date), nullable) - `pay_type` (string) Example: `salary`. - `created_at` (string (date-time), nullable) Example: `2024-01-15T12:00:00.000Z`. - `updated_at` (string (date-time), nullable) Example: `2024-06-01T09:30:00.000Z`. - `current_page` (integer) Example: `1`. - `per_page` (integer) Example: `20`. - `total` (integer) Example: `42`. - `last_page` (integer) Example: `3`. - `filters` (object): Echoes the filters actually applied. ### 401: Missing, invalid, expired, or revoked token (from the authorizer). ### 403: The token lacks the required scope. ```json { "error": "insufficient_scope", "required": "users:read" } ``` ### 500: An infrastructure or data error. The endpoint fails closed — a 500, never a partial or empty-looking result. ```json { "status": 500, "message": "internal error", "data": null } ``` --- # Get one employee `GET https://{apiId}.execute-api.us-west-1.amazonaws.com/{stage}/v1/users/{id}` Module: Users · operationId: `getUser` · Auth: `Authorization: Bearer ` Web page: https://apidocs.sequipay.com/#/api/get-user Returns a single employee by id, scoped to the authenticated company. A terminated employee is reachable by id (only the default list hides them); soft-deleted and draft employees are not. Requires the `users:read` scope. ## Path parameters - `id` (integer (int64), **required**): The employee's numeric id. Minimum: 1. Example: `1024`. ## Example request ```bash curl -X GET "https://{apiId}.execute-api.us-west-1.amazonaws.com/{stage}/v1/users/1024" \ -H "Authorization: Bearer $SEQUIFI_TOKEN" ``` ## Responses ### 200: The employee. - `status` (integer) Example: `200`. - `message` (string) Example: `success`. - `data` (object): A company employee. Core fields the legacy API could not back are omitted rather than faked; sensitive Core columns (SSN, bank, compensation) are never returned. - `id` (integer (int64)) Example: `1024`. - `first_name` (string) Example: `Alice`. - `last_name` (string) Example: `Nguyen`. - `middle_name` (string, nullable) Example: `R`. - `name_suffix` (string, nullable) Example: `Jr`. - `email` (string (email), nullable) Example: `alice@acme.com`. - `worker_type` (string): Employment classification (Core `classification`). Example: `w2`. - `dob` (string (date), nullable) Example: `1990-05-01`. - `mobile_no` (string, nullable) Example: `555-0100`. - `home_address_line_1` (string, nullable) Example: `1 Main St`. - `home_address_line_2` (string, nullable) Example: `Apt 4`. - `home_address_city` (string, nullable) Example: `Austin`. - `home_address_state` (string, nullable) Example: `TX`. - `home_address_zip` (string, nullable) Example: `78701`. - `position_id` (integer (int64), nullable) Example: `7`. - `position_name` (string, nullable) Example: `Sales Rep`. - `status` (string): Derived from the end date — `inactive` once it has passed. One of: `active`, `inactive`. - `onboarding_complete` (boolean): True when the employee has verification steps and all are complete. - `start_date` (string (date), nullable) Example: `2024-01-15`. - `end_date` (string (date), nullable) - `pay_type` (string) Example: `salary`. - `created_at` (string (date-time), nullable) Example: `2024-01-15T12:00:00.000Z`. - `updated_at` (string (date-time), nullable) Example: `2024-06-01T09:30:00.000Z`. ### 400: The id is not a positive integer. ```json { "status": 400, "message": "invalid user id", "data": null } ``` ### 401: Missing, invalid, expired, or revoked token (from the authorizer). ### 403: The token lacks the required scope. ```json { "error": "insufficient_scope", "required": "users:read" } ``` ### 404: No such employee for this company. ```json { "status": 404, "message": "not found", "data": null } ``` ### 500: An infrastructure or data error. The endpoint fails closed — a 500, never a partial or empty-looking result. ```json { "status": 500, "message": "internal error", "data": null } ``` --- # List positions `GET https://{apiId}.execute-api.us-west-1.amazonaws.com/{stage}/v1/positions` Module: Positions · operationId: `listPositions` · Auth: `Authorization: Bearer ` Web page: https://apidocs.sequipay.com/#/api/list-positions Returns the authenticated company's positions, paginated. By default only **active** (non-archived) positions are returned; soft-deleted positions are never returned. Requires the `positions:read` scope. ## Query parameters - `title` (string): Partial, case-insensitive match on the title. Example: `sales`. - `default_worker_type` (string): Exact match on the default classification (Core `default_classification`). Example: `w2`. - `status` (string): `active` (default) returns non-archived positions; `archived` returns only archived positions; `all` returns both (never soft-deleted). One of: `active`, `archived`, `all`. Default: `"active"`. - `page` (integer): 1-based page number. Default: `1`. Minimum: 1. - `per_page` (integer): Page size (max 200). Default: `20`. Minimum: 1. Maximum: 200. ## Example request ```bash curl -X GET "https://{apiId}.execute-api.us-west-1.amazonaws.com/{stage}/v1/positions" \ -H "Authorization: Bearer $SEQUIFI_TOKEN" ``` ## Responses ### 200: A page of positions. - `status` (integer) Example: `200`. - `message` (string) Example: `success`. - `data` (object) - `positions` (array of object) - `id` (integer (int64)) Example: `7`. - `title` (string) Example: `Sales Rep`. - `description` (string, nullable) Example: `Front line sales`. - `default_worker_type` (string): Default employment classification (Core `default_classification`). Example: `w2`. - `status` (string): Derived from the archived date — `archived` once it is set. One of: `active`, `archived`. - `archived_at` (string (date-time), nullable) - `created_at` (string (date-time), nullable) Example: `2024-01-15T12:00:00.000Z`. - `updated_at` (string (date-time), nullable) Example: `2024-06-01T09:30:00.000Z`. - `current_page` (integer) Example: `1`. - `per_page` (integer) Example: `20`. - `total` (integer) Example: `12`. - `last_page` (integer) Example: `1`. - `filters` (object): Echoes the filters actually applied. ### 401: Missing, invalid, expired, or revoked token (from the authorizer). ### 403: The token lacks the required scope. ```json { "error": "insufficient_scope", "required": "users:read" } ``` ### 500: An infrastructure or data error. The endpoint fails closed — a 500, never a partial or empty-looking result. ```json { "status": 500, "message": "internal error", "data": null } ``` --- # Get one position `GET https://{apiId}.execute-api.us-west-1.amazonaws.com/{stage}/v1/positions/{id}` Module: Positions · operationId: `getPosition` · Auth: `Authorization: Bearer ` Web page: https://apidocs.sequipay.com/#/api/get-position Returns a single position by id, scoped to the authenticated company. An archived position is reachable by id (only the default list hides them); soft-deleted positions are not. Requires the `positions:read` scope. ## Path parameters - `id` (integer (int64), **required**): The position's numeric id. Minimum: 1. Example: `7`. ## Example request ```bash curl -X GET "https://{apiId}.execute-api.us-west-1.amazonaws.com/{stage}/v1/positions/7" \ -H "Authorization: Bearer $SEQUIFI_TOKEN" ``` ## Responses ### 200: The position. - `status` (integer) Example: `200`. - `message` (string) Example: `success`. - `data` (object): A company position (job title). Compensation Core holds on this table (default salary) is never returned. - `id` (integer (int64)) Example: `7`. - `title` (string) Example: `Sales Rep`. - `description` (string, nullable) Example: `Front line sales`. - `default_worker_type` (string): Default employment classification (Core `default_classification`). Example: `w2`. - `status` (string): Derived from the archived date — `archived` once it is set. One of: `active`, `archived`. - `archived_at` (string (date-time), nullable) - `created_at` (string (date-time), nullable) Example: `2024-01-15T12:00:00.000Z`. - `updated_at` (string (date-time), nullable) Example: `2024-06-01T09:30:00.000Z`. ### 400: The id is not a positive integer. ```json { "status": 400, "message": "invalid position id", "data": null } ``` ### 401: Missing, invalid, expired, or revoked token (from the authorizer). ### 403: The token lacks the required scope. ```json { "error": "insufficient_scope", "required": "users:read" } ``` ### 404: No such position for this company. ```json { "status": 404, "message": "not found", "data": null } ``` ### 500: An infrastructure or data error. The endpoint fails closed — a 500, never a partial or empty-looking result. ```json { "status": 500, "message": "internal error", "data": null } ``` --- # List timesheets `GET https://{apiId}.execute-api.us-west-1.amazonaws.com/{stage}/v1/timesheets` Module: Timesheets · operationId: `listTimesheets` · Auth: `Authorization: Bearer ` Web page: https://apidocs.sequipay.com/#/api/list-timesheets Returns the authenticated company's timesheets, paginated, newest period first. Soft-deleted timesheets are never returned. Line items are omitted from the list — fetch a single timesheet for its time entries. Requires the `timesheets:read` scope. ## Query parameters - `employee_id` (integer (int64)): Exact match on the employee id. Minimum: 1. Example: `1024`. - `status` (string): Exact match on the timesheet status (e.g. draft, submitted). Example: `submitted`. - `from` (string (date)): Only timesheets whose period starts on or after this date (YYYY-MM-DD). Example: `2024-01-01`. - `to` (string (date)): Only timesheets whose period starts on or before this date (YYYY-MM-DD). Example: `2024-01-31`. - `page` (integer): 1-based page number. Default: `1`. Minimum: 1. - `per_page` (integer): Page size (max 200). Default: `20`. Minimum: 1. Maximum: 200. ## Example request ```bash curl -X GET "https://{apiId}.execute-api.us-west-1.amazonaws.com/{stage}/v1/timesheets" \ -H "Authorization: Bearer $SEQUIFI_TOKEN" ``` ## Responses ### 200: A page of timesheets. - `status` (integer) Example: `200`. - `message` (string) Example: `success`. - `data` (object) - `timesheets` (array of object) - `id` (integer (int64)) Example: `42`. - `employee_id` (integer (int64)) Example: `1024`. - `period_start` (string (date)) Example: `2024-01-01`. - `period_end` (string (date)) Example: `2024-01-14`. - `status` (string) Example: `submitted`. - `note` (string, nullable) - `submitted_at` (string (date-time), nullable) Example: `2024-01-15T12:00:00.000Z`. - `reviewed_at` (string (date-time), nullable) - `voided_at` (string (date-time), nullable) - `created_at` (string (date-time), nullable) Example: `2024-01-20T12:00:00.000Z`. - `updated_at` (string (date-time), nullable) Example: `2024-01-20T12:00:00.000Z`. - `time_entries` (array of object): Present only on GET /v1/timesheets/{id}. - `id` (integer (int64)) Example: `5001`. - `timesheet_id` (integer (int64)) Example: `42`. - `employee_id` (integer (int64)) Example: `1024`. - `work_date` (string (date)) Example: `2024-01-02`. - `started_at` (string (date-time), nullable) Example: `2024-01-02T16:00:00.000Z`. - `ended_at` (string (date-time), nullable) Example: `2024-01-02T20:00:00.000Z`. - `minutes` (integer) Example: `240`. - `break_minutes` (integer) Example: `0`. - `kind` (string) Example: `worked`. - `source` (string) Example: `manual`. - `job_ref` (string, nullable) Example: `J-1001`. - `job_label` (string, nullable) Example: `Install`. - `note` (string, nullable) - `created_at` (string (date-time), nullable) Example: `2024-01-20T12:00:00.000Z`. - `updated_at` (string (date-time), nullable) Example: `2024-01-20T12:00:00.000Z`. - `current_page` (integer) Example: `1`. - `per_page` (integer) Example: `20`. - `total` (integer) Example: `8`. - `last_page` (integer) Example: `1`. - `filters` (object): Echoes the filters actually applied. ### 401: Missing, invalid, expired, or revoked token (from the authorizer). ### 403: The token lacks the required scope. ```json { "error": "insufficient_scope", "required": "users:read" } ``` ### 500: An infrastructure or data error. The endpoint fails closed — a 500, never a partial or empty-looking result. ```json { "status": 500, "message": "internal error", "data": null } ``` --- # Write a time entry `POST https://{apiId}.execute-api.us-west-1.amazonaws.com/{stage}/v1/timesheets` Module: Timesheets · operationId: `writeTimeEntry` · Auth: `Authorization: Bearer ` Web page: https://apidocs.sequipay.com/#/api/write-time-entry Records one time entry for an employee. The write is asynchronous and idempotent: the service resolves the employee, forwards the entry to sequipay-core's single hours path, and returns 202 with a receipt id. Poll `GET /v1/timesheets/receipts/{id}` for the outcome. Idempotency is on `reference_id` — your own stable id for this entry. Re-sending the same `reference_id` amends the same entry and never duplicates it, so a 503 is always safe to retry with the same body. `kind` (worked vs adjustment) is NOT accepted — the service decides, based on whether the work date falls in a paid period. Requires the `timesheets:write` scope. ## Request body - `employee_id` (integer (int64), **required**): The employee's id (as returned by the users endpoints). Minimum: 1. Example: `1024`. - `reference_id` (string, **required**): Your own stable id for this entry — the idempotency key. Re-sending it amends the same entry. Max length: 180. Example: `shift-2024-01-02-1024`. - `work_date` (string (date), **required**): The date worked (YYYY-MM-DD). Example: `2024-01-02`. - `started_at` (string (date-time), nullable): Shift start; provide this (with ended_at) or minutes. Example: `2024-01-02T16:00:00Z`. - `ended_at` (string (date-time), nullable) Example: `2024-01-02T20:00:00Z`. - `minutes` (integer, nullable): Minutes worked; required when started_at is not given. May be negative for an adjustment. Example: `240`. - `break_minutes` (integer, nullable) Example: `30`. - `job_ref` (string, nullable) Example: `J-1001`. - `job_label` (string, nullable) Example: `Install`. - `rate_cents` (integer, nullable): Pay rate in cents, if the partner carries it. Example: `3000`. - `note` (string, nullable) Example: `Overtime approved.`. ## Example request ```bash curl -X POST "https://{apiId}.execute-api.us-west-1.amazonaws.com/{stage}/v1/timesheets" \ -H "Authorization: Bearer $SEQUIFI_TOKEN" ``` ## Responses ### 202: Accepted and queued. Poll the receipt for the outcome. - `status` (integer) Example: `202`. - `message` (string) Example: `accepted`. - `data` (object) - `receipt_id` (string): Opaque, company-bound receipt token — poll it at GET /v1/timesheets/receipts/{id}. Example: `eyJjIjoiY21wXzAxSDhYIiwiciI6IjlmMWMyYTdlIn0.a1B2c3D4`. - `status` (string) Example: `queued`. ### 401: Missing, invalid, expired, or revoked token (from the authorizer). ### 403: The token lacks the required scope. ```json { "error": "insufficient_scope", "required": "users:read" } ``` ### 404: No such employee for this company. ```json { "status": 404, "message": "employee not found for this company", "data": null } ``` ### 422: The body failed validation (this service's shape checks or Core's). ### 500: An infrastructure or data error. The endpoint fails closed — a 500, never a partial or empty-looking result. ```json { "status": 500, "message": "internal error", "data": null } ``` ### 503: sequipay-core could not be reached or was busy. Transient — retry with the SAME `reference_id`; the write is idempotent, so a retry never duplicates. ```json { "status": 503, "message": "core unavailable, retry", "data": null } ``` --- # Poll a write receipt `GET https://{apiId}.execute-api.us-west-1.amazonaws.com/{stage}/v1/timesheets/receipts/{id}` Module: Timesheets · operationId: `getTimeEntryReceipt` · Auth: `Authorization: Bearer ` Web page: https://apidocs.sequipay.com/#/api/get-time-entry-receipt Returns the outcome of a `POST /v1/timesheets` write by its receipt id. `status` is one of: `processing` (still queued), `saved` (with `result`: created | amended | adjustment), `refused` (with `detail`), `locked` (the pay period was already paid), or `failed` (with `retriable: true` — safe to retry the original write on the same `reference_id`). Requires the `timesheets:write` scope — only a writer has receipts to poll. ## Path parameters - `id` (string, **required**): The opaque receipt token returned by the write. It is bound to your company; a token for another company (or a malformed one) returns 404 / 400. Treat it as an opaque string. Example: `eyJjIjoiY21wXzAxSDhYIiwiciI6IjlmMWMyYTdlIn0.a1B2c3D4`. ## Example request ```bash curl -X GET "https://{apiId}.execute-api.us-west-1.amazonaws.com/{stage}/v1/timesheets/receipts/eyJjIjoiY21wXzAxSDhYIiwiciI6IjlmMWMyYTdlIn0.a1B2c3D4" \ -H "Authorization: Bearer $SEQUIFI_TOKEN" ``` ## Responses ### 200: The receipt's current outcome. - `status` (integer) Example: `200`. - `message` (string) Example: `success`. - `data` (object): The receipt outcome. - `receipt_id` (string): The opaque receipt token (same value the write returned). Example: `eyJjIjoiY21wXzAxSDhYIiwiciI6IjlmMWMyYTdlIn0.a1B2c3D4`. - `status` (string) One of: `queued`, `processing`, `saved`, `refused`, `locked`, `failed`. Example: `processing`. - `result` (string): Present when status is saved. One of: `created`, `amended`, `adjustment`. - `detail` (string): Present on saved / refused / locked / failed. - `retriable` (boolean): Present and true when status is failed — retry the original write. ### 400: The receipt id is missing or malformed. ```json { "status": 400, "message": "invalid receipt id", "data": null } ``` ### 401: Missing, invalid, expired, or revoked token (from the authorizer). ### 403: The token lacks the required scope. ```json { "error": "insufficient_scope", "required": "users:read" } ``` ### 404: No such receipt. ```json { "status": 404, "message": "not found", "data": null } ``` ### 500: An infrastructure or data error. The endpoint fails closed — a 500, never a partial or empty-looking result. ```json { "status": 500, "message": "internal error", "data": null } ``` ### 503: sequipay-core could not be reached or was busy. Transient — retry with the SAME `reference_id`; the write is idempotent, so a retry never duplicates. ```json { "status": 503, "message": "core unavailable, retry", "data": null } ``` --- # Get one timesheet `GET https://{apiId}.execute-api.us-west-1.amazonaws.com/{stage}/v1/timesheets/{id}` Module: Timesheets · operationId: `getTimesheet` · Auth: `Authorization: Bearer ` Web page: https://apidocs.sequipay.com/#/api/get-timesheet Returns a single timesheet by id, scoped to the authenticated company, with its time entries (line items, oldest work date first). Soft-deleted timesheets and soft-deleted entries are not returned. Compensation (`rate_cents`) is never included on an entry. Requires the `timesheets:read` scope. ## Path parameters - `id` (integer (int64), **required**): The timesheet's numeric id. Minimum: 1. Example: `42`. ## Example request ```bash curl -X GET "https://{apiId}.execute-api.us-west-1.amazonaws.com/{stage}/v1/timesheets/42" \ -H "Authorization: Bearer $SEQUIFI_TOKEN" ``` ## Responses ### 200: The timesheet with its time entries. - `status` (integer) Example: `200`. - `message` (string) Example: `success`. - `data` (object): A company timesheet for one employee over a pay period. Internal reviewer columns (reviewer id/note) are never returned. `time_entries` is present on the single-timesheet response only, not in the list. - `id` (integer (int64)) Example: `42`. - `employee_id` (integer (int64)) Example: `1024`. - `period_start` (string (date)) Example: `2024-01-01`. - `period_end` (string (date)) Example: `2024-01-14`. - `status` (string) Example: `submitted`. - `note` (string, nullable) - `submitted_at` (string (date-time), nullable) Example: `2024-01-15T12:00:00.000Z`. - `reviewed_at` (string (date-time), nullable) - `voided_at` (string (date-time), nullable) - `created_at` (string (date-time), nullable) Example: `2024-01-20T12:00:00.000Z`. - `updated_at` (string (date-time), nullable) Example: `2024-01-20T12:00:00.000Z`. - `time_entries` (array of object): Present only on GET /v1/timesheets/{id}. - `id` (integer (int64)) Example: `5001`. - `timesheet_id` (integer (int64)) Example: `42`. - `employee_id` (integer (int64)) Example: `1024`. - `work_date` (string (date)) Example: `2024-01-02`. - `started_at` (string (date-time), nullable) Example: `2024-01-02T16:00:00.000Z`. - `ended_at` (string (date-time), nullable) Example: `2024-01-02T20:00:00.000Z`. - `minutes` (integer) Example: `240`. - `break_minutes` (integer) Example: `0`. - `kind` (string) Example: `worked`. - `source` (string) Example: `manual`. - `job_ref` (string, nullable) Example: `J-1001`. - `job_label` (string, nullable) Example: `Install`. - `note` (string, nullable) - `created_at` (string (date-time), nullable) Example: `2024-01-20T12:00:00.000Z`. - `updated_at` (string (date-time), nullable) Example: `2024-01-20T12:00:00.000Z`. ### 400: The id is not a positive integer. ```json { "status": 400, "message": "invalid timesheet id", "data": null } ``` ### 401: Missing, invalid, expired, or revoked token (from the authorizer). ### 403: The token lacks the required scope. ```json { "error": "insufficient_scope", "required": "users:read" } ``` ### 404: No such timesheet for this company. ```json { "status": 404, "message": "not found", "data": null } ``` ### 500: An infrastructure or data error. The endpoint fails closed — a 500, never a partial or empty-looking result. ```json { "status": 500, "message": "internal error", "data": null } ``` --- # List work locations `GET https://{apiId}.execute-api.us-west-1.amazonaws.com/{stage}/v1/locations` Module: Locations · operationId: `listLocations` · Auth: `Authorization: Bearer ` Web page: https://apidocs.sequipay.com/#/api/list-locations Returns the authenticated company's work locations, paginated, ordered by name. Soft-deleted locations are never returned. Requires the `locations:read` scope. ## Query parameters - `name` (string): Partial, case-insensitive match on the location name. Example: `warehouse`. - `state` (string): Exact match on the 2-letter US state code (case-insensitive). Any other value is ignored. Max length: 2. Example: `TX`. - `page` (integer): 1-based page number. Default: `1`. Minimum: 1. - `per_page` (integer): Page size (max 200). Default: `20`. Minimum: 1. Maximum: 200. ## Example request ```bash curl -X GET "https://{apiId}.execute-api.us-west-1.amazonaws.com/{stage}/v1/locations" \ -H "Authorization: Bearer $SEQUIFI_TOKEN" ``` ## Responses ### 200: A page of work locations. - `status` (integer) Example: `200`. - `message` (string) Example: `success`. - `data` (object) - `locations` (array of object) - `id` (integer (int64)) Example: `3`. - `name` (string) Example: `Austin Warehouse`. - `address_line_1` (string, nullable) Example: `1 Main St`. - `address_line_2` (string, nullable) Example: `Suite 200`. - `address_city` (string, nullable) Example: `Austin`. - `address_state` (string, nullable) Example: `TX`. - `address_zip` (string, nullable) Example: `78701`. - `created_at` (string (date-time), nullable) Example: `2024-01-20T12:00:00.000Z`. - `updated_at` (string (date-time), nullable) Example: `2024-06-01T09:30:00.000Z`. - `current_page` (integer) Example: `1`. - `per_page` (integer) Example: `20`. - `total` (integer) Example: `4`. - `last_page` (integer) Example: `1`. - `filters` (object): Echoes the filters actually applied. ### 401: Missing, invalid, expired, or revoked token (from the authorizer). ### 403: The token lacks the required scope. ```json { "error": "insufficient_scope", "required": "users:read" } ``` ### 500: An infrastructure or data error. The endpoint fails closed — a 500, never a partial or empty-looking result. ```json { "status": 500, "message": "internal error", "data": null } ``` --- # Get one work location `GET https://{apiId}.execute-api.us-west-1.amazonaws.com/{stage}/v1/locations/{id}` Module: Locations · operationId: `getLocation` · Auth: `Authorization: Bearer ` Web page: https://apidocs.sequipay.com/#/api/get-location Returns a single work location by id, scoped to the authenticated company. Soft-deleted locations are not returned. Requires the `locations:read` scope. ## Path parameters - `id` (integer (int64), **required**): The location's numeric id. Minimum: 1. Example: `3`. ## Example request ```bash curl -X GET "https://{apiId}.execute-api.us-west-1.amazonaws.com/{stage}/v1/locations/3" \ -H "Authorization: Bearer $SEQUIFI_TOKEN" ``` ## Responses ### 200: The work location. - `status` (integer) Example: `200`. - `message` (string) Example: `success`. - `data` (object): A company work location. The internal payroll-provider mapping Core holds on this table (`worklio_location_id`) is never returned. - `id` (integer (int64)) Example: `3`. - `name` (string) Example: `Austin Warehouse`. - `address_line_1` (string, nullable) Example: `1 Main St`. - `address_line_2` (string, nullable) Example: `Suite 200`. - `address_city` (string, nullable) Example: `Austin`. - `address_state` (string, nullable) Example: `TX`. - `address_zip` (string, nullable) Example: `78701`. - `created_at` (string (date-time), nullable) Example: `2024-01-20T12:00:00.000Z`. - `updated_at` (string (date-time), nullable) Example: `2024-06-01T09:30:00.000Z`. ### 400: The id is not a positive integer. ```json { "status": 400, "message": "invalid location id", "data": null } ``` ### 401: Missing, invalid, expired, or revoked token (from the authorizer). ### 403: The token lacks the required scope. ```json { "error": "insufficient_scope", "required": "users:read" } ``` ### 404: No such location for this company. ```json { "status": 404, "message": "not found", "data": null } ``` ### 500: An infrastructure or data error. The endpoint fails closed — a 500, never a partial or empty-looking result. ```json { "status": 500, "message": "internal error", "data": null } ``` --- # List verification steps `GET https://{apiId}.execute-api.us-west-1.amazonaws.com/{stage}/v1/onboarding` Module: Onboarding · operationId: `listOnboardingSteps` · Auth: `Authorization: Bearer ` Web page: https://apidocs.sequipay.com/#/api/list-onboarding-steps Returns the authenticated company's worker verification (onboarding) steps, paginated, grouped by worker then in the order they appeared. Filter by `employee_id` to get one worker's onboarding. Soft-deleted steps are never returned. Internal reviewer-identity columns are never returned. Requires the `onboarding:read` scope. ## Query parameters - `employee_id` (integer (int64)): Exact match on the employee id. Minimum: 1. Example: `1024`. - `state` (string): Exact match on the step state (e.g. open, completed). Example: `open`. - `kind` (string): Exact match on the step kind (e.g. i9, w4, bank). Example: `i9`. - `page` (integer): 1-based page number. Default: `1`. Minimum: 1. - `per_page` (integer): Page size (max 200). Default: `20`. Minimum: 1. Maximum: 200. ## Example request ```bash curl -X GET "https://{apiId}.execute-api.us-west-1.amazonaws.com/{stage}/v1/onboarding" \ -H "Authorization: Bearer $SEQUIFI_TOKEN" ``` ## Responses ### 200: A page of verification steps. - `status` (integer) Example: `200`. - `message` (string) Example: `success`. - `data` (object) - `steps` (array of object) - `id` (integer (int64)) Example: `1`. - `employee_id` (integer (int64)) Example: `1024`. - `kind` (string) Example: `i9`. - `state` (string) Example: `completed`. - `ready` (boolean, nullable): Whether the step is ready to act on; `null` when Core has no value. Example: `true`. - `first_seen_at` (string (date-time), nullable) Example: `2024-01-01T09:00:00.000Z`. - `completed_at` (string (date-time), nullable) Example: `2024-01-20T12:00:00.000Z`. - `created_at` (string (date-time), nullable) Example: `2024-01-20T12:00:00.000Z`. - `updated_at` (string (date-time), nullable) Example: `2024-01-20T12:00:00.000Z`. - `current_page` (integer) Example: `1`. - `per_page` (integer) Example: `20`. - `total` (integer) Example: `6`. - `last_page` (integer) Example: `1`. - `filters` (object): Echoes the filters actually applied. ### 401: Missing, invalid, expired, or revoked token (from the authorizer). ### 403: The token lacks the required scope. ```json { "error": "insufficient_scope", "required": "users:read" } ``` ### 500: An infrastructure or data error. The endpoint fails closed — a 500, never a partial or empty-looking result. ```json { "status": 500, "message": "internal error", "data": null } ``` --- # Get one verification step `GET https://{apiId}.execute-api.us-west-1.amazonaws.com/{stage}/v1/onboarding/{id}` Module: Onboarding · operationId: `getOnboardingStep` · Auth: `Authorization: Bearer ` Web page: https://apidocs.sequipay.com/#/api/get-onboarding-step Returns a single worker verification step by id, scoped to the authenticated company. Soft-deleted steps are not returned. Internal reviewer-identity columns are never returned. Requires the `onboarding:read` scope. ## Path parameters - `id` (integer (int64), **required**): The verification step's numeric id. Minimum: 1. Example: `1`. ## Example request ```bash curl -X GET "https://{apiId}.execute-api.us-west-1.amazonaws.com/{stage}/v1/onboarding/1" \ -H "Authorization: Bearer $SEQUIFI_TOKEN" ``` ## Responses ### 200: The verification step. - `status` (integer) Example: `200`. - `message` (string) Example: `success`. - `data` (object): A worker verification (onboarding) step. Internal reviewer-identity columns Core holds on this table (`handled_by`, `completed_by`, `completed_by_user_id`) are never returned. - `id` (integer (int64)) Example: `1`. - `employee_id` (integer (int64)) Example: `1024`. - `kind` (string) Example: `i9`. - `state` (string) Example: `completed`. - `ready` (boolean, nullable): Whether the step is ready to act on; `null` when Core has no value. Example: `true`. - `first_seen_at` (string (date-time), nullable) Example: `2024-01-01T09:00:00.000Z`. - `completed_at` (string (date-time), nullable) Example: `2024-01-20T12:00:00.000Z`. - `created_at` (string (date-time), nullable) Example: `2024-01-20T12:00:00.000Z`. - `updated_at` (string (date-time), nullable) Example: `2024-01-20T12:00:00.000Z`. ### 400: The id is not a positive integer. ```json { "status": 400, "message": "invalid onboarding step id", "data": null } ``` ### 401: Missing, invalid, expired, or revoked token (from the authorizer). ### 403: The token lacks the required scope. ```json { "error": "insufficient_scope", "required": "users:read" } ``` ### 404: No such verification step for this company. ```json { "status": 404, "message": "not found", "data": null } ``` ### 500: An infrastructure or data error. The endpoint fails closed — a 500, never a partial or empty-looking result. ```json { "status": 500, "message": "internal error", "data": null } ``` --- # List worker documents `GET https://{apiId}.execute-api.us-west-1.amazonaws.com/{stage}/v1/documents` Module: Documents · operationId: `listDocuments` · Auth: `Authorization: Bearer ` Web page: https://apidocs.sequipay.com/#/api/list-documents Returns the authenticated company's worker-document records, paginated, grouped by worker then by document type. Filter by `employee_id` to get one worker's documents. Returns document METADATA only — never the document files, the tax/withholding election detail, or the signer's IP, and never owner KYC identity documents. Soft-deleted documents are never returned. Requires the `documents:read` scope. ## Query parameters - `employee_id` (integer (int64)): Exact match on the employee id. Minimum: 1. Example: `1024`. - `document_type` (string): Exact match on the document type. Example: `w4`. - `completed` (boolean): Filter by completion. Truthy values (`1`, `true`, `yes`) return only completed documents; falsy values return only incomplete ones. Example: `true`. - `page` (integer): 1-based page number. Default: `1`. Minimum: 1. - `per_page` (integer): Page size (max 200). Default: `20`. Minimum: 1. Maximum: 200. ## Example request ```bash curl -X GET "https://{apiId}.execute-api.us-west-1.amazonaws.com/{stage}/v1/documents" \ -H "Authorization: Bearer $SEQUIFI_TOKEN" ``` ## Responses ### 200: A page of worker documents. - `status` (integer) Example: `200`. - `message` (string) Example: `success`. - `data` (object) - `documents` (array of object) - `id` (integer (int64)) Example: `1`. - `employee_id` (integer (int64)) Example: `1024`. - `document_type` (string) Example: `w4`. - `document_version` (string) Example: `2024`. - `signer_name` (string, nullable) Example: `Jane Doe`. - `completed` (boolean) Example: `true`. - `completed_at` (string (date-time), nullable) Example: `2024-01-20T12:00:00.000Z`. - `created_at` (string (date-time), nullable) Example: `2024-01-20T12:00:00.000Z`. - `updated_at` (string (date-time), nullable) Example: `2024-01-20T12:00:00.000Z`. - `current_page` (integer) Example: `1`. - `per_page` (integer) Example: `20`. - `total` (integer) Example: `3`. - `last_page` (integer) Example: `1`. - `filters` (object): Echoes the filters actually applied. ### 401: Missing, invalid, expired, or revoked token (from the authorizer). ### 403: The token lacks the required scope. ```json { "error": "insufficient_scope", "required": "users:read" } ``` ### 500: An infrastructure or data error. The endpoint fails closed — a 500, never a partial or empty-looking result. ```json { "status": 500, "message": "internal error", "data": null } ``` --- # Get one worker document `GET https://{apiId}.execute-api.us-west-1.amazonaws.com/{stage}/v1/documents/{id}` Module: Documents · operationId: `getDocument` · Auth: `Authorization: Bearer ` Web page: https://apidocs.sequipay.com/#/api/get-document Returns a single worker-document record by id, scoped to the authenticated company. Returns metadata only (never the file, election detail, or signer IP). Soft-deleted documents are not returned. Requires the `documents:read` scope. ## Path parameters - `id` (integer (int64), **required**): The document's numeric id. Minimum: 1. Example: `1`. ## Example request ```bash curl -X GET "https://{apiId}.execute-api.us-west-1.amazonaws.com/{stage}/v1/documents/1" \ -H "Authorization: Bearer $SEQUIFI_TOKEN" ``` ## Responses ### 200: The worker document. - `status` (integer) Example: `200`. - `message` (string) Example: `success`. - `data` (object): A worker-document record (metadata). Sensitive columns Core holds on this table (`elections`, `ip_address`) and the document files themselves are never returned; owner KYC identity documents are never exposed by this endpoint. - `id` (integer (int64)) Example: `1`. - `employee_id` (integer (int64)) Example: `1024`. - `document_type` (string) Example: `w4`. - `document_version` (string) Example: `2024`. - `signer_name` (string, nullable) Example: `Jane Doe`. - `completed` (boolean) Example: `true`. - `completed_at` (string (date-time), nullable) Example: `2024-01-20T12:00:00.000Z`. - `created_at` (string (date-time), nullable) Example: `2024-01-20T12:00:00.000Z`. - `updated_at` (string (date-time), nullable) Example: `2024-01-20T12:00:00.000Z`. ### 400: The id is not a positive integer. ```json { "status": 400, "message": "invalid document id", "data": null } ``` ### 401: Missing, invalid, expired, or revoked token (from the authorizer). ### 403: The token lacks the required scope. ```json { "error": "insufficient_scope", "required": "users:read" } ``` ### 404: No such document for this company. ```json { "status": 404, "message": "not found", "data": null } ``` ### 500: An infrastructure or data error. The endpoint fails closed — a 500, never a partial or empty-looking result. ```json { "status": 500, "message": "internal error", "data": null } ```