Kosmobids Public API

Authentication and company scoping

How API keys identify a company, which endpoints are company-scoped, and why another company's resources return 404.

API keys

Every request except the public status check must include an API key in the x-api-key header. A key is issued for a single company and determines the company context for the request. Requests never include a company ID in the URL, body, or query.

GET /api/v1/pipeline HTTP/1.1
Host: api.kosmobids.com
x-api-key: kosmobids_live_...

Keys are secrets. Make requests from a server you control, store the key in a secret manager, and rotate it if it is exposed. Do not put a key in client-side JavaScript, a mobile application, or a public repository.

Company scope

The key's company is attached to every company-scoped handler. The API exposes three kinds of endpoints:

Scope Endpoints Behaviour
Public GET /api/v1/status Unauthenticated readiness check. Returns no company data and requires no API key.
Company-scoped GET /pipeline, GET /pipeline/stages, PUT /pipeline/:tenderId/stage, PUT /pipeline/:tenderId/tags, POST/DELETE /pipeline/:tenderId/archive, POST /tenders/:tenderId/files, GET /tenders/:tenderId/files, GET /files/:fileId/download, /search, /saved-searches/*, /documents/*, /tenders/:tenderId/documents/download, /tenders/:tenderId/analyze, /analyses/:workflowId, POST /tenders/:tenderId/api-comments Reads and writes are limited to the key's company.
Global tender data GET /tenders/:tenderId, GET /tenders/by-source/:sourceTenderId, GET /notices/:noticeId, POST /tenders/:tenderId/look-alike Reads global procurement data. A company scope is not required.

A key without a company scope can still call the global tender endpoints. It cannot call company-scoped endpoints; those return 403.

Cross-company isolation

When a company-scoped endpoint addresses a resource by ID (a saved search, a run, an analysis, a company tender), the API checks that the resource belongs to the key's company. If it does not, the response is 404, not 403. This avoids leaking whether another company's resource exists.

{
  "data": { "message": "Not found" },
  "error": null
}

The same rule applies to document analysis: a workflow of another company, or a workflow of a different type, is reported as 404.

Limits that follow from scoping

  • A company can hold up to 10 saved searches. Creating an 11th returns 409.
  • Comments are posted to the key company's tender. Callers never supply a company tender ID; it is resolved server-side.
  • Analysis answers are generated from the tender documents plus the key company's own knowledge documents. Two companies asking the same questions can receive different answers.

Choosing the right key

Use a dedicated key per integration so that access can be revoked independently. A company-scoped public-api-user key is the correct choice for production integrations. Keys with broader internal roles are not intended for external callers and should not be distributed.