/api/tenders. Every endpoint requires a valid JWT — supplied either as the token HttpOnly cookie or an Authorization: Bearer <token> header. File uploads use multipart/form-data; the server accepts only PDF documents up to 50 MB.
POST /api/tenders/analyze
Uploads a public tender document (pliego de condiciones) and runs AI analysis to extract all requirements. Returns aTenderAnalysis object with a populated requirements array.
Auth required: YesContent-Type:
multipart/form-data
Request fields
file
required
The tender PDF. Maximum size: 50 MB. Only
application/pdf MIME type is accepted.string
Optional industry hint to guide AI extraction (e.g.
"digital_services", "construction", "healthcare"). When omitted, the model infers context from the document.curl example
Success response — 201 Created
documentUrl is always an empty string in the current release. The uploaded PDF is parsed in-memory and not persisted to storage — only the extracted analysis metadata, requirements, and validation results are saved to the database.Error responses
POST /api/tenders/:id/validate-proposal
Uploads a vendor proposal PDF and validates it against the requirements extracted from a previously analyzed tender. Returns aValidationResult for each requirement.
Auth required: YesContent-Type:
multipart/form-data
Path parameters
string
required
The UUID of the tender to validate against. Obtained from a prior
/analyze response.Request fields
file
required
The vendor proposal PDF to validate. Same constraints apply: PDF only, maximum 50 MB.
curl example
Success response — 200 OK
ValidationStatus values
Each result’sstatus field is one of four values:
Error responses
GET /api/tenders
Returns the analysis history for the currently authenticated user. TheuserId is read from the JWT — there are no query parameters.
Auth required: Yes
curl example
Success response — 200 OK
An array of TenderAnalysis objects in the same shape as the /analyze response. The array is empty when the user has no prior analyses.
Error responses
DELETE /api/tenders/:id
Permanently deletes a tender analysis record. Ownership is validated server-side — only the user whoseuserId matches tender.userId can delete it.
Auth required: Yes
Path parameters
string
required
The UUID of the tender to delete.
curl example
Success response — 200 OK
Error responses
TenderAnalysis Response Schema
The following fields are returned by/analyze and each item in the GET / history array.
string
UUID that uniquely identifies this analysis. Used as the
id path parameter in /validate-proposal and DELETE.string
UUID of the user who created the analysis.
string
Title extracted from the tender document by the AI model.
string
Reserved for a future PDF storage URL. Currently always an empty string.
string
Processing state of the analysis. One of
PENDING, PROCESSING, COMPLETED, or FAILED.string
ISO 8601 timestamp of when the analysis was created.
string
ISO 8601 timestamp of the last update (e.g. when validation results are written).
Requirement[]
Array of requirements extracted from the tender document by the AI. Populated after a successful
/analyze call.ValidationResult[]
Array of validation results produced by
/validate-proposal. Empty after /analyze — results are only populated once a proposal has been validated against this tender.string[]
Array of full page text strings extracted from the tender PDF, one entry per page. Used by the frontend to display source citations inline.
object
Optional processing metadata.
The
documentUrl field is always an empty string in the current release. The uploaded PDF is parsed in-memory and not persisted to storage — only the extracted analysis metadata, requirements, and validation results are saved to the database.