Kosmobids Public API

Tender, lot, notice, and file IDs

The difference between a tender, a lot, a source tender, a notice, and the two IDs used for documents.

The API uses several identifiers that look similar but address different levels of the procurement data model. Mixing them up is the most common source of 404 responses.

Tender = lot

In the Public API, a tender ID is a lot ID. A lot is one awardable part of a procurement notice. When a notice is split into lots, each lot has its own tenderId, its own CPV codes, value, and deadline.

GET /api/v1/tenders/0f8fad5b-d9cb-469f-a165-70867728950e

Source tender = notice group

Several lots can belong to the same source tender. The shared identifier is source_tender_id. Use it when you need every lot of the same publication:

GET /api/v1/tenders/by-source/123456-2026

The response contains all lots that share that source_tender_id.

Notice

A notice is the publication-level record. GET /notices/:noticeId returns notice details together with all of its lots. The noticeId may be a pipeline notice ID, a tender_notices.id, or a source OCDS notice ID, depending on how the notice was ingested.

GET /api/v1/notices/123456-2026

Choosing the right endpoint

You have You want Endpoint
A lot ID One lot's details GET /tenders/:tenderId
A lot ID Every lot of the same notice GET /tenders/by-source/:sourceTenderId after reading source_tender.source_tender_id
A lot ID Notice-level details and all lots GET /notices/:noticeId if you have the notice ID
A source tender ID Every lot of that notice GET /tenders/by-source/:sourceTenderId
A notice ID Notice details and all lots GET /notices/:noticeId

Many document endpoints take a lot ID (tenderId) even though the underlying download is notice-level. The API resolves the lot to its source tender internally. This is why a tender without a source tender ID returns 404 on download and analysis endpoints.

File IDs

There are two document identifiers:

ID Identifies Used with
fileId A processed OCR document record GET /documents/:fileId, /pages, /headers, and analysis references
uploadedFileId The stored file or page image GET /files/:fileId/download

GET /tenders/:tenderId/files returns the uploaded files for a tender. Each item's id is an uploaded file ID and can be streamed with /files/:id/download. To download all files at once, use GET /tenders/:tenderId/files/zip.

The same row also carries fileId and documentStatus. Once documentStatus is processed, fileId is the processed document ID for /documents/:fileId. This works for procurement-source documents and company uploads alike, so the file list is the lookup for "which OCR documents exist for this tender".

Both endpoints name the path parameter fileId, but they are different ID spaces: /documents/:fileId takes the processed document ID, /files/:fileId/download takes the uploaded file ID. A 404 from /documents/:fileId means no document exists for that ID, usually because the ID comes from the wrong space. A document that exists but is still processing returns 200 with status: "new", not 404 — check the file row's documentStatus before retrying.

Analysis references contain both IDs:

{
  "idx": 1,
  "fileId": "processed-document-id",
  "pageNumber": 12,
  "regionIndex": 0,
  "uploadedFileId": "uploaded-page-image-id",
  "filename": "tender.pdf"
}

Use fileId to read the processed document and page text. Use uploadedFileId to fetch the page image or source file.