Skip to content

Audits

import { Aside } from ‘@astrojs/starlight/components’;

GET /v1/organizations/:orgId/audits

Required role: Member.

Returns all audits across all non-archived products in the organization, including productName and productSlug fields.


GET /v1/organizations/:orgId/future-audits

Required role: Member.

Returns a computed list of upcoming audit dates for all active products that have an audit frequency configured and no full audit currently in progress.

Response:

{
"futureAudits": [
{
"productId": "...",
"productName": "My Product",
"productSlug": "my-product",
"nextAuditDate": "2025-06-01T00:00:00.000Z",
"isOverdue": false,
"auditFrequency": 12,
"lastAuditDate": "2024-06-01T00:00:00.000Z",
"lastAuditNumber": 3
}
]
}
  • nextAuditDate is calculated from the most recent completed full audit’s completedAt date plus the effective frequency. If no completed full audit exists, the product’s createdAt date is used.
  • isOverdue is true when nextAuditDate is in the past.
  • Products with an in-progress full audit are excluded.
  • Results are sorted by nextAuditDate ascending.

GET /v1/organizations/:orgId/products/:productSlug/audits

Required role: Member.


POST /v1/organizations/:orgId/products/:productSlug/audits

Required role: Member.

Cannot create an audit for an archived product — returns 409 Conflict.

Request body:

FieldTypeDefaultDescription
type"full" | "re_audit" | "small_scope""full"Audit type.
titlestring | nullOptional title (max 200 characters).
descriptionstring | nullOptional description (max 2000 characters).
status"in_progress" | "completed""in_progress"Initial status.

startedAt is set to the current time automatically. If status is "completed", completedAt is also set to now. The standardId and conformanceLevel are inherited from the product (or organization defaults if the product has none).

Audit numbers are sequential per product, assigned atomically.

Returns 201 Created with a Location header.


GET /v1/organizations/:orgId/products/:productSlug/audits/:auditNumber

Required role: Member.

:auditNumber is the sequential integer audit number, not a UUID.


PATCH /v1/organizations/:orgId/products/:productSlug/audits/:auditNumber

Required role: Member.

Request body (all fields optional):

FieldTypeDescription
type"full" | "re_audit" | "small_scope"Audit type.
titlestring | nullTitle.
descriptionstring | nullDescription.
status"in_progress" | "completed"Transitioning to "completed" auto-sets completedAt if not already set. Transitioning to "in_progress" auto-sets startedAt if not already set.
startedAtstring (ISO 8601) | nullOverride the start date.
completedAtstring (ISO 8601) | nullOverride the completion date.
standardIdstring | nullOverride the standard for this audit.
conformanceLevelstring | nullOverride the conformance level. Must be valid for the given standard.

DELETE /v1/organizations/:orgId/products/:productSlug/audits/:auditNumber

Required role: Admin or owner.

Returns 204 No Content.


GET /v1/organizations/:orgId/products/:productSlug/audits/:auditNumber/issues

Required role: Member.

Returns all issues linked to the specified audit.