Skip to main content
DocumentsAI groundingv1.0.0OpenAPI 3.1

Handles document intake for cases and applications: virus scanning, document-type classification, sensitivity labeling (CUI / Privacy), and text extraction. Extracted text carries page references so AI answers can cite the exact page they came from.

Reference design by Iron Brick LLC. Not an official government system; endpoints and data models are adapted to each agency's systems of record during implementation.

Base URLs
  • https://dev.ironbrick.us/sandbox/documents/v1 Iron Brick sandbox (synthetic data; free developer account)
  • https://{agency-gateway}/documents/v1 Agency deployment (behind the agency API gateway)

OpenAPI YAML JSON

Authentication

Send an OAuth 2.0 bearer token from POST https://dev.ironbrick.us/oauth/token in the Authorization header. Your application must hold the scope listed on each operation. How authentication works.

ScopeGrants
documents:readRead documents and extracted text
documents:writeUpload documents

POST /documents

Upload a document · requires scope documents:write

Multipart upload. The document is scanned before it becomes available.

Request body multipart/form-data
form
file=string&caseId=string&category=supporting_evidence
Responses
202Document accepted for scanning
400Invalid request
401Missing or invalid access token
403Caller lacks the required scope
422Business rule violation
Example request
curl -X POST "https://dev.ironbrick.us/sandbox/documents/v1/documents" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"file": "string", "caseId": "string", "category": "supporting_evidence"}'
Response 202
{
  "documentId": "DOC-551920",
  "fileName": "lease-agreement.pdf",
  "mediaType": "application/pdf",
  "sizeBytes": 284113,
  "sha256": "9b1f0c4e3a6d...",
  "classification": "proof_of_residence",
  "sensitivity": "cui_privacy",
  "status": "available",
  "createdAt": "2026-10-01T12:00:00Z"
}

GET /documents/{documentId}

Get document metadata · requires scope documents:read

Parameters
NameInTypeDescription
documentId requiredpathstringDocument identifier.
Responses
200Document metadata
401Missing or invalid access token
403Caller lacks the required scope
404Resource not found
Example request
curl -X GET "https://dev.ironbrick.us/sandbox/documents/v1/documents/{documentId}" \
  -H "Authorization: Bearer $TOKEN"
Response 200
{
  "documentId": "DOC-551920",
  "fileName": "lease-agreement.pdf",
  "mediaType": "application/pdf",
  "sizeBytes": 284113,
  "sha256": "9b1f0c4e3a6d...",
  "classification": "proof_of_residence",
  "sensitivity": "cui_privacy",
  "status": "available",
  "createdAt": "2026-10-01T12:00:00Z"
}

GET /documents/{documentId}/content

Download document content · requires scope documents:read

Returns a short-lived signed URL. Every download is written to the audit log.

Parameters
NameInTypeDescription
documentId requiredpathstringDocument identifier.
Responses
200Signed download URL
401Missing or invalid access token
403Caller lacks the required scope
404Resource not found
Example request
curl -X GET "https://dev.ironbrick.us/sandbox/documents/v1/documents/{documentId}/content" \
  -H "Authorization: Bearer $TOKEN"
Response 200
{
  "url": "https://example.gov/resource",
  "expiresAt": "2026-10-01T12:00:00Z"
}

GET /documents/{documentId}/text

Get extracted text · requires scope documents:read

Page-level text for search and AI retrieval, with page numbers for citations.

Parameters
NameInTypeDescription
documentId requiredpathstringDocument identifier.
Responses
200Extracted text
401Missing or invalid access token
403Caller lacks the required scope
404Resource not found
Example request
curl -X GET "https://dev.ironbrick.us/sandbox/documents/v1/documents/{documentId}/text" \
  -H "Authorization: Bearer $TOKEN"
Response 200
{
  "documentId": "string",
  "pages": [
    {
      "page": 1,
      "text": "RESIDENTIAL LEASE AGREEMENT ..."
    }
  ]
}

Schemas

Document

FieldTypeDescription
documentIdstring
fileNamestring
mediaTypestring
sizeBytesinteger
sha256string
classificationstring
sensitivitystring (public | cui | cui_privacy)
statusstring (uploaded | scanning | available | quarantined)
createdAtstring (date-time)