AIR Projects
Per-project document uploads via presigned object storage (upload-init → PUT to returned URL → upload-complete) so bytes never cross the API process.
List project documents
Returns document sources (`kind === 'document'`) for the project. Pass `includeArchived: true` to include archived sources. Requires project access; returns 404 when `projectPid` is unknown or not visible.
List project document artifacts
Returns document-derived artifacts for the project. Includes archived artifacts when `includeArchived` is true. Requires project access; returns 404 when `projectPid` is unknown or not visible.
Get artifact details
Returns full artifact metadata for `artifactPid` scoped to `projectPid`. Requires project access; returns 404 when the project or artifact is unknown or not visible.
Hard-delete artifact
Permanently deletes the artifact row and cleans up its extracted-text media. Returns 409 when the artifact is cited by any assessment — cited evidence may only be archived via `archiveArtifact`, never destroyed. Requires project access; returns 404 when the project or artifact is unknown or not visible.
Get artifact extracted text
Returns the artifact's extracted text, truncated to the preview byte limit when stored in media. Requires project access; returns 404 when the project, artifact, or backing media is unknown or not visible.
List project sources
Returns all sources for the project. Filters by `kind` when the query parameter is set. Requires project access; returns 404 when `projectPid` is unknown or not visible.
Look up project by slugs
Resolves a project by `orgSlug`, `domainSlug`, and `projectSlug` and returns its summary. Requires access to the org; returns 404 when any slug in the chain is unknown or not visible to the caller.
Start presigned document upload
Returns a presigned PUT `uploadUrl` and `s3Key` for uploading the original bytes directly to object storage. Caller must PUT the file to `uploadUrl`, then call `upload-complete` with the same `s3Key`. Requires project access; returns 404 when `projectPid` is unknown or not visible.
Complete presigned document upload
Finalizes a presigned upload after bytes are in storage: creates the media row and document source, then dispatches `ExtractDocumentArtifactsWorkflow`. Returns `sourcePid` and `workflowPid` for lifecycle tracking. Requires project access; returns 404 when `projectPid` is unknown or not visible.
Get presigned document download URL
Returns a time-limited `downloadUrl` and `filename` for the document's original blob. Requires project access; returns 404 when the source, project, or original media is unknown or not visible.
Delete document source
Hard-deletes the document source. Derived artifacts are archived (preserved as assessment evidence), not destroyed — there is no assessment-usage conflict on this route. Requires project access; returns 404 when the source or project is unknown or not visible.
Archive artifact
Archives `artifactPid` within `projectPid`, preserving it as assessment evidence without deleting the row. Requires project access; returns 404 when the project or artifact is unknown or not visible.
Archive document source
Archives the document source without deleting it. Archived sources are omitted from default list calls unless `includeArchived` is true. Requires project access; returns 404 when the source or project is unknown or not visible.
Unarchive document source
Restores an archived document source to active status. Requires project access; returns 404 when the source or project is unknown or not visible.
Re-run document extraction
Re-reads the stored original blob, re-parses, and idempotently replaces the artifact and chunks by dispatching `ExtractDocumentArtifactsWorkflow`. Returns `sourcePid` and `workflowPid` so the caller can resubscribe to lifecycle events. Returns 409 when the source is already `processing` or still has an active (non-archived) artifact. Requires project access; returns 404 when the source or project is unknown or not visible.