fixes
This commit is contained in:
1 parent
6586722652
commit
1e7c7bbfbb
65 files changed
+1345
-640
No files matched your search
@@ -18,12 +18,9 @@ info:
|
||||
## Authentication
|
||||
|
||||
Public /api/v1 operations require a company API key (Bearer or X-API-Key)
|
||||
except GET /health and GET /openapi.yaml. Dashboard-only Team/Admin
|
||||
operations described separately use a signed-in session and CSRF header;
|
||||
they are not executable with a company API key.
|
||||
except GET /health and GET /openapi.yaml.
|
||||
|
||||
Document-level security is BearerAuth OR ApiKeyAuth (same key value).
|
||||
Do not send dashboard session cookies or CSRF tokens to /api/v1.
|
||||
|
||||
### Security schemes (components.securitySchemes)
|
||||
|
||||
@@ -38,10 +35,8 @@ info:
|
||||
|
||||
1. Sign in at https://api.descrybe.io
|
||||
2. Open Settings -> API keys (/settings?tab=api-keys)
|
||||
3. Company admins or teammates granted API Keys management permission create
|
||||
a key via dashboard POST /api/api-keys
|
||||
(session cookie + CSRF; not this public OpenAPI surface). The secret is
|
||||
shown once and starts with dk_.
|
||||
3. Authorized users can create keys in Settings -> API keys. The secret is
|
||||
shown once and starts with dk_.
|
||||
4. Store it securely. Later list/revoke shows only key_prefix (first 10
|
||||
characters). Revoked keys fail auth immediately.
|
||||
|
||||
@@ -64,22 +59,19 @@ info:
|
||||
|
||||
### 403 Forbidden
|
||||
|
||||
Bad API keys on /api/v1 never return 403 (always 401). Tenant scope comes
|
||||
from the key; cross-company resources typically 404. HTTP 403 appears on
|
||||
dashboard /api/* session routes (admin required, CSRF mismatch) under
|
||||
Team/Admin tags (SessionCookie + CSRFHeader) - not this public key surface.
|
||||
Invalid API keys return 401. Access to unrelated company resources
|
||||
is denied by tenant-scoped authorization.
|
||||
|
||||
### Rate limits
|
||||
|
||||
Heavy mutations are limited to 30 requests per minute per company
|
||||
(in-process per API replica; not shared across replicas). Counts HTTP
|
||||
requests, not products inside a bulk body. Limited POST paths:
|
||||
Processing and feed mutations are rate limited. Counts are per HTTP
|
||||
request, not per product in a batch. Limited POST paths:
|
||||
|
||||
- /products/process, /process, /process/{id}/retry
|
||||
- /feeds/{id}/sync, /feeds/{id}/extract-schema, /feeds/{id}/sync-process-sample
|
||||
- /export-feeds/{id}/generate, /export-feeds/{id}/export-products, /export-feeds/{id}/rotate-token (admin)
|
||||
- /export-feeds/{id}/generate, /export-feeds/{id}/export-products, /export-feeds/{id}/rotate-token
|
||||
|
||||
Over limit: HTTP 429, header Retry-After: 60, body
|
||||
Over limit: HTTP 429 with Retry-After and body
|
||||
{ "error": "rate limit exceeded" } (see TooManyRequests). Ordinary GETs and
|
||||
other mutations are outside this HTTP budget (process starts may still return
|
||||
402 for plan/credits).
|
||||
@@ -104,8 +96,8 @@ info:
|
||||
- Plan gates (credits / product limit / AI / EPREL / feature flags) run before
|
||||
EnsureRaw catalog writes on the items[].ean path; blocked starts return HTTP 402
|
||||
|
||||
2. **Internal / dashboard-style jobs**
|
||||
- POST /process with raw_product_ids (same body as POST /api/processing/jobs)
|
||||
2. **Product processing jobs**
|
||||
- POST /process with existing raw_product_ids
|
||||
- GET /process, GET /process/{id}, cancel/terminate/retry
|
||||
- Flat JSON (no data wrapper); 202 Accepted on start/retry
|
||||
- Plan gates return HTTP 402 with PlanGateError (error + code + upgrade_url)
|
||||
@@ -142,8 +134,7 @@ info:
|
||||
product titles or descriptions. Company feature policies may still suppress
|
||||
metadata output.
|
||||
|
||||
Note: Dashboard JSON under /api/* uses session cookies + CSRF and is separate
|
||||
from this public API-key surface. Other path aliases
|
||||
Other path aliases
|
||||
(/categories/create, /attributes/create, /campaigns) appear next to canonical paths.
|
||||
servers:
|
||||
- url: https://api.descrybe.io/api/v1
|
||||
@@ -161,10 +152,6 @@ tags:
|
||||
- name: Campaigns
|
||||
description: Seasonal content calendar (/campaigns aliases)
|
||||
- name: Processing
|
||||
- name: Team
|
||||
description: Dashboard session routes under /api (not API-key)
|
||||
- name: Admin
|
||||
description: Platform-admin dashboard routes under /api (not API-key)
|
||||
paths:
|
||||
/health:
|
||||
get:
|
||||
@@ -498,7 +485,7 @@ paths:
|
||||
responses:
|
||||
'200':
|
||||
description: Selected products returned to unprocessed. Returned when ResetProductsToUnprocessed
|
||||
commits. Requires company-admin capability (API keys use role api and pass).
|
||||
commits. Requires a valid company API key.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
@@ -528,14 +515,14 @@ paths:
|
||||
example:
|
||||
error: product_ids is required
|
||||
'403':
|
||||
description: Caller role is neither admin nor api (requireCompanyAdmin). Valid company API keys
|
||||
description: Access denied. Valid company API keys
|
||||
use role api and do not hit this.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/FlatAPIError"
|
||||
example:
|
||||
error: admin required
|
||||
error: forbidden
|
||||
'500':
|
||||
description: Unexpected reset failure after validation.
|
||||
content:
|
||||
@@ -642,15 +629,13 @@ paths:
|
||||
example:
|
||||
error: internal error
|
||||
'403':
|
||||
description: Insufficient role or wrong company. On API-key routes, cross-tenant ids usually
|
||||
return 404 instead. requireCompanyAdmin returns flat 'admin required' for session non-admin
|
||||
callers (API keys use role api and pass).
|
||||
description: Access denied or resource unavailable to this company.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/FlatAPIError"
|
||||
example:
|
||||
error: admin required
|
||||
error: forbidden
|
||||
'422':
|
||||
description: Validation failed. Current public v1 handlers emit these cases as HTTP 400 (flat
|
||||
or coded). 422 is documented for clients that expect an explicit validation status; body matches
|
||||
@@ -762,15 +747,13 @@ paths:
|
||||
example:
|
||||
error: internal error
|
||||
'403':
|
||||
description: Insufficient role or wrong company. On API-key routes, cross-tenant ids usually
|
||||
return 404 instead. requireCompanyAdmin returns flat 'admin required' for session non-admin
|
||||
callers (API keys use role api and pass).
|
||||
description: Access denied or resource unavailable to this company.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/FlatAPIError"
|
||||
example:
|
||||
error: admin required
|
||||
error: forbidden
|
||||
'404':
|
||||
description: Resource id not found for this API-key company (or wrong tenant).
|
||||
content:
|
||||
@@ -1034,15 +1017,13 @@ paths:
|
||||
code: unauthorized
|
||||
message: Unauthorized
|
||||
'403':
|
||||
description: Insufficient role or wrong company. On API-key routes, cross-tenant ids usually
|
||||
return 404 instead. requireCompanyAdmin returns flat 'admin required' for session non-admin
|
||||
callers (API keys use role api and pass).
|
||||
description: Access denied or resource unavailable to this company.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/FlatAPIError"
|
||||
example:
|
||||
error: admin required
|
||||
error: forbidden
|
||||
'422':
|
||||
description: Validation failed. Current public v1 handlers emit these cases as HTTP 400 (flat
|
||||
or coded). 422 is documented for clients that expect an explicit validation status; body matches
|
||||
@@ -1350,15 +1331,13 @@ paths:
|
||||
code: unauthorized
|
||||
message: Unauthorized
|
||||
'403':
|
||||
description: Insufficient role or wrong company. On API-key routes, cross-tenant ids usually
|
||||
return 404 instead. requireCompanyAdmin returns flat 'admin required' for session non-admin
|
||||
callers (API keys use role api and pass).
|
||||
description: Access denied or resource unavailable to this company.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/FlatAPIError"
|
||||
example:
|
||||
error: admin required
|
||||
error: forbidden
|
||||
'422':
|
||||
description: Validation failed. Current public v1 handlers emit these cases as HTTP 400 (flat
|
||||
or coded). 422 is documented for clients that expect an explicit validation status; body matches
|
||||
@@ -1467,15 +1446,13 @@ paths:
|
||||
example:
|
||||
error: internal error
|
||||
'403':
|
||||
description: Insufficient role or wrong company. On API-key routes, cross-tenant ids usually
|
||||
return 404 instead. requireCompanyAdmin returns flat 'admin required' for session non-admin
|
||||
callers (API keys use role api and pass).
|
||||
description: Access denied or resource unavailable to this company.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/FlatAPIError"
|
||||
example:
|
||||
error: admin required
|
||||
error: forbidden
|
||||
'422':
|
||||
description: Validation failed. Current public v1 handlers emit these cases as HTTP 400 (flat
|
||||
or coded). 422 is documented for clients that expect an explicit validation status; body matches
|
||||
@@ -1550,15 +1527,13 @@ paths:
|
||||
code: unauthorized
|
||||
message: Unauthorized
|
||||
'403':
|
||||
description: Insufficient role or wrong company. On API-key routes, cross-tenant ids usually
|
||||
return 404 instead. requireCompanyAdmin returns flat 'admin required' for session non-admin
|
||||
callers (API keys use role api and pass).
|
||||
description: Access denied or resource unavailable to this company.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/FlatAPIError"
|
||||
example:
|
||||
error: admin required
|
||||
error: forbidden
|
||||
'422':
|
||||
description: Validation failed. Current public v1 handlers emit these cases as HTTP 400 (flat
|
||||
or coded). 422 is documented for clients that expect an explicit validation status; body matches
|
||||
@@ -1931,15 +1906,13 @@ paths:
|
||||
example:
|
||||
error: internal error
|
||||
'403':
|
||||
description: Insufficient role or wrong company. On API-key routes, cross-tenant ids usually
|
||||
return 404 instead. requireCompanyAdmin returns flat 'admin required' for session non-admin
|
||||
callers (API keys use role api and pass).
|
||||
description: Access denied or resource unavailable to this company.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/FlatAPIError"
|
||||
example:
|
||||
error: admin required
|
||||
error: forbidden
|
||||
'422':
|
||||
description: Validation failed. Current public v1 handlers emit these cases as HTTP 400 (flat
|
||||
or coded). 422 is documented for clients that expect an explicit validation status; body matches
|
||||
@@ -2013,15 +1986,13 @@ paths:
|
||||
code: unauthorized
|
||||
message: Unauthorized
|
||||
'403':
|
||||
description: Insufficient role or wrong company. On API-key routes, cross-tenant ids usually
|
||||
return 404 instead. requireCompanyAdmin returns flat 'admin required' for session non-admin
|
||||
callers (API keys use role api and pass).
|
||||
description: Access denied or resource unavailable to this company.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/FlatAPIError"
|
||||
example:
|
||||
error: admin required
|
||||
error: forbidden
|
||||
'422':
|
||||
description: Validation failed. Current public v1 handlers emit these cases as HTTP 400 (flat
|
||||
or coded). 422 is documented for clients that expect an explicit validation status; body matches
|
||||
@@ -2321,15 +2292,13 @@ paths:
|
||||
code: unauthorized
|
||||
message: Unauthorized
|
||||
'403':
|
||||
description: Insufficient role or wrong company. On API-key routes, cross-tenant ids usually
|
||||
return 404 instead. requireCompanyAdmin returns flat 'admin required' for session non-admin
|
||||
callers (API keys use role api and pass).
|
||||
description: Access denied or resource unavailable to this company.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/FlatAPIError"
|
||||
example:
|
||||
error: admin required
|
||||
error: forbidden
|
||||
'422':
|
||||
description: Validation failed. Current public v1 handlers emit these cases as HTTP 400 (flat
|
||||
or coded). 422 is documented for clients that expect an explicit validation status; body matches
|
||||
@@ -2447,15 +2416,13 @@ paths:
|
||||
example:
|
||||
error: internal error
|
||||
'403':
|
||||
description: Insufficient role or wrong company. On API-key routes, cross-tenant ids usually
|
||||
return 404 instead. requireCompanyAdmin returns flat 'admin required' for session non-admin
|
||||
callers (API keys use role api and pass).
|
||||
description: Access denied or resource unavailable to this company.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/FlatAPIError"
|
||||
example:
|
||||
error: admin required
|
||||
error: forbidden
|
||||
'422':
|
||||
description: Validation failed. Current public v1 handlers emit these cases as HTTP 400 (flat
|
||||
or coded). 422 is documented for clients that expect an explicit validation status; body matches
|
||||
@@ -2482,7 +2449,7 @@ paths:
|
||||
- Feeds
|
||||
summary: Delete feed
|
||||
description: >-
|
||||
Company-admin only. Atomically removes the input feed and its exclusively
|
||||
Removes the input feed and its exclusively
|
||||
owned, unprocessed or failed raw products. Previously processed products
|
||||
are retained; active processing rows are not deleted, and products shared
|
||||
with another existing feed are reassigned to that feed. Flat response
|
||||
@@ -2508,13 +2475,13 @@ paths:
|
||||
example:
|
||||
error: invalid id
|
||||
'403':
|
||||
description: requireCompanyAdmin rejected the caller (session non-admin). API keys pass.
|
||||
description: Access denied.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/FlatAPIError"
|
||||
example:
|
||||
error: admin required
|
||||
error: forbidden
|
||||
'404':
|
||||
description: Feed not found.
|
||||
content:
|
||||
@@ -2608,15 +2575,13 @@ paths:
|
||||
code: not_found
|
||||
message: Feed not found
|
||||
'403':
|
||||
description: Insufficient role or wrong company. On API-key routes, cross-tenant ids usually
|
||||
return 404 instead. requireCompanyAdmin returns flat 'admin required' for session non-admin
|
||||
callers (API keys use role api and pass).
|
||||
description: Access denied or resource unavailable to this company.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/FlatAPIError"
|
||||
example:
|
||||
error: admin required
|
||||
error: forbidden
|
||||
'422':
|
||||
description: Validation failed. Current public v1 handlers emit these cases as HTTP 400 (flat
|
||||
or coded). 422 is documented for clients that expect an explicit validation status; body matches
|
||||
@@ -2726,15 +2691,13 @@ paths:
|
||||
code: unauthorized
|
||||
message: Unauthorized
|
||||
'403':
|
||||
description: Insufficient role or wrong company. On API-key routes, cross-tenant ids usually
|
||||
return 404 instead. requireCompanyAdmin returns flat 'admin required' for session non-admin
|
||||
callers (API keys use role api and pass).
|
||||
description: Access denied or resource unavailable to this company.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/FlatAPIError"
|
||||
example:
|
||||
error: admin required
|
||||
error: forbidden
|
||||
'422':
|
||||
description: Validation failed. Current public v1 handlers emit these cases as HTTP 400 (flat
|
||||
or coded). 422 is documented for clients that expect an explicit validation status; body matches
|
||||
@@ -2834,15 +2797,13 @@ paths:
|
||||
example:
|
||||
error: internal error
|
||||
'403':
|
||||
description: Insufficient role or wrong company. On API-key routes, cross-tenant ids usually
|
||||
return 404 instead. requireCompanyAdmin returns flat 'admin required' for session non-admin
|
||||
callers (API keys use role api and pass).
|
||||
description: Access denied or resource unavailable to this company.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/FlatAPIError"
|
||||
example:
|
||||
error: admin required
|
||||
error: forbidden
|
||||
'422':
|
||||
description: Validation failed. Current public v1 handlers emit these cases as HTTP 400 (flat
|
||||
or coded). 422 is documented for clients that expect an explicit validation status; body matches
|
||||
@@ -2934,15 +2895,13 @@ paths:
|
||||
code: unauthorized
|
||||
message: Unauthorized
|
||||
'403':
|
||||
description: Insufficient role or wrong company. On API-key routes, cross-tenant ids usually
|
||||
return 404 instead. requireCompanyAdmin returns flat 'admin required' for session non-admin
|
||||
callers (API keys use role api and pass).
|
||||
description: Access denied or resource unavailable to this company.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/FlatAPIError"
|
||||
example:
|
||||
error: admin required
|
||||
error: forbidden
|
||||
'422':
|
||||
description: Validation failed. Current public v1 handlers emit these cases as HTTP 400 (flat
|
||||
or coded). 422 is documented for clients that expect an explicit validation status; body matches
|
||||
@@ -2971,7 +2930,7 @@ paths:
|
||||
- Feeds
|
||||
summary: Sync feed then process a sample of raw products
|
||||
description: |
|
||||
Optionally syncs the feed, then starts dashboard-style processing for up to N raw products
|
||||
Optionally syncs the feed, then starts processing for up to N raw products
|
||||
(default 10, max 100). Flat JSON; HTTP 202 when a job is queued, 200 when sync finishes with no products.
|
||||
parameters:
|
||||
- $ref: "#/components/parameters/ID"
|
||||
@@ -3061,15 +3020,13 @@ paths:
|
||||
code: unauthorized
|
||||
message: Unauthorized
|
||||
'403':
|
||||
description: Insufficient role or wrong company. On API-key routes, cross-tenant ids usually
|
||||
return 404 instead. requireCompanyAdmin returns flat 'admin required' for session non-admin
|
||||
callers (API keys use role api and pass).
|
||||
description: Access denied or resource unavailable to this company.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/FlatAPIError"
|
||||
example:
|
||||
error: admin required
|
||||
error: forbidden
|
||||
'422':
|
||||
description: Validation failed. Current public v1 handlers emit these cases as HTTP 400 (flat
|
||||
or coded). 422 is documented for clients that expect an explicit validation status; body matches
|
||||
@@ -3342,15 +3299,13 @@ paths:
|
||||
code: unauthorized
|
||||
message: Unauthorized
|
||||
'403':
|
||||
description: Insufficient role or wrong company. On API-key routes, cross-tenant ids usually
|
||||
return 404 instead. requireCompanyAdmin returns flat 'admin required' for session non-admin
|
||||
callers (API keys use role api and pass).
|
||||
description: Access denied or resource unavailable to this company.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/FlatAPIError"
|
||||
example:
|
||||
error: admin required
|
||||
error: forbidden
|
||||
'422':
|
||||
description: Validation failed. Current public v1 handlers emit these cases as HTTP 400 (flat
|
||||
or coded). 422 is documented for clients that expect an explicit validation status; body matches
|
||||
@@ -3450,15 +3405,13 @@ paths:
|
||||
example:
|
||||
error: internal error
|
||||
'403':
|
||||
description: Insufficient role or wrong company. On API-key routes, cross-tenant ids usually
|
||||
return 404 instead. requireCompanyAdmin returns flat 'admin required' for session non-admin
|
||||
callers (API keys use role api and pass).
|
||||
description: Access denied or resource unavailable to this company.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/FlatAPIError"
|
||||
example:
|
||||
error: admin required
|
||||
error: forbidden
|
||||
'422':
|
||||
description: Validation failed. Current public v1 handlers emit these cases as HTTP 400 (flat
|
||||
or coded). 422 is documented for clients that expect an explicit validation status; body matches
|
||||
@@ -3484,10 +3437,10 @@ paths:
|
||||
tags:
|
||||
- Export feeds
|
||||
summary: Delete export feed
|
||||
description: "Company-admin only. Flat { status: ok } (not SuccessMessage)."
|
||||
description: "Delete an export feed. Returns a deletion confirmation."
|
||||
responses:
|
||||
'200':
|
||||
description: Export feed deleted (admin capability; API keys pass). Flat deleted marker.
|
||||
description: Export feed deleted.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
@@ -3504,13 +3457,13 @@ paths:
|
||||
example:
|
||||
error: invalid id
|
||||
'403':
|
||||
description: requireCompanyAdmin rejected session non-admin.
|
||||
description: Access denied.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/FlatAPIError"
|
||||
example:
|
||||
error: admin required
|
||||
error: forbidden
|
||||
'404':
|
||||
description: Export feed not found.
|
||||
content:
|
||||
@@ -3640,15 +3593,13 @@ paths:
|
||||
example:
|
||||
error: internal error
|
||||
'403':
|
||||
description: Insufficient role or wrong company. On API-key routes, cross-tenant ids usually
|
||||
return 404 instead. requireCompanyAdmin returns flat 'admin required' for session non-admin
|
||||
callers (API keys use role api and pass).
|
||||
description: Access denied or resource unavailable to this company.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/FlatAPIError"
|
||||
example:
|
||||
error: admin required
|
||||
error: forbidden
|
||||
'422':
|
||||
description: Validation failed. Current public v1 handlers emit these cases as HTTP 400 (flat
|
||||
or coded). 422 is documented for clients that expect an explicit validation status; body matches
|
||||
@@ -3677,7 +3628,7 @@ paths:
|
||||
summary: Rotate public export URL token
|
||||
description: |
|
||||
Replaces public_token so the previous /api/public/export-feeds/{token}.{xml|csv|json}
|
||||
URL stops working immediately. Requires company admin (or platform staff).
|
||||
URL stops working immediately.
|
||||
Response is a flat ExportFeedDetail including the new public_token.
|
||||
parameters:
|
||||
- $ref: "#/components/parameters/ID"
|
||||
@@ -3703,13 +3654,13 @@ paths:
|
||||
schema:
|
||||
$ref: "#/components/schemas/CodedAPIError"
|
||||
'403':
|
||||
description: Admin required.
|
||||
description: Access denied.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/FlatAPIError"
|
||||
example:
|
||||
error: admin required
|
||||
error: forbidden
|
||||
"400": { $ref: "#/components/responses/BadRequest" }
|
||||
"422": { $ref: "#/components/responses/ValidationError" }
|
||||
"500": { $ref: "#/components/responses/InternalServerError" }
|
||||
@@ -3792,15 +3743,13 @@ paths:
|
||||
code: unauthorized
|
||||
message: Unauthorized
|
||||
'403':
|
||||
description: Insufficient role or wrong company. On API-key routes, cross-tenant ids usually
|
||||
return 404 instead. requireCompanyAdmin returns flat 'admin required' for session non-admin
|
||||
callers (API keys use role api and pass).
|
||||
description: Access denied or resource unavailable to this company.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/FlatAPIError"
|
||||
example:
|
||||
error: admin required
|
||||
error: forbidden
|
||||
'422':
|
||||
description: Validation failed. Current public v1 handlers emit these cases as HTTP 400 (flat
|
||||
or coded). 422 is documented for clients that expect an explicit validation status; body matches
|
||||
@@ -3901,15 +3850,13 @@ paths:
|
||||
code: unauthorized
|
||||
message: Unauthorized
|
||||
'403':
|
||||
description: Insufficient role or wrong company. On API-key routes, cross-tenant ids usually
|
||||
return 404 instead. requireCompanyAdmin returns flat 'admin required' for session non-admin
|
||||
callers (API keys use role api and pass).
|
||||
description: Access denied or resource unavailable to this company.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/FlatAPIError"
|
||||
example:
|
||||
error: admin required
|
||||
error: forbidden
|
||||
'422':
|
||||
description: Validation failed. Current public v1 handlers emit these cases as HTTP 400 (flat
|
||||
or coded). 422 is documented for clients that expect an explicit validation status; body matches
|
||||
@@ -4294,7 +4241,7 @@ paths:
|
||||
- $ref: "#/components/parameters/Limit"
|
||||
responses:
|
||||
'200':
|
||||
description: "Recent dashboard-style jobs. Flat object with jobs[] and limit (handleV1ListProcessJobs\
|
||||
description: "Recent processing jobs. Flat object with jobs[] and limit (\
|
||||
\ — not a data envelope)."
|
||||
content:
|
||||
application/json:
|
||||
@@ -4343,7 +4290,7 @@ paths:
|
||||
summary: Start processing job by raw_product_ids
|
||||
description: |
|
||||
Enqueues AI processing for existing raw product UUIDs.
|
||||
Same pipeline as dashboard POST /api/processing/jobs.
|
||||
Uses the standard product processing pipeline.
|
||||
Flat JSON body/response (no data wrapper); HTTP 202.
|
||||
Pass raw_products.id only (GET /products data[].raw_product_id), never PresentProduct.id.
|
||||
|
||||
@@ -4505,15 +4452,13 @@ paths:
|
||||
example:
|
||||
error: internal error
|
||||
'403':
|
||||
description: Insufficient role or wrong company. On API-key routes, cross-tenant ids usually
|
||||
return 404 instead. requireCompanyAdmin returns flat 'admin required' for session non-admin
|
||||
callers (API keys use role api and pass).
|
||||
description: Access denied or resource unavailable to this company.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/FlatAPIError"
|
||||
example:
|
||||
error: admin required
|
||||
error: forbidden
|
||||
'422':
|
||||
description: Validation failed. Current public v1 handlers emit these cases as HTTP 400 (flat
|
||||
or coded). 422 is documented for clients that expect an explicit validation status; body matches
|
||||
@@ -4582,15 +4527,13 @@ paths:
|
||||
example:
|
||||
error: internal error
|
||||
'403':
|
||||
description: Insufficient role or wrong company. On API-key routes, cross-tenant ids usually
|
||||
return 404 instead. requireCompanyAdmin returns flat 'admin required' for session non-admin
|
||||
callers (API keys use role api and pass).
|
||||
description: Access denied or resource unavailable to this company.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/FlatAPIError"
|
||||
example:
|
||||
error: admin required
|
||||
error: forbidden
|
||||
'404':
|
||||
description: Resource id not found for this API-key company (or wrong tenant).
|
||||
content:
|
||||
@@ -4668,15 +4611,13 @@ paths:
|
||||
example:
|
||||
error: internal error
|
||||
'403':
|
||||
description: Insufficient role or wrong company. On API-key routes, cross-tenant ids usually
|
||||
return 404 instead. requireCompanyAdmin returns flat 'admin required' for session non-admin
|
||||
callers (API keys use role api and pass).
|
||||
description: Access denied or resource unavailable to this company.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/FlatAPIError"
|
||||
example:
|
||||
error: admin required
|
||||
error: forbidden
|
||||
'404':
|
||||
description: Resource id not found for this API-key company (or wrong tenant).
|
||||
content:
|
||||
@@ -4754,15 +4695,13 @@ paths:
|
||||
code: unauthorized
|
||||
message: Unauthorized
|
||||
'403':
|
||||
description: Insufficient role or wrong company. On API-key routes, cross-tenant ids usually
|
||||
return 404 instead. requireCompanyAdmin returns flat 'admin required' for session non-admin
|
||||
callers (API keys use role api and pass).
|
||||
description: Access denied or resource unavailable to this company.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/FlatAPIError"
|
||||
example:
|
||||
error: admin required
|
||||
error: forbidden
|
||||
'404':
|
||||
description: Resource id not found for this API-key company (or wrong tenant).
|
||||
content:
|
||||
@@ -4792,265 +4731,6 @@ paths:
|
||||
error:
|
||||
code: validation_error
|
||||
message: invalid json
|
||||
/team/{userID}:
|
||||
parameters:
|
||||
- name: userID
|
||||
in: path
|
||||
required: true
|
||||
schema:
|
||||
type: string
|
||||
format: uuid
|
||||
description: Membership user id within the selected company
|
||||
patch:
|
||||
tags:
|
||||
- Team
|
||||
summary: Update team member role
|
||||
description: |
|
||||
Company admin or platform admin. Demoting the last active admin returns 409.
|
||||
Requires session cookie + CSRF double-submit (X-CSRF-Token).
|
||||
Dashboard surface under /api (not the public /api/v1 API-key base).
|
||||
security:
|
||||
- SessionCookie: []
|
||||
CSRFHeader: []
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
required:
|
||||
- role
|
||||
properties:
|
||||
role:
|
||||
type: string
|
||||
enum:
|
||||
- admin
|
||||
- member
|
||||
description: Normalized to admin|member (case-insensitive input accepted)
|
||||
example:
|
||||
role: member
|
||||
responses:
|
||||
'200':
|
||||
description: Role updated (or unchanged)
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
required:
|
||||
- status
|
||||
- role
|
||||
- user_id
|
||||
properties:
|
||||
status:
|
||||
type: string
|
||||
example: ok
|
||||
role:
|
||||
type: string
|
||||
enum:
|
||||
- admin
|
||||
- member
|
||||
user_id:
|
||||
type: string
|
||||
format: uuid
|
||||
example:
|
||||
status: ok
|
||||
role: member
|
||||
user_id: 4f3c2b1a-0e9d-4c8b-7a6f-5e4d3c2b1a09
|
||||
'400':
|
||||
description: Invalid request for this route (HTTP 400).
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/FlatAPIError"
|
||||
example:
|
||||
error: invalid json
|
||||
'403':
|
||||
description: Forbidden (not company/platform admin)
|
||||
'404':
|
||||
description: Resource not found (HTTP 404).
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/FlatAPIError"
|
||||
example:
|
||||
error: not found
|
||||
'409':
|
||||
description: Cannot demote the last admin
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
error:
|
||||
type: string
|
||||
example: cannot demote the last admin
|
||||
'401':
|
||||
description: Missing or invalid API key. RequireAPIKey returns this when Authorization Bearer
|
||||
and X-API-Key are both absent/empty or AuthenticateAPIKey returns ErrInvalidAPIKey. Coded
|
||||
envelope (not a flat string).
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/CodedAPIError"
|
||||
example:
|
||||
error:
|
||||
code: unauthorized
|
||||
message: Unauthorized
|
||||
'422':
|
||||
description: Validation failed. Dashboard routes may use this status; prefer reading the message.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/FlatAPIError"
|
||||
example:
|
||||
error: validation failed
|
||||
'500':
|
||||
description: Unexpected server error (HTTP 500).
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/FlatAPIError"
|
||||
example:
|
||||
error: list failed
|
||||
/admin/emails/set-password:
|
||||
post:
|
||||
tags:
|
||||
- Admin
|
||||
summary: Re-issue set-password invites
|
||||
description: |
|
||||
Platform admin only. Prefers durable invite reissue (ReissueSetPasswordInvite);
|
||||
falls back to HMAC set-password tokens when the user has no active membership.
|
||||
Skips synthetic placeholder emails. Rate-limited per admin.
|
||||
When SMTP is disabled and a single user_id is provided, the response may include
|
||||
a one-time token for local/staging link copy (never logs email/token).
|
||||
Dashboard surface under /api (not the public /api/v1 API-key base).
|
||||
security:
|
||||
- SessionCookie: []
|
||||
CSRFHeader: []
|
||||
requestBody:
|
||||
required: false
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
user_id:
|
||||
type: string
|
||||
format: uuid
|
||||
description: |
|
||||
Target user UUID. When omitted, bulk-targets users needing a password (capped).
|
||||
example:
|
||||
user_id: 4f3c2b1a-0e9d-4c8b-7a6f-5e4d3c2b1a09
|
||||
responses:
|
||||
'200':
|
||||
description: Issue/send summary
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
required:
|
||||
- sent
|
||||
- issued
|
||||
- skipped
|
||||
- smtp_enabled
|
||||
- mode
|
||||
properties:
|
||||
sent:
|
||||
type: integer
|
||||
issued:
|
||||
type: integer
|
||||
skipped:
|
||||
type: integer
|
||||
skipped_synthetic:
|
||||
type: integer
|
||||
skipped_ineligible:
|
||||
type: integer
|
||||
skipped_rate_limited:
|
||||
type: integer
|
||||
skipped_send:
|
||||
type: integer
|
||||
smtp_enabled:
|
||||
type: boolean
|
||||
mode:
|
||||
type: string
|
||||
example: invite
|
||||
token:
|
||||
type: string
|
||||
description: Present only for single-user reissue when SMTP is off
|
||||
example:
|
||||
sent: 1
|
||||
issued: 1
|
||||
skipped: 0
|
||||
skipped_synthetic: 0
|
||||
skipped_ineligible: 0
|
||||
skipped_rate_limited: 0
|
||||
skipped_send: 0
|
||||
smtp_enabled: true
|
||||
mode: invite
|
||||
'401':
|
||||
description: Unauthorized — missing session or privilege for this dashboard route.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/FlatAPIError"
|
||||
example:
|
||||
error: unauthorized
|
||||
'429':
|
||||
description: Rate limit exceeded for this admin action. May include Retry-After.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/FlatAPIError"
|
||||
example:
|
||||
error: Too many requests
|
||||
'503':
|
||||
description: Dependency unavailable (for example mailer down).
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/FlatAPIError"
|
||||
example:
|
||||
error: mailer unavailable
|
||||
'400':
|
||||
description: Invalid request for this route (HTTP 400).
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/FlatAPIError"
|
||||
example:
|
||||
error: invalid json
|
||||
'403':
|
||||
description: Forbidden for this route (HTTP 403).
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/FlatAPIError"
|
||||
example:
|
||||
error: admin required
|
||||
'409':
|
||||
description: Conflict with current resource state.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/FlatAPIError"
|
||||
example:
|
||||
error: conflict
|
||||
'422':
|
||||
description: Validation failed. Dashboard routes may use this status; prefer reading the message.
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/FlatAPIError"
|
||||
example:
|
||||
error: validation failed
|
||||
'500':
|
||||
description: Unexpected server error (HTTP 500).
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "#/components/schemas/FlatAPIError"
|
||||
example:
|
||||
error: list failed
|
||||
components:
|
||||
securitySchemes:
|
||||
BearerAuth:
|
||||
@@ -5074,18 +4754,6 @@ components:
|
||||
Alternate scheme for /api/v1. Same company API key as BearerAuth, sent
|
||||
as header X-API-Key: dk_your_key. When both Authorization Bearer and
|
||||
X-API-Key are present, Bearer wins.
|
||||
SessionCookie:
|
||||
type: apiKey
|
||||
in: cookie
|
||||
name: descrybe_session
|
||||
description: Dashboard session cookie only (SESSION_COOKIE_NAME; default descrybe_session). Not
|
||||
valid for /api/v1 public routes.
|
||||
CSRFHeader:
|
||||
type: apiKey
|
||||
in: header
|
||||
name: X-CSRF-Token
|
||||
description: Dashboard CSRF double-submit header (must match descrybe_csrf cookie). Not used by
|
||||
/api/v1 API-key routes.
|
||||
parameters:
|
||||
ID:
|
||||
in: path
|
||||
|
||||
Reference in new issue
Block a user