API reference
Stubsmith exposes two separate HTTP services. The ingest endpoint (POST /v1/captures) is served by the Go ingest service at https://ingest.stubsmith.dev. All other endpoints are served by the Node API at the app hostname. Both authenticate with Authorization: Bearer <project-key>; the ingest service also accepts the key in an X-Project-Token header. Dashboard operations use the session the dashboard signs in with, an HttpOnly cookie set by POST /v1/auth/login; it is not exposed to scripts or returned in the response. Where the table says JWT, the caller must hold the organisation admin role; other members receive 403.
| Method | Path | Auth | Purpose |
|---|---|---|---|
| POST | /v1/captures | Project key | Ingest a captured request/response (ingest service: https://ingest.stubsmith.dev) |
| GET | /v1/captures | JWT or project key | List captures for a project (newest first, max 100) |
| GET | /v1/captures/:id | JWT or project key | Full capture detail; append ?includeBodies=true to resolve offloaded body references |
| GET | /v1/request-types | JWT or project key | List request types (method, path, pattern, and pending/approved/rejected fingerprint counts) for a project |
| GET | /v1/request-types/:id | JWT or project key | Full detail including fingerprints, response variants, and field rules |
| PUT | /v1/request-types/:id/pattern | JWT or project key | Set a path pattern; absorbs matching concrete request type rows |
| GET | /v1/projects/:id/path-suggestions | JWT (org admin) | Suggested path patterns for request types that differ in one segment, with the number each would fold and example values. Accept one with the pattern route above on its request_type_id |
| POST | /v1/projects/:id/path-suggestions/dismiss | JWT (org admin) | Dismiss a suggestion permanently; body {domain, method, pattern} |
| DELETE | /v1/request-types/:id | JWT (org admin) or project key | Delete a request type along with its captures and stored bodies. A project key alone is sufficient, so treat project keys as capable of deleting stored fixtures |
| POST | /v1/review/:fingerprint_id/decision | Org-admin JWT or org API key with review:approve scope | Approve or reject a pending fingerprint; submit field_rules on approve. The pushed_capture field has been removed: a request that includes it is refused with 400. Project keys cannot review |
| POST | /v1/review/:fingerprint_id/reopen | Org-admin JWT or org API key with review:approve scope | Send an approved or rejected fingerprint back to pending |
| GET | /v1/review/queue | Org-admin JWT or org API key with review:read scope | List pending fingerprints awaiting review |
| PUT | /v1/request-types/:id/fingerprints/:fingerprintId/rules | Org-admin JWT | Update field_rules on an already-approved fingerprint; project keys are explicitly excluded. Editing masking rules is a privileged privacy action |
| GET | /v1/anonymizer/rules | JWT or project key | List named global anonymizer rule sets for a project |
| POST | /v1/anonymizer/rules | Org-admin JWT | Create a new named rule set; 409 if name already exists |
| PUT | /v1/anonymizer/rules/:id | Org-admin JWT | Partially update a rule set, accepts any combination of name, rules, and enabled |
| DELETE | /v1/anonymizer/rules/:id | Org-admin JWT | Delete a rule set. Project keys get 403 on all three rule-set writes; they keep read access for the sync |
| GET | /v1/sdk/sync | Project key | SDK rule sync: returns field_rules delta since cursor, path templates, merged global rule sets, per-request-type value-path config, and the project's email placeholder domain |
| GET | /v1/rules | JWT or project key | All approved field rules for a project in one list |
| GET | /v1/alerts | JWT or project key | List capture alerts |
| GET | /v1/fixtures | JWT or project key | Fetch fixture variants for a request type (see Using fixtures) |
| GET | /v1/replay/bundle | Project key | Fetch the offline replay bundle used by stubsmith pull and stubsmith.replay() (see Replay bundles) |