PFD / P&ID API

Complete API Test Console

Test database-sheet PFD/P&ID processing, metadata-only extraction, metadata status/cancellation, saved results and health. Equipment and pipe-component detection belongs only to the full process API and is limited to the process rectangle.

POST /api/process

Full PFD / P&ID Processing

Runs diagram extraction, equipment, pipe components, topology, streams, mixing logic and DB persistence.

Send one or multiple auto-increment sheet IDs. The backend reads project_id, document_set_id, drawing_type and file_path directly from document_sheets, determines whether the sheet is PFD or P&ID, and runs the existing pipeline.

Progress and cancellation accept the same one or multiple sheet document_id values. The backend resolves project/document-set/PFD-or-P&ID context from the database.

Idle.

POST /api/extract-metadata

Metadata Extraction Only

Extracts metadata only. Frontend sends project_id, one document_id per file, updated_by, and repeated files. Every PDF sheet is saved as PDF + PNG. Upload data is stored in document_uploads and sheet metadata in document_sheets.

Frontend IDs: []

Idle.

POST /api/identify-pid-mixing-points

Identify P&ID Mixing Points

Enter only the already-processed P&ID sheet ID(s). The backend resolves project_id and document_set_id from document_sheets, loads every saved PFD mixing-point JSON in that project, and identifies the corresponding mixing points in each selected P&ID.

Uses saved P&ID processing data and all saved PFD mixing points from the same project.

GET /api/results

Get Saved Results

Other API Tests

/api/run-id is retained only for backward compatibility. Normal process progress/cancellation uses only document_id=document_sheets.sheet_id; backend resolves the remaining IDs from PostgreSQL.

API Response

No request yet.

{
  "ready": true,
  "apis": [
    "GET /health",
    "POST /api/process",
    "GET /api/progress",
    "POST /api/cancel",
    "POST /api/extract-metadata",
    "GET /api/metadata-status",
    "POST /api/identify-pid-mixing-points",
    "GET /api/results",
    "POST /api/run-id"
  ]
}