Skip to content

Single Form generation - API Contracts #552

@chetanr25

Description

@chetanr25

Single form generation

Part of #541

Depends on: Templates CRUD (#549 ), AI extraction (#550 )

Contract reference

Endpoints

POST /api/v1/forms/generate/{form_type}

Generates a single agency-specific form from extracted incident data. Loads the template config for the given form_type, maps incident contract fields to agency-specific fields, and writes values onto the PDF at stored coordinates using pdf-annotate/ReportLab.

Returns 202 with form_id and job_id for polling. Full request/error details in the contract reference above.

GET /api/v1/forms/{form_id}

Returns form metadata: generation status, associated extract and incident IDs, and a field mapping summary showing how fields were mapped (filled, blank, coverage percent).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

Status
No status

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions