Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/elecodes/TenderCheck-AI/llms.txt

Use this file to discover all available pages before exploring further.

TenderCheck AI exposes four tender endpoints, all mounted under /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 a TenderAnalysis object with a populated requirements array. Auth required: Yes
Content-Type: multipart/form-data

Request fields

file
file
required
The tender PDF. Maximum size: 50 MB. Only application/pdf MIME type is accepted.
industry
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

curl -X POST https://tendercheckai.elecodes.online/api/tenders/analyze \
  -H "Authorization: Bearer <token>" \
  -F "file=@tender.pdf" \
  -F "industry=digital_services"

Success response — 201 Created

{
  "id": "uuid",
  "userId": "user_uuid",
  "tenderTitle": "Extracted title from AI",
  "documentUrl": "",
  "status": "COMPLETED",
  "createdAt": "2025-01-15T10:00:00.000Z",
  "updatedAt": "2025-01-15T10:00:00.000Z",
  "requirements": [
    {
      "id": "req_uuid",
      "text": "El proveedor deberá contar con certificación ISO 27001",
      "type": "MANDATORY",
      "source": {
        "pageNumber": 5,
        "snippet": "...deberá contar con certificación..."
      },
      "keywords": ["ISO 27001", "certificación", "seguridad"],
      "confidence": 0.97
    }
  ],
  "results": [],
  "pageTexts": ["page 1 text...", "page 2 text..."]
}
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

StatusReason
400No file attached, non-PDF file type, or file exceeds 50 MB
401Missing or invalid authentication token

POST /api/tenders/:id/validate-proposal

Uploads a vendor proposal PDF and validates it against the requirements extracted from a previously analyzed tender. Returns a ValidationResult for each requirement. Auth required: Yes
Content-Type: multipart/form-data

Path parameters

id
string
required
The UUID of the tender to validate against. Obtained from a prior /analyze response.

Request fields

file
file
required
The vendor proposal PDF to validate. Same constraints apply: PDF only, maximum 50 MB.

curl example

curl -X POST https://tendercheckai.elecodes.online/api/tenders/<tender_id>/validate-proposal \
  -H "Authorization: Bearer <token>" \
  -F "file=@proposal.pdf"

Success response — 200 OK

{
  "status": "success",
  "results": [
    {
      "requirementId": "req_uuid",
      "status": "MET",
      "reasoning": "La oferta menciona certificación ISO 27001 válida hasta 2026",
      "confidence": 0.95,
      "evidence": {
        "text": "...ISO 27001...",
        "pageNumber": 3
      }
    }
  ]
}

ValidationStatus values

Each result’s status field is one of four values:
ValueMeaning
METThe proposal clearly satisfies the requirement
NOT_METThe proposal does not address the requirement
PARTIALLY_METThe proposal partially addresses the requirement but gaps remain
AMBIGUOUSThe proposal contains conflicting or insufficient evidence to decide

Error responses

StatusReason
400No file attached or the PDF could not be parsed
401Missing or invalid authentication token
404No tender found with the given id

GET /api/tenders

Returns the analysis history for the currently authenticated user. The userId is read from the JWT — there are no query parameters. Auth required: Yes

curl example

curl https://tendercheckai.elecodes.online/api/tenders \
  -H "Authorization: Bearer <token>"

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.
[
  {
    "id": "uuid",
    "userId": "user_uuid",
    "tenderTitle": "Licitación Pública No. 001-2025",
    "documentUrl": "",
    "status": "COMPLETED",
    "createdAt": "2025-01-15T10:00:00.000Z",
    "updatedAt": "2025-01-15T10:00:00.000Z",
    "requirements": ["..."],
    "results": ["..."],
    "pageTexts": ["..."]
  }
]

Error responses

StatusReason
401Missing or invalid authentication token

DELETE /api/tenders/:id

Permanently deletes a tender analysis record. Ownership is validated server-side — only the user whose userId matches tender.userId can delete it. Auth required: Yes

Path parameters

id
string
required
The UUID of the tender to delete.

curl example

curl -X DELETE https://tendercheckai.elecodes.online/api/tenders/<tender_id> \
  -H "Authorization: Bearer <token>"

Success response — 200 OK

{
  "status": "success",
  "message": "Tender deleted"
}

Error responses

StatusReason
400Invalid or missing tender id
401Missing or invalid authentication token
403The authenticated user is not the owner of this tender (tender.userId !== req.user.userId)
404No tender found with the given id

TenderAnalysis Response Schema

The following fields are returned by /analyze and each item in the GET / history array.
id
string
UUID that uniquely identifies this analysis. Used as the id path parameter in /validate-proposal and DELETE.
userId
string
UUID of the user who created the analysis.
tenderTitle
string
Title extracted from the tender document by the AI model.
documentUrl
string
Reserved for a future PDF storage URL. Currently always an empty string.
status
string
Processing state of the analysis. One of PENDING, PROCESSING, COMPLETED, or FAILED.
createdAt
string
ISO 8601 timestamp of when the analysis was created.
updatedAt
string
ISO 8601 timestamp of the last update (e.g. when validation results are written).
requirements
Requirement[]
Array of requirements extracted from the tender document by the AI. Populated after a successful /analyze call.
results
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.
pageTexts
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.
metadata
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.

Build docs developers (and LLMs) love