Kosmobids Public API

Updating the pipeline

Move tenders between stages, replace tags, and archive or restore them through the API, with the validation and attribution rules.

The pipeline write endpoints change the workflow fields Kosmobids owns: stage, tags, and archive state. They do not add tenders to the pipeline, edit tender metadata, or touch notes and owners.

Every write is recorded in the tender's activity feed and attributed to your API key, so a stage move made by your integration shows up in the Kosmobids application exactly like a teammate's, labelled with the key's name.

Stage vocabulary

Stage keys are stable identifiers; labels are display-only and can be renamed by the company at any time. Always address a stage by key.

GET /pipeline/stages

{
  "data": {
    "stages": [
      { "key": "new", "label": "New", "kind": "active", "position": 0, "isDefaultEntry": true },
      { "key": "reviewing", "label": "Reviewing", "kind": "active", "position": 1, "isDefaultEntry": false },
      { "key": "preparing_bid", "label": "Preparing bid", "kind": "active", "position": 2, "isDefaultEntry": false },
      { "key": "won", "label": "Won", "kind": "terminal", "position": 3, "isDefaultEntry": false }
    ]
  },
  "error": null
}
Field Meaning
key Stable identifier accepted by the stage endpoint.
label Display name. Readable, but not an identifier.
kind active stages are in progress; terminal stages end the funnel.
position Board order, ascending.
isDefaultEntry true for the stage new tenders enter.

The list contains the stages the company can currently see. Hidden stages are omitted and cannot be moved to. The pipeline read returns both forms: stage is the key, status is the label.

Move a tender between stages

PUT /pipeline/:tenderId/stage

{ "stage": "preparing_bid" }
{
  "data": {
    "stage": "preparing_bid",
    "stageLabel": "Preparing bid",
    "stageChangedAt": "2026-11-25T09:00:00.000Z",
    "changed": true
  },
  "error": null
}

The write is idempotent. Moving a tender to the stage it is already in returns 200 with changed: false and records no activity entry, so a retry is always safe.

Only the stage changes. Pipeline membership, tags, notes, owner, and archive state are untouched.

If the stage key is not one of the company's visible stages, the response is 400 and carries the keys you can use instead:

{
  "data": {
    "error": "Unknown pipeline stage \"nope\"",
    "validStages": ["new", "reviewing", "preparing_bid", "won"]
  },
  "error": null
}

Replace tags

PUT /pipeline/:tenderId/tags

{ "tags": ["cloud", "priority"] }
{
  "data": {
    "tags": ["cloud", "priority"],
    "changed": true
  },
  "error": null
}

This is a full replacement, not a merge: send the complete list you want the tender to have, or [] to clear it. To add one tag without dropping the rest, read the pipeline first and send the merged list.

Rule Value
Tags per tender at most 20
Tag length 1–40 characters
Normalisation trimmed, de-duplicated, order preserved

Tags that do not exist in the company's tag vocabulary are added to it, so they appear in the application's tag filter. Like the application's own tag editor, a tag change does not write an activity entry.

Archive and restore

POST /pipeline/:tenderId/archive archives; DELETE /pipeline/:tenderId/archive restores.

{
  "data": {
    "archived": true,
    "archivedAt": "2026-11-25T09:00:00.000Z",
    "changed": true
  },
  "error": null
}

Archiving hides the tender from the default pipeline read but keeps it in the pipeline, so the restore is always available. Both directions are idempotent: archiving an archived tender (or restoring a live one) returns 200 with changed: false and writes no second activity entry.

Archived tenders stay readable: pass archived=include or archived=only to GET /pipeline and use the archivedAt field to tell them apart. See Pipeline and pagination.

Concurrency

Writes are last-write-wins. The API does not expose an ETag or If-Match token for the pipeline, so a write issued while a teammate is editing the same tender can overwrite their change. When both may act on the same tender, re-read the pipeline before writing, or agree which system owns which field.

Errors

Status Cause
400 Unknown stage key, a tag list over the caps, or an invalid request body.
404 The tender is not in this company's pipeline.
403 The API key is not scoped to a company.
502 The pipeline backend failed or was unreachable. Retry with backoff.
503 The pipeline backend is not configured for this deployment.

A 404 means the tender is not in the pipeline (never saved, or removed) — it does not distinguish a wrong tender ID from a tender that belongs to another company.