Cikada

Cikada Vision API

Developers

Everything the interface does, a robot can do. Authenticate with a bearer key from Settings, send images, receive typed attributes with a confidence per field. Base URL https://vision.cikadasolutions.com/api/v1. Rate limit 60 requests per minute per key. Errors always look like { "error": { "code", "message", "details?" } }.

Quickstart

curl

curl -X POST https://vision.cikadasolutions.com/api/v1/items \
  -H "Authorization: Bearer ck_live_…" \
  -H "Idempotency-Key: run-42-item-7" \
  -F "image[]=@front.jpg" -F "view[]=front" \
  -F "image[]=@label.jpg" -F "view[]=label" \
  -F "external_ref=run-42-item-7"

# → 202 {"item_id":"…","status":"queued"}
curl https://vision.cikadasolutions.com/api/v1/items/ITEM_ID -H "Authorization: Bearer ck_live_…"

Python

import requests

API = "https://vision.cikadasolutions.com/api/v1"
HEADERS = {"Authorization": "Bearer ck_live_…"}

# Synchronous: image in, classification out (p95 < 15 s)
with open("front.jpg", "rb") as front:
    r = requests.post(f"{API}/classify/sync", headers=HEADERS,
                      files=[("image[]", ("front.jpg", front, "image/jpeg"))],
                      data={"view[]": "front", "external_ref": "run-42-item-7"})
r.raise_for_status()
item = r.json()
print(item["attributes"]["garment_type"])   # {'value': 'jeans', 'confidence': 0.97, 'source': 'model'}
print(item["attributes"]["condition_grade"]["value"], item["classification"]["recommended_route"]["value"])

# Correct a value from the operator panel; mark_reviewed makes it a verified example the model learns from
requests.patch(f"{API}/items/{item['id']}/attributes", headers=HEADERS,
               json={"attributes": {"condition_grade": "C"}, "reviewer": "line-3-operator", "mark_reviewed": True}).raise_for_status()

# The defects behind the grade: the whole list as the operator sees it replaces the model's ([] = none)
requests.patch(f"{API}/items/{item['id']}/attributes", headers=HEADERS,
               json={"defects": [{"type": "hole", "severity": "moderate", "location": "left sleeve"}], "reviewer": "line-3-operator"}).raise_for_status()

# The resale price of a reuse garment lands a few seconds after the classification (webhook item.priced, or read again)
later = requests.get(f"{API}/items/{item['id']}", headers=HEADERS).json()
print(later["resale_price"])                 # {'status': 'estimated', 'amount': 120, 'low': 80, 'high': 150, 'currency': 'SEK', ...}
requests.patch(f"{API}/items/{item['id']}/attributes", headers=HEADERS,
               json={"resale_price": {"amount": 95}, "reviewer": "line-3-operator"}).raise_for_status()   # a person's price wins

Robot integration

A sorting robot photographs a garment, asks for the classification and routes the garment on the answer. The reference client is one Python file with no dependencies (Python 3.9+), so it runs on a Raspberry Pi, inside a ROS node or on the robot's PC. Any other language works the same way over HTTPS; the endpoints are listed below.

  1. Create a site and the robot under /robots. Create an API key under Settings → API keys with the scopes classify, items:read, items:write and batches, one key per robot, and bind it to the robot.
  2. Download cikada_vision.py and the example loop robot_loop.py. Put the key in CIKADA_API_KEY and the robot id in CIKADA_ROBOT_ID.
  3. Per garment: untangle, photograph the front and, when visible, the care label, then call classify(). It returns in about 7 to 10 seconds with every attribute and a confidence.
  4. Put the garment in the bin decide() returns: the bin id (for example A) that Cikada Vision assigned from the robot's bins (Robots → Bins; robots without their own use Robots → Default bins), with its position on the machine in sort.slot. Both are in the API response as sort and in the item.classified webhook. Garments the system is unsure about get the rules' "unsure" bin. Read GET /sorting?robot_id=… at start-up to check the machine knows every bin id and slot. When the robot requires a certainty per field (Robots → Bins → Certainty check) and a field falls short, sort.action is retry: unfold the garment again, photograph it and send the photos with retry_of set to the previous item id. After the last allowed retry the answer is discard with the bin to use; sort.below lists the fields that fell short. A robot with a NIR fibre sensor sends its reading with the photos as nir (JSON, e.g. [{"fiber":"cotton","percent":92.5}]; in Python classify(..., nir=[...])); questions on fibre share use it first, then a photographed care label, and until then a share simulated from the model's material. Every garment is stored either way, so operators can correct it in the interface.
  5. Send the next garment. One key allows 60 requests per minute, enough for one robot; images up to 20 MB each in JPEG, PNG, WebP or HEIC, up to six per garment.

Commands

Every answer carries the decision as a fixed command, by name in sort.command and as a number in sort.command_code (also in the item.classified webhook and listed by GET /sorting). The numbers never change.

CodeCommandWhat the robot does
0SORTPut the garment in sort.bin at sort.slot.
1REUNFOLDA value the bins depend on is below the robot's required certainty: start a new unfolding sequence, photograph again and send the photos with retry_of = this item's id. No bin yet.
2TRASHStill below after the last allowed retry: put the garment in sort.bin, the bin chosen for after the last retry (for Nymph, Bin E).

For testing the loop, Robots → Bins → Testing with the robot → Test signals makes every garment from that robot answer REUNFOLD until the last attempt and then TRASH, whatever its certainty. Test signals switch themselves off after 30 minutes, and a banner on every page says so while they are on.

Every classification also says what the photos showed, in classification.scene (single, multiple, partial, empty, foreign_object) and classification.contamination (none, wet, mould, heavy_soil, hazard). With the scene check on (Robots → Bins → Certainty check), two or more garments, part of one or nothing in view answers REUNFOLD, counted as a retry, and a foreign object (anything that is not a textile) or signs of a hazard answers SORT to the reject bin in GET /sorting → gate.scene.reject_bin, without being handled again.

Every classification also carries hard_parts (the pass is on unless switched off under Settings → Model): a summary (none, metal, plastic, mixed, or not_checked when the pass did not answer in time) and the findings, each with kind, part, confidence and a box in fractions of the original photo, one per part. When the robot sends garments with hard parts to a bin (Robots → Bins → Hard parts; with or without a certainty check), a finding at or above hard_parts.min_confidence in GET /sorting answers SORT to hard_parts.reject_bin, never a retry (the same check is repeated under gate.hard_parts for robots reading older answers); hard_parts is null when the findings are only noted on the garment. With hard_parts.before_node set, the check stands in the tree just before that question, after the certainty check, so only garments whose path reaches it are checked; null means before the certainty check. People mark hard parts as regions on a photo in the app, or with PATCH /items/{id}/attributes and regions; the pass is shown the plant's marked regions as examples on every later garment.

With the resale price pass on (Settings → Model), every garment that goes to reuse gets an estimated second-hand asking price in the organization's currency (Settings → Organization), in resale_price: status (estimated, unknown, pending, not_applicable), amount, the range low–high, currency, confidence and basis. It is estimated by its own call after the classification, so the robot's answer never waits for it: POST /classify/sync answers pending, and the price arrives a few seconds later in the item.priced webhook and on GET /items/{id}. A person's price wins: send PATCH /items/{id}/attributes with resale_price = {"amount": 95}, or null for "no resale value". The price never changes sort.

Python

import os
from cikada_vision import REUNFOLD, TRASH, CikadaVision, CikadaVisionError

vision = CikadaVision(api_key=os.environ["CIKADA_API_KEY"])
UNSURE = vision.sorting(robot_id=os.environ["CIKADA_ROBOT_ID"])["unsure"]   # this robot's bins (Robots → Bins)
ROBOT_ID = os.environ["CIKADA_ROBOT_ID"]          # from /robots
batch_id = vision.create_batch("Shift 2026-09-29")

def sort_garment(front_jpg: bytes, label_jpg: bytes | None) -> str:
    retry_of = None
    while True:
        images = [(front_jpg, "front")] + ([(label_jpg, "label")] if label_jpg else [])
        try:
            result = vision.classify(images, robot_id=ROBOT_ID, batch_id=batch_id, retry_of=retry_of)
        except CikadaVisionError as failure:  # model_error, rate_limited, network …
            return UNSURE
        if result.command_code != REUNFOLD:   # SORT (0), or TRASH (2) once the retries are used up
            break
        retry_of = result.item_id             # REUNFOLD (1): new unfolding sequence, photograph again
        front_jpg, label_jpg = unfold_and_photograph()
    print(result.command, result.summary())    # SORT item 8a2c… → jeans, grade B, route reuse (0.91), Bin A
    return result.bin                          # e.g. "A" (TRASH: the bin after the last retry); result.slot = its position

model_error means the model could not produce a valid answer for that garment; the item is stored and the loop routes it to review. The client does not retry it: the same photos would get the same answer. Network errors, 429 and other 5xx are retried with the same Idempotency-Key, so a retry never creates a duplicate, and every call ends within the client's deadline (40 s by default). The server answers within its own time budget (25 s): with no classification by then, sort.degraded is true and the bin is the fallback bin people sort by hand. For a second stage that does not need the answer immediately, use submit() instead and receive item.classified through a webhook.

Photograph early, decide late

The model needs about 4 to 7 seconds per garment. When the camera sits at the start of the cell and the diverter at the end, those seconds can overlap the handling instead of stopping the line: send the photos with submit() (POST /items) the moment they are taken, and ask for the bin with decision() (POST /items/{id}/decision) when the garment reaches the diverter. The answer is the same as from classify(). When the classification is still not in after wait seconds, the fallback bin becomes the garment's decision and comes back with sort.degraded set, so the stored bin is always the bin the garment went in; the garment is classified afterwards and keeps that bin. Asking again returns the same decision. The example loop shows it with robot_loop.py --once front.jpg --early 6.

# At the camera: send the photos and move on.
item_id = vision.submit([(front_jpg, "front"), (back_jpg, "back")], robot_id=ROBOT_ID, retry_of=retry_of)
transport_to_diverter()                       # Vision reads the photos meanwhile
# At the diverter: the bin, or the fallback bin if the answer is still not in after 3 s.
result = vision.decision(item_id, wait=3)
if result.command_code == REUNFOLD:           # back to the unfolder, send again with retry_of=result.item_id
    ...
put_in_bin(result.bin, result.slot)           # result.degraded: no answer in time, the fallback bin

Try it from a shell

export CIKADA_API_KEY=ck_live_…
export CIKADA_ROBOT_ID=<robot id from /robots>
python robot_loop.py --once front.jpg label.jpg          # one garment, two views
python robot_loop.py --watch /camera/out --interval 2    # every new photo in a folder

Endpoints

Items

Garments and their classifications

post/itemsCreate an item and queue classification

Multipart: fields image[] (1–8 files, JPEG/PNG/WebP/HEIC, 20 MB each), view[] (front|back|label|detail), external_ref, robot_id, batch_id. Or JSON with image_urls for pre-hosted HTTPS images. Send an Idempotency-Key header to make retries safe for 24 hours.

ParameterInTypeRequired
Idempotency-Keyheaderstringno
Request body
{
  "multipart/form-data": {
    "schema": {
      "type": "object",
      "required": [
        "image[]"
      ],
      "properties": {
        "image[]": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "binary"
          }
        },
        "view[]": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "front",
              "back",
              "label",
              "detail",
              "unknown"
            ]
          }
        },
        "external_ref": {
          "type": "string",
          "maxLength": 120
        },
        "robot_id": {
          "type": "string",
          "format": "uuid"
        },
        "batch_id": {
          "type": "string",
          "format": "uuid"
        }
      }
    }
  },
  "application/json": {
    "schema": {
      "$ref": "#/components/schemas/CreateItemJson"
    }
  }
}
Responses
{
  "202": {
    "description": "Item queued",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/ItemAccepted"
        }
      }
    }
  },
  "401": {
    "description": "Missing, malformed or revoked API key",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Error"
        }
      }
    }
  },
  "403": {
    "description": "API key lacks the required scope",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Error"
        }
      }
    }
  },
  "422": {
    "description": "Request failed validation",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Error"
        }
      }
    }
  },
  "429": {
    "description": "Rate limit exceeded; see Retry-After",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Error"
        }
      }
    }
  }
}
get/itemsList items
ParameterInTypeRequired
statusquerystring (queued | processing | classified | reviewed | failed)no
batch_idquerystringno
sincequerystringno
cursorquerystringno
limitqueryintegerno
Responses
{
  "200": {
    "description": "Page of items, newest first",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/ItemList"
        }
      }
    }
  },
  "401": {
    "description": "Missing, malformed or revoked API key",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Error"
        }
      }
    }
  },
  "422": {
    "description": "Request failed validation",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Error"
        }
      }
    }
  },
  "429": {
    "description": "Rate limit exceeded; see Retry-After",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Error"
        }
      }
    }
  }
}
get/items/{id}Get an item
ParameterInTypeRequired
idpathstringyes
Responses
{
  "200": {
    "description": "Item with images, current attributes and prediction history",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Item"
        }
      }
    }
  },
  "401": {
    "description": "Missing, malformed or revoked API key",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Error"
        }
      }
    }
  },
  "404": {
    "description": "Not found in this organization",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Error"
        }
      }
    }
  },
  "429": {
    "description": "Rate limit exceeded; see Retry-After",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Error"
        }
      }
    }
  }
}
post/items/{id}/classifyRe-run classification

Queues a new prediction, for example after adding a label image. Existing predictions and corrections are kept.

ParameterInTypeRequired
idpathstringyes
Responses
{
  "202": {
    "description": "Item queued",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/ItemAccepted"
        }
      }
    }
  },
  "401": {
    "description": "Missing, malformed or revoked API key",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Error"
        }
      }
    }
  },
  "403": {
    "description": "API key lacks the required scope",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Error"
        }
      }
    }
  },
  "404": {
    "description": "Not found in this organization",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Error"
        }
      }
    }
  },
  "429": {
    "description": "Rate limit exceeded; see Retry-After",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Error"
        }
      }
    }
  }
}
post/items/{id}/explainWrite the explanation

Queues the plain-language explanation of the latest classification. Explanations are written on demand: when someone opens the garment in the app or calls this endpoint. Emits item.explained; read it on GET /items/{id} as `explanation`.

ParameterInTypeRequired
idpathstringyes
Responses
{
  "202": {
    "description": "Explanation queued",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/ItemAccepted"
        }
      }
    }
  },
  "401": {
    "description": "Missing, malformed or revoked API key",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Error"
        }
      }
    }
  },
  "403": {
    "description": "API key lacks the required scope",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Error"
        }
      }
    }
  },
  "404": {
    "description": "Not found in this organization",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Error"
        }
      }
    }
  },
  "422": {
    "description": "Request failed validation",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Error"
        }
      }
    }
  },
  "429": {
    "description": "Rate limit exceeded; see Retry-After",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Error"
        }
      }
    }
  }
}
patch/items/{id}/attributesSubmit human corrections

Each changed attribute becomes a new human row beside the model row. Emits item.reviewed.

ParameterInTypeRequired
idpathstringyes
Request body
{
  "application/json": {
    "schema": {
      "$ref": "#/components/schemas/PatchAttributes"
    }
  }
}
Responses
{
  "200": {
    "description": "Corrections written",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/PatchResult"
        }
      }
    }
  },
  "401": {
    "description": "Missing, malformed or revoked API key",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Error"
        }
      }
    }
  },
  "403": {
    "description": "API key lacks the required scope",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Error"
        }
      }
    }
  },
  "404": {
    "description": "Not found in this organization",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Error"
        }
      }
    }
  },
  "422": {
    "description": "Request failed validation",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Error"
        }
      }
    }
  },
  "429": {
    "description": "Rate limit exceeded; see Retry-After",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Error"
        }
      }
    }
  }
}

Classification

Synchronous classification for low-latency robot use

post/items/{id}/decisionAsk for the bin of a garment sent ahead

Photograph early, decide late: send the photos with POST /items as soon as they are taken, move the garment on, and call this when it reaches the diverter. The answer is the item in full, as from POST /classify/sync: with its bin when the classification is in, after waiting up to wait_ms for it when it is not. When it is still not in by then, the fallback bin (the bin people sort by hand) becomes the garment's decision and the answer has sort.degraded = true; the garment is classified afterwards and keeps that bin. Asking again returns the same decision. A garment the model could not classify answers 502 model_error.

ParameterInTypeRequired
idpathstringyes
Request body
{
  "application/json": {
    "schema": {
      "$ref": "#/components/schemas/RequestDecision"
    }
  }
}
Responses
{
  "200": {
    "description": "The garment with its decision",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Item"
        }
      }
    }
  },
  "401": {
    "description": "Missing, malformed or revoked API key",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Error"
        }
      }
    }
  },
  "403": {
    "description": "API key lacks the required scope",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Error"
        }
      }
    }
  },
  "404": {
    "description": "Not found in this organization",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Error"
        }
      }
    }
  },
  "422": {
    "description": "Request failed validation",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Error"
        }
      }
    }
  },
  "429": {
    "description": "Rate limit exceeded; see Retry-After",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Error"
        }
      }
    }
  },
  "502": {
    "description": "The model failed",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Error"
        }
      }
    }
  }
}
post/classify/syncClassify synchronously

Same body as POST /items. The item is stored, classified inline and returned in full, typically in 5–10 s. The answer always comes within the server's time budget (25 s by default): when no classification is ready by then, the response is the item with sort.degraded = true and the fallback bin (the bin people sort by hand); the garment is classified afterwards and keeps that bin. Send an Idempotency-Key header: a retry with the same key returns the same garment and answer, waiting for the first request if it is still running, and never creates a second garment.

ParameterInTypeRequired
Idempotency-Keyheaderstringno
Request body
{
  "multipart/form-data": {
    "schema": {
      "type": "object",
      "required": [
        "image[]"
      ],
      "properties": {
        "image[]": {
          "type": "array",
          "items": {
            "type": "string",
            "format": "binary"
          }
        },
        "view[]": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "external_ref": {
          "type": "string"
        },
        "robot_id": {
          "type": "string",
          "format": "uuid"
        },
        "batch_id": {
          "type": "string",
          "format": "uuid"
        }
      }
    }
  },
  "application/json": {
    "schema": {
      "$ref": "#/components/schemas/CreateItemJson"
    }
  }
}
Responses
{
  "200": {
    "description": "Classified item",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Item"
        }
      }
    }
  },
  "401": {
    "description": "Missing, malformed or revoked API key",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Error"
        }
      }
    }
  },
  "403": {
    "description": "API key lacks the required scope",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Error"
        }
      }
    }
  },
  "422": {
    "description": "Request failed validation",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Error"
        }
      }
    }
  },
  "429": {
    "description": "Rate limit exceeded; see Retry-After",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Error"
        }
      }
    }
  },
  "502": {
    "description": "The model failed",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Error"
        }
      }
    }
  }
}

Batches

Groups of items, such as one robot run

post/batchesCreate a batch
Request body
{
  "application/json": {
    "schema": {
      "$ref": "#/components/schemas/CreateBatch"
    }
  }
}
Responses
{
  "201": {
    "description": "Batch created",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Batch"
        }
      }
    }
  },
  "401": {
    "description": "Missing, malformed or revoked API key",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Error"
        }
      }
    }
  },
  "403": {
    "description": "API key lacks the required scope",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Error"
        }
      }
    }
  },
  "422": {
    "description": "Request failed validation",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Error"
        }
      }
    }
  },
  "429": {
    "description": "Rate limit exceeded; see Retry-After",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Error"
        }
      }
    }
  }
}
get/batches/{id}Get a batch
ParameterInTypeRequired
idpathstringyes
Responses
{
  "200": {
    "description": "Batch",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Batch"
        }
      }
    }
  },
  "401": {
    "description": "Missing, malformed or revoked API key",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Error"
        }
      }
    }
  },
  "404": {
    "description": "Not found in this organization",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Error"
        }
      }
    }
  },
  "429": {
    "description": "Rate limit exceeded; see Retry-After",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Error"
        }
      }
    }
  }
}
get/batches/{id}/exportExport a batch
ParameterInTypeRequired
idpathstringyes
formatquerystring (csv | json)no
Responses
{
  "200": {
    "description": "All items in the batch",
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "properties": {
            "data": {
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/Item"
              }
            }
          }
        }
      },
      "text/csv": {
        "schema": {
          "type": "string"
        },
        "example": "id,status,...\r\n"
      }
    }
  },
  "401": {
    "description": "Missing, malformed or revoked API key",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Error"
        }
      }
    }
  },
  "404": {
    "description": "Not found in this organization",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Error"
        }
      }
    }
  },
  "429": {
    "description": "Rate limit exceeded; see Retry-After",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Error"
        }
      }
    }
  }
}

Webhooks

Signed event deliveries with retries

post/webhooksCreate a webhook

Deliveries are JSON POSTs `{ event, item_id, org_id, occurred_at, data }` with `X-Cikada-Signature: sha256=HMAC-SHA256(secret, body)`. Failed deliveries retry after 1 m, 5 m, 30 m, 2 h and 12 h. The secret is returned once.

Request body
{
  "application/json": {
    "schema": {
      "$ref": "#/components/schemas/CreateWebhook"
    }
  }
}
Responses
{
  "201": {
    "description": "Webhook created; includes the secret",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Webhook"
        }
      }
    }
  },
  "401": {
    "description": "Missing, malformed or revoked API key",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Error"
        }
      }
    }
  },
  "403": {
    "description": "API key lacks the required scope",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Error"
        }
      }
    }
  },
  "422": {
    "description": "Request failed validation",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Error"
        }
      }
    }
  },
  "429": {
    "description": "Rate limit exceeded; see Retry-After",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Error"
        }
      }
    }
  }
}
get/webhooksList webhooks
Responses
{
  "200": {
    "description": "Webhooks without secrets",
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "properties": {
            "data": {
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/Webhook"
              }
            }
          }
        }
      }
    }
  },
  "401": {
    "description": "Missing, malformed or revoked API key",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Error"
        }
      }
    }
  },
  "403": {
    "description": "API key lacks the required scope",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Error"
        }
      }
    }
  },
  "429": {
    "description": "Rate limit exceeded; see Retry-After",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Error"
        }
      }
    }
  }
}
get/webhooks/{id}Get a webhook
ParameterInTypeRequired
idpathstringyes
Responses
{
  "200": {
    "description": "Webhook",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Webhook"
        }
      }
    }
  },
  "401": {
    "description": "Missing, malformed or revoked API key",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Error"
        }
      }
    }
  },
  "403": {
    "description": "API key lacks the required scope",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Error"
        }
      }
    }
  },
  "404": {
    "description": "Not found in this organization",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Error"
        }
      }
    }
  },
  "429": {
    "description": "Rate limit exceeded; see Retry-After",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Error"
        }
      }
    }
  }
}
delete/webhooks/{id}Delete a webhook
ParameterInTypeRequired
idpathstringyes
Responses
{
  "204": {
    "description": "Deleted"
  },
  "401": {
    "description": "Missing, malformed or revoked API key",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Error"
        }
      }
    }
  },
  "403": {
    "description": "API key lacks the required scope",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Error"
        }
      }
    }
  },
  "404": {
    "description": "Not found in this organization",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Error"
        }
      }
    }
  },
  "429": {
    "description": "Rate limit exceeded; see Retry-After",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Error"
        }
      }
    }
  }
}
get/webhooks/{id}/deliveriesRecent deliveries
ParameterInTypeRequired
idpathstringyes
limitqueryintegerno
Responses
{
  "200": {
    "description": "Newest first",
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "properties": {
            "data": {
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/WebhookDelivery"
              }
            }
          }
        }
      }
    }
  },
  "401": {
    "description": "Missing, malformed or revoked API key",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Error"
        }
      }
    }
  },
  "403": {
    "description": "API key lacks the required scope",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Error"
        }
      }
    }
  },
  "404": {
    "description": "Not found in this organization",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Error"
        }
      }
    }
  },
  "429": {
    "description": "Rate limit exceeded; see Retry-After",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Error"
        }
      }
    }
  }
}

Reference

Taxonomy and health

get/healthService healthno auth
Responses
{
  "200": {
    "description": "Component status",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Health"
        }
      }
    }
  }
}
get/taxonomyCurrent enums and grading rubric

Fetch once and validate locally before sending corrections.

Responses
{
  "200": {
    "description": "Taxonomy",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Taxonomy"
        }
      }
    }
  },
  "401": {
    "description": "Missing, malformed or revoked API key",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Error"
        }
      }
    }
  },
  "429": {
    "description": "Rate limit exceeded; see Retry-After",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Error"
        }
      }
    }
  }
}
get/sortingThe bins and rules a robot sorts by

Read at start-up to check that the machine knows every bin id and slot. With robot_id: that robot's own bins if it has any, else the organization's. Each classified item carries its bin in `sort`.

ParameterInTypeRequired
robot_idquerystringno
Responses
{
  "200": {
    "description": "Sorting rules",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Sorting"
        }
      }
    }
  },
  "401": {
    "description": "Missing, malformed or revoked API key",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Error"
        }
      }
    }
  },
  "429": {
    "description": "Rate limit exceeded; see Retry-After",
    "content": {
      "application/json": {
        "schema": {
          "$ref": "#/components/schemas/Error"
        }
      }
    }
  }
}

Schemas

Generated from the same Zod contracts the service validates with.

Error
{
  "type": "object",
  "properties": {
    "error": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string",
          "enum": [
            "validation_error",
            "unauthorized",
            "forbidden",
            "not_found",
            "rate_limited",
            "model_error",
            "internal"
          ]
        },
        "message": {
          "type": "string"
        },
        "details": {}
      },
      "required": [
        "code",
        "message"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "error"
  ],
  "additionalProperties": false,
  "description": "Every failure, on every endpoint."
}
Health
{
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "enum": [
        "ok",
        "degraded"
      ],
      "description": "degraded (HTTP 503) when the database, storage or the model API fails its check"
    },
    "db": {
      "type": "string",
      "enum": [
        "ok",
        "error"
      ]
    },
    "storage": {
      "type": "string",
      "enum": [
        "ok",
        "error"
      ]
    },
    "model": {
      "type": "string",
      "description": "The deployment's default recognition model"
    },
    "model_api": {
      "type": "string",
      "enum": [
        "ok",
        "error",
        "not configured"
      ],
      "description": "The model API answered a live check within the last minute"
    },
    "embeddings": {
      "type": "string",
      "enum": [
        "ok",
        "error",
        "not configured"
      ],
      "description": "The embeddings service answered a live check. Without it garments are classified without similar examples and second opinion; not counted in status."
    },
    "version": {
      "type": "string"
    }
  },
  "required": [
    "status",
    "db",
    "storage",
    "model",
    "model_api",
    "embeddings",
    "version"
  ],
  "additionalProperties": false
}
Taxonomy
{
  "type": "object",
  "properties": {
    "version": {
      "type": "string"
    },
    "enums": {
      "type": "object",
      "propertyNames": {
        "type": "string"
      },
      "additionalProperties": {
        "type": "object",
        "propertyNames": {
          "type": "string"
        },
        "additionalProperties": {
          "type": "string"
        }
      }
    },
    "rubric": {
      "type": "object",
      "propertyNames": {
        "type": "string"
      },
      "additionalProperties": {
        "type": "string"
      }
    },
    "attributes": {
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  },
  "required": [
    "version",
    "enums",
    "rubric",
    "attributes"
  ],
  "additionalProperties": false
}
Sorting
{
  "type": "object",
  "properties": {
    "source": {
      "type": "string",
      "enum": [
        "robot",
        "organization",
        "default"
      ],
      "description": "Whose rules these are: the robot's own, the organization's, or the built-in default"
    },
    "bins": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "slot": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "id",
          "name",
          "slot"
        ],
        "additionalProperties": false
      }
    },
    "version": {
      "type": "number",
      "const": 2
    },
    "start": {
      "description": "First step: {node} or {bin}"
    },
    "nodes": {
      "type": "array",
      "items": {},
      "description": "The questions: field, outlets with their match and next step, otherwise, optional unsure guard"
    },
    "unsure": {
      "type": "string",
      "description": "Fallback bin, used when no answer is possible"
    },
    "gate": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "thresholds": {
              "type": "object",
              "propertyNames": {
                "type": "string"
              },
              "additionalProperties": {
                "type": "number"
              },
              "description": "Field → the certainty (0–1) it must reach; composition = fibre share (a NIR reading or care label counts as certain)"
            },
            "scope": {
              "type": "string",
              "enum": [
                "all",
                "path"
              ],
              "description": "all: every listed field on every garment. path: only the listed fields the garment's own path asks about, plus listed fields no question asks"
            },
            "max_retries": {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991,
              "description": "New unfolding sequences allowed after the first photo"
            },
            "exhausted_bin": {
              "type": "string",
              "description": "Bin for the TRASH command, after the last retry"
            },
            "test_signals": {
              "type": "boolean",
              "description": "True while testing: every garment gets REUNFOLD until the last attempt, then TRASH"
            },
            "test_signals_until": {
              "description": "When the test signals switch themselves off (at most 30 minutes after they were switched on); null when off",
              "type": [
                "string",
                "null"
              ]
            },
            "scene": {
              "anyOf": [
                {
                  "type": "object",
                  "properties": {
                    "reject_bin": {
                      "type": "string",
                      "description": "Bin for foreign objects (anything that is not a textile) and possible hazards (SORT)"
                    }
                  },
                  "required": [
                    "reject_bin"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "null"
                }
              ],
              "description": "The scene check (D121), before the certainty check: two or more garments, part of one or nothing in view gets REUNFOLD; a foreign object or a possible hazard goes to reject_bin; null when off"
            },
            "hard_parts": {
              "anyOf": [
                {
                  "type": "object",
                  "properties": {
                    "reject_bin": {
                      "type": "string",
                      "description": "Bin for garments with a hard part (SORT)"
                    },
                    "min_confidence": {
                      "type": "number",
                      "description": "A finding at or above this confidence (0–1) sends the garment there"
                    },
                    "before_node": {
                      "description": "D188: the id of the question the check stands before, so only garments whose path reaches that question are checked, after the certainty check; null: before the certainty check, every garment",
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "reject_bin",
                    "min_confidence",
                    "before_node"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "null"
                }
              ],
              "description": "Deprecated: the same check as the top-level hard_parts, kept here for robots reading older answers"
            }
          },
          "required": [
            "thresholds",
            "scope",
            "max_retries",
            "exhausted_bin",
            "test_signals",
            "test_signals_until",
            "scene",
            "hard_parts"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ],
      "description": "The certainty check this robot's garments go through before the questions; null when it has none"
    },
    "hard_parts": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "reject_bin": {
              "type": "string",
              "description": "Bin for garments with a hard part (SORT)"
            },
            "min_confidence": {
              "type": "number",
              "description": "A finding at or above this confidence (0–1) sends the garment there"
            },
            "before_node": {
              "description": "D188: the id of the question the check stands before, so only garments whose path reaches that question are checked, after the certainty check; null: before the certainty check, every garment",
              "type": [
                "string",
                "null"
              ]
            }
          },
          "required": [
            "reject_bin",
            "min_confidence",
            "before_node"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ],
      "description": "The hard parts check (D144, D150), after the scene check and before the certainty check, with or without one, unless before_node places it in the tree (D188): a metal, plastic or glass part found by the hard parts pass with at least min_confidence answers SORT to reject_bin, never a retry; a garment the pass did not check passes through; null when the findings are only noted on the garment"
    },
    "commands": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "code": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "name": {
            "type": "string",
            "enum": [
              "SORT",
              "REUNFOLD",
              "TRASH"
            ]
          },
          "action": {
            "type": "string",
            "enum": [
              "sort",
              "retry",
              "discard"
            ]
          },
          "meaning": {
            "type": "string"
          }
        },
        "required": [
          "code",
          "name",
          "action",
          "meaning"
        ],
        "additionalProperties": false
      },
      "description": "Every command a classification can carry, with its fixed number"
    }
  },
  "required": [
    "source",
    "bins",
    "version",
    "start",
    "nodes",
    "unsure",
    "gate",
    "hard_parts",
    "commands"
  ],
  "additionalProperties": false
}
Item
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
    },
    "status": {
      "type": "string",
      "enum": [
        "queued",
        "processing",
        "classified",
        "reviewed",
        "failed"
      ]
    },
    "source": {
      "type": "string",
      "enum": [
        "upload",
        "camera",
        "robot",
        "api"
      ]
    },
    "external_ref": {
      "type": [
        "string",
        "null"
      ]
    },
    "batch_id": {
      "anyOf": [
        {
          "type": "string",
          "format": "uuid",
          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
        },
        {
          "type": "null"
        }
      ]
    },
    "robot_id": {
      "anyOf": [
        {
          "type": "string",
          "format": "uuid",
          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
        },
        {
          "type": "null"
        }
      ]
    },
    "site_id": {
      "anyOf": [
        {
          "type": "string",
          "format": "uuid",
          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
        },
        {
          "type": "null"
        }
      ]
    },
    "error": {
      "type": [
        "string",
        "null"
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
    },
    "classified_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
        },
        {
          "type": "null"
        }
      ]
    },
    "reviewed_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
        },
        {
          "type": "null"
        }
      ]
    },
    "attempt": {
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991,
      "description": "1 for the first photo of a garment, 2 for its first retry …"
    },
    "retry_of": {
      "anyOf": [
        {
          "type": "string",
          "format": "uuid",
          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
        },
        {
          "type": "null"
        }
      ],
      "description": "The previous attempt at the same garment"
    },
    "nir": {
      "anyOf": [
        {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "fiber": {
                "type": "string"
              },
              "percent": {
                "type": "number"
              }
            },
            "required": [
              "fiber",
              "percent"
            ],
            "additionalProperties": false
          }
        },
        {
          "type": "null"
        }
      ],
      "description": "The NIR fibre reading sent with the photos, if any"
    },
    "needs_review": {
      "type": "boolean",
      "description": "True when the model and the trained classifier disagree on garment type or category; send the garment to a person"
    },
    "review_reasons": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "One line per attribute the two methods disagree on"
    },
    "sort": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "action": {
              "type": "string",
              "enum": [
                "sort",
                "retry",
                "discard"
              ],
              "description": "sort: put it in `bin`. retry: re-unfold, photograph again and send the photos with retry_of = this item's id. discard: retries used up, put it in `bin`."
            },
            "command": {
              "type": "string",
              "enum": [
                "SORT",
                "REUNFOLD",
                "TRASH"
              ],
              "description": "The same decision as a fixed robot command: SORT = put it in `bin`; REUNFOLD = start a new unfolding sequence and send the new photos with retry_of = this item's id; TRASH = the retries are used up, put it in `bin` (the bin after the last retry)"
            },
            "command_code": {
              "anyOf": [
                {
                  "type": "number",
                  "const": 0
                },
                {
                  "type": "number",
                  "const": 1
                },
                {
                  "type": "number",
                  "const": 2
                }
              ],
              "description": "The command as a number for a controller: SORT 0, REUNFOLD 1, TRASH 2. Never renumbered."
            },
            "bin": {
              "description": "Bin id, e.g. A; null when the action is retry",
              "type": [
                "string",
                "null"
              ]
            },
            "name": {
              "description": "Bin name as set in Cikada Vision, e.g. Bin A",
              "type": [
                "string",
                "null"
              ]
            },
            "slot": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991
                },
                {
                  "type": "null"
                }
              ],
              "description": "The bin's position on the machine, 1 = first; set by the bin order for the robot"
            },
            "attempt": {
              "type": "integer",
              "minimum": -9007199254740991,
              "maximum": 9007199254740991,
              "description": "1 for the first photo, 2 for the first retry …"
            },
            "max_attempts": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": -9007199254740991,
                  "maximum": 9007199254740991
                },
                {
                  "type": "null"
                }
              ],
              "description": "First photo plus allowed retries; null when the robot has no certainty check"
            },
            "below": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "field": {
                    "type": "string"
                  },
                  "confidence": {
                    "type": "number"
                  },
                  "threshold": {
                    "type": "number"
                  }
                },
                "required": [
                  "field",
                  "confidence",
                  "threshold"
                ],
                "additionalProperties": false
              },
              "description": "Fields below the certainty the robot requires (why it must retry or was discarded)"
            },
            "reason": {
              "description": "The path through the robot's questions as one line",
              "type": [
                "string",
                "null"
              ]
            },
            "path": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "node": {
                    "type": "string"
                  },
                  "field": {
                    "type": "string"
                  },
                  "value": {
                    "type": "string"
                  },
                  "confidence": {
                    "type": [
                      "number",
                      "null"
                    ]
                  },
                  "outlet": {
                    "type": "string"
                  }
                },
                "required": [
                  "node",
                  "field",
                  "value",
                  "confidence",
                  "outlet"
                ],
                "additionalProperties": false
              },
              "description": "Each question the garment passed, its value and the outlet it took"
            },
            "rules_version": {
              "description": "Id of the stored snapshot of the bins and decision tree that sorted this garment",
              "type": [
                "string",
                "null"
              ]
            },
            "degraded": {
              "type": "boolean",
              "description": "True when no classification was ready within the time budget of /classify/sync and the answer is the fallback bin (the bin people sort by hand). The garment is still classified afterwards for review; its bin never changes."
            }
          },
          "required": [
            "action",
            "command",
            "command_code",
            "bin",
            "name",
            "slot",
            "attempt",
            "max_attempts",
            "below",
            "reason",
            "path",
            "rules_version",
            "degraded"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ],
      "description": "The bin to put the garment in, decided when it was classified (null until then). Not changed by later reviews."
    },
    "images": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/ItemImage"
      }
    },
    "attributes": {
      "type": "object",
      "propertyNames": {
        "type": "string"
      },
      "additionalProperties": {
        "$ref": "#/components/schemas/Attribute"
      }
    },
    "classification": {
      "anyOf": [
        {
          "$ref": "#/components/schemas/GarmentClassification"
        },
        {
          "type": "null"
        }
      ],
      "description": "Latest full model output, validated against the contract"
    },
    "explanation": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "text": {
              "type": "string",
              "description": "Three to six plain sentences on why the garment got its values and its bin"
            },
            "model": {
              "type": "string",
              "description": "Model that wrote the text from the recorded decision"
            },
            "prediction_id": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
              "description": "The prediction it explains"
            },
            "created_at": {
              "type": "string"
            }
          },
          "required": [
            "text",
            "model",
            "prediction_id",
            "created_at"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ],
      "description": "Why the latest classification came out as it did, written from the recorded decision when someone opens the garment or calls POST /items/{id}/explain (event item.explained). Null until then. Describes the automatic result; later corrections are not part of it."
    },
    "defects": {
      "type": "object",
      "properties": {
        "list": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string"
              },
              "severity": {
                "type": "string"
              },
              "location": {
                "type": "string"
              },
              "confidence": {
                "type": [
                  "number",
                  "null"
                ]
              }
            },
            "required": [
              "type",
              "severity",
              "location",
              "confidence"
            ],
            "additionalProperties": false
          }
        },
        "source": {
          "type": "string",
          "enum": [
            "model",
            "human"
          ]
        },
        "corrected_at": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "list",
        "source",
        "corrected_at"
      ],
      "additionalProperties": false,
      "description": "The garment's defects now: a person's latest list (source human, no confidence; set with PATCH /items/{id}/attributes and `defects`) wins over the latest model output's (source model). The bin re-check, the dashboard and the organization's learning examples use this list."
    },
    "composition": {
      "type": "object",
      "properties": {
        "list": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "fiber": {
                "type": "string"
              },
              "percent": {
                "type": "number"
              }
            },
            "required": [
              "fiber",
              "percent"
            ],
            "additionalProperties": false
          }
        },
        "source": {
          "type": "string",
          "enum": [
            "model",
            "human"
          ]
        },
        "corrected_at": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "list",
        "source",
        "corrected_at"
      ],
      "additionalProperties": false,
      "description": "The care label's composition now: a person's latest reading (source human; set with PATCH /items/{id}/attributes and `composition`) wins over the latest model output's (source model). Either counts as a care label, measured rather than estimated, in the sorting logic; a NIR reading still comes first."
    },
    "hard_parts": {
      "type": "object",
      "properties": {
        "checked": {
          "type": "boolean",
          "description": "False when the hard parts pass did not run for this garment or did not answer in time; the check then let it through"
        },
        "summary": {
          "type": "string",
          "enum": [
            "none",
            "metal",
            "plastic",
            "mixed",
            "not_checked"
          ]
        },
        "findings": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "metal",
                  "plastic",
                  "glass",
                  "other_hard"
                ]
              },
              "part": {
                "type": "string",
                "enum": [
                  "button",
                  "snap",
                  "rivet",
                  "zipper",
                  "buckle",
                  "hook",
                  "bottle",
                  "other"
                ]
              },
              "location": {
                "type": "string"
              },
              "confidence": {
                "type": "number"
              },
              "image_id": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "The image the part is on"
              },
              "box": {
                "type": "object",
                "properties": {
                  "x": {
                    "type": "number"
                  },
                  "y": {
                    "type": "number"
                  },
                  "w": {
                    "type": "number"
                  },
                  "h": {
                    "type": "number"
                  }
                },
                "required": [
                  "x",
                  "y",
                  "w",
                  "h"
                ],
                "additionalProperties": false,
                "description": "Approximate box in fractions of the ORIGINAL photo: left, top, width, height"
              }
            },
            "required": [
              "kind",
              "part",
              "location",
              "confidence",
              "image_id",
              "box"
            ],
            "additionalProperties": false
          }
        },
        "model": {
          "type": [
            "string",
            "null"
          ]
        },
        "examples_version": {
          "description": "The facility's annotated examples the pass saw: the latest annotation's time, '' for none",
          "type": [
            "string",
            "null"
          ]
        },
        "annotations": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "image_id": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              "regions": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "x": {
                      "type": "number"
                    },
                    "y": {
                      "type": "number"
                    },
                    "w": {
                      "type": "number"
                    },
                    "h": {
                      "type": "number"
                    },
                    "kind": {
                      "type": "string",
                      "enum": [
                        "metal",
                        "plastic",
                        "glass",
                        "other_hard"
                      ]
                    },
                    "part": {
                      "type": "string",
                      "enum": [
                        "button",
                        "snap",
                        "rivet",
                        "zipper",
                        "buckle",
                        "hook",
                        "bottle",
                        "other"
                      ]
                    },
                    "note": {
                      "type": "string"
                    },
                    "source": {
                      "type": "string",
                      "enum": [
                        "person",
                        "confirmed"
                      ]
                    }
                  },
                  "required": [
                    "x",
                    "y",
                    "w",
                    "h",
                    "kind",
                    "part",
                    "note",
                    "source"
                  ],
                  "additionalProperties": false
                }
              },
              "frame": {
                "type": "object",
                "properties": {
                  "width": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  },
                  "height": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  }
                },
                "required": [
                  "width",
                  "height"
                ],
                "additionalProperties": false
              },
              "annotated_at": {
                "type": "string"
              }
            },
            "required": [
              "image_id",
              "regions",
              "frame",
              "annotated_at"
            ],
            "additionalProperties": false
          },
          "description": "People's regions per photo, the latest annotation of each (D145); an empty list of regions means a person confirmed there are no hard parts"
        }
      },
      "required": [
        "checked",
        "summary",
        "findings",
        "model",
        "examples_version",
        "annotations"
      ],
      "additionalProperties": false,
      "description": "Hard parts (metal, plastic, glass) found by the hard parts pass (D143) on the latest classification, and what people marked. The sorting logic's hard parts check reads the findings; annotations are shown to the pass as examples on later garments."
    },
    "resale_price": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "estimated",
            "unknown",
            "pending",
            "not_applicable"
          ],
          "description": "estimated: a price is set (a person's wins over the model's). unknown: the model could not say, or a person said the garment has no resale value. pending: the garment goes to reuse and the price is being estimated; read GET /items/{id} again or wait for item.priced. not_applicable: the garment does not go to reuse, or the organization has not switched the pass on."
        },
        "amount": {
          "description": "The asking price, in `currency`",
          "type": [
            "number",
            "null"
          ]
        },
        "low": {
          "description": "Low end of the range the model expects it to sell in (model estimates only)",
          "type": [
            "number",
            "null"
          ]
        },
        "high": {
          "description": "High end of that range (model estimates only)",
          "type": [
            "number",
            "null"
          ]
        },
        "currency": {
          "type": "string",
          "enum": [
            "SEK",
            "EUR"
          ],
          "description": "ISO 4217; the organization's currency (Settings → Organization)"
        },
        "confidence": {
          "description": "How sure the model is of the amount, 0–1 (model estimates only)",
          "type": [
            "number",
            "null"
          ]
        },
        "basis": {
          "description": "One sentence on what the model's price rests on",
          "type": [
            "string",
            "null"
          ]
        },
        "source": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "model",
                "human"
              ]
            },
            {
              "type": "null"
            }
          ]
        },
        "corrected_at": {
          "type": [
            "string",
            "null"
          ]
        },
        "model": {
          "type": [
            "string",
            "null"
          ]
        },
        "estimated_at": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "status",
        "amount",
        "low",
        "high",
        "currency",
        "confidence",
        "basis",
        "source",
        "corrected_at",
        "model",
        "estimated_at"
      ],
      "additionalProperties": false,
      "description": "Estimated resale price (D146): what a second-hand shop would ask for a garment going to reuse, estimated by a second model call after the classification, never on the robot's clock. A person's price (set with PATCH /items/{id}/attributes and `resale_price`) wins over the model's. The price never changes `sort`."
    },
    "predictions": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/Prediction"
      }
    }
  },
  "required": [
    "id",
    "status",
    "source",
    "external_ref",
    "batch_id",
    "robot_id",
    "site_id",
    "error",
    "created_at",
    "classified_at",
    "reviewed_at",
    "attempt",
    "retry_of",
    "nir",
    "needs_review",
    "review_reasons",
    "sort",
    "images",
    "attributes",
    "classification",
    "explanation",
    "defects",
    "composition",
    "hard_parts",
    "resale_price",
    "predictions"
  ],
  "additionalProperties": false
}
ItemAccepted
{
  "type": "object",
  "properties": {
    "item_id": {
      "type": "string",
      "format": "uuid",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
    },
    "status": {
      "type": "string",
      "const": "queued"
    }
  },
  "required": [
    "item_id",
    "status"
  ],
  "additionalProperties": false
}
ItemList
{
  "type": "object",
  "properties": {
    "data": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/Item"
      }
    },
    "next_cursor": {
      "type": [
        "string",
        "null"
      ]
    }
  },
  "required": [
    "data",
    "next_cursor"
  ],
  "additionalProperties": false
}
CreateItemJson
{
  "type": "object",
  "properties": {
    "image_urls": {
      "minItems": 1,
      "maxItems": 8,
      "type": "array",
      "items": {
        "type": "string",
        "format": "uri"
      }
    },
    "views": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "front",
          "back",
          "label",
          "detail",
          "unknown"
        ]
      }
    },
    "external_ref": {
      "type": "string",
      "maxLength": 120
    },
    "robot_id": {
      "type": "string",
      "format": "uuid",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
    },
    "batch_id": {
      "type": "string",
      "format": "uuid",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
    },
    "retry_of": {
      "description": "The previous attempt at this garment, after a retry action",
      "type": "string",
      "format": "uuid",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
    },
    "nir": {
      "minItems": 1,
      "maxItems": 10,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "fiber": {
            "type": "string",
            "minLength": 1,
            "maxLength": 40
          },
          "percent": {
            "type": "number",
            "minimum": 0,
            "maximum": 100
          }
        },
        "required": [
          "fiber",
          "percent"
        ],
        "additionalProperties": false
      },
      "description": "NIR fibre reading, e.g. [{\"fiber\":\"cotton\",\"percent\":92.5}]; used by the sorting logic before a care label or the simulation"
    }
  },
  "required": [
    "image_urls"
  ],
  "additionalProperties": false,
  "description": "Alternative to multipart: images already hosted at HTTPS URLs."
}
PatchAttributes
{
  "type": "object",
  "properties": {
    "attributes": {
      "default": {},
      "type": "object",
      "propertyNames": {
        "type": "string"
      },
      "additionalProperties": {
        "type": "string",
        "minLength": 1,
        "maxLength": 60
      }
    },
    "defects": {
      "description": "The garment's whole list of defects as a person sees it, replacing the model's (an empty list: no defects). Types and severities as in GET /taxonomy; location up to 60 characters.",
      "maxItems": 20,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "stain",
              "hole",
              "tear",
              "pilling",
              "fading",
              "missing_button",
              "broken_zipper",
              "stretched",
              "odor_visible_signs",
              "discoloration",
              "other"
            ]
          },
          "severity": {
            "type": "string",
            "enum": [
              "minor",
              "moderate",
              "severe"
            ]
          },
          "location": {
            "default": "",
            "type": "string",
            "maxLength": 60
          }
        },
        "required": [
          "type",
          "severity",
          "location"
        ],
        "additionalProperties": false
      }
    },
    "composition": {
      "description": "The care label as a person reads it, replacing the model's reading: fibres with their percent, adding up to 100 ± 2 (an empty list: no label to read). Fibre names in lower case, e.g. cotton, polyester, elastane.",
      "maxItems": 10,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "fiber": {
            "type": "string",
            "minLength": 1,
            "maxLength": 40
          },
          "percent": {
            "type": "number",
            "minimum": 0,
            "maximum": 100
          }
        },
        "required": [
          "fiber",
          "percent"
        ],
        "additionalProperties": false
      }
    },
    "regions": {
      "description": "D145: a person's regions on one photo, replacing the earlier annotation of that photo",
      "type": "object",
      "properties": {
        "image_id": {
          "type": "string",
          "format": "uuid",
          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$",
          "description": "One of the garment's images (GET /items/{id} → images[].id)"
        },
        "regions": {
          "maxItems": 20,
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "x": {
                "type": "number",
                "minimum": 0,
                "maximum": 1
              },
              "y": {
                "type": "number",
                "minimum": 0,
                "maximum": 1
              },
              "w": {
                "type": "number",
                "minimum": 0.01,
                "maximum": 1
              },
              "h": {
                "type": "number",
                "minimum": 0.01,
                "maximum": 1
              },
              "kind": {
                "type": "string",
                "enum": [
                  "metal",
                  "plastic",
                  "glass",
                  "other_hard"
                ]
              },
              "part": {
                "type": "string",
                "enum": [
                  "button",
                  "snap",
                  "rivet",
                  "zipper",
                  "buckle",
                  "hook",
                  "bottle",
                  "other"
                ]
              },
              "note": {
                "default": "",
                "type": "string",
                "maxLength": 60
              },
              "source": {
                "default": "person",
                "type": "string",
                "enum": [
                  "person",
                  "confirmed"
                ]
              }
            },
            "required": [
              "x",
              "y",
              "w",
              "h",
              "kind",
              "part",
              "note",
              "source"
            ],
            "additionalProperties": false
          },
          "description": "The hard parts on that photo as boxes in fractions of the ORIGINAL photo (x, y from the top-left, w, h), each with kind (metal, plastic, glass, other_hard), part (button, snap, rivet, zipper, buckle, hook, bottle, other) and an optional note; an empty list: a person confirmed there are no hard parts"
        },
        "frame": {
          "type": "object",
          "properties": {
            "width": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 9007199254740991
            },
            "height": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 9007199254740991
            }
          },
          "required": [
            "width",
            "height"
          ],
          "additionalProperties": false,
          "description": "The original photo's size in pixels as shown to the person"
        }
      },
      "required": [
        "image_id",
        "regions",
        "frame"
      ],
      "additionalProperties": false
    },
    "resale_price": {
      "description": "D146: a person's resale price for the garment, {amount, currency?} in the organization's currency (SEK or EUR), replacing the model's estimate; null says the garment has no resale value",
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "amount": {
              "type": "number",
              "minimum": 0,
              "maximum": 100000
            },
            "currency": {
              "type": "string",
              "enum": [
                "SEK",
                "EUR"
              ]
            }
          },
          "required": [
            "amount"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ]
    },
    "reviewer": {
      "type": "string",
      "minLength": 1,
      "maxLength": 80
    },
    "mark_reviewed": {
      "description": "Also mark the garment reviewed (D112): it then becomes one of the organization's verified examples, as a review in the app does",
      "type": "boolean"
    }
  },
  "required": [
    "attributes",
    "reviewer"
  ],
  "additionalProperties": false
}
PatchResult
{
  "type": "object",
  "properties": {
    "item_id": {
      "type": "string",
      "format": "uuid",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
    },
    "corrections": {
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991,
      "description": "Attribute values that changed"
    },
    "defects_corrected": {
      "type": "boolean",
      "description": "Whether the list of defects changed"
    },
    "composition_corrected": {
      "type": "boolean",
      "description": "Whether the care label's composition changed"
    },
    "regions_annotated": {
      "type": "boolean",
      "description": "Whether the photo's regions changed"
    },
    "resale_price_corrected": {
      "type": "boolean",
      "description": "Whether the resale price changed"
    },
    "reviewed": {
      "type": "boolean"
    }
  },
  "required": [
    "item_id",
    "corrections",
    "defects_corrected",
    "composition_corrected",
    "regions_annotated",
    "resale_price_corrected",
    "reviewed"
  ],
  "additionalProperties": false
}
RequestDecision
{
  "type": "object",
  "properties": {
    "wait_ms": {
      "description": "How long the robot can wait for the classification, in ms. Capped at the server's time budget (25 000 by default), which is also the default.",
      "type": "integer",
      "minimum": 0,
      "maximum": 50000
    }
  },
  "additionalProperties": false,
  "description": "Asked when the garment reaches the diverter. Past wait_ms the fallback bin becomes the garment's decision."
}
CreateBatch
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
    },
    "source": {
      "default": "robot",
      "type": "string",
      "enum": [
        "upload",
        "camera",
        "robot",
        "api"
      ]
    }
  },
  "required": [
    "name",
    "source"
  ],
  "additionalProperties": false
}
Batch
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
    },
    "name": {
      "type": "string"
    },
    "source": {
      "type": "string",
      "enum": [
        "upload",
        "camera",
        "robot",
        "api"
      ]
    },
    "item_count": {
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
    }
  },
  "required": [
    "id",
    "name",
    "source",
    "item_count",
    "created_at"
  ],
  "additionalProperties": false
}
Attribute
{
  "type": "object",
  "properties": {
    "value": {
      "type": "string"
    },
    "confidence": {
      "type": "number",
      "minimum": 0,
      "maximum": 1
    },
    "source": {
      "type": "string",
      "enum": [
        "model",
        "human"
      ]
    },
    "evidence": {
      "type": [
        "string",
        "null"
      ]
    }
  },
  "required": [
    "value",
    "confidence",
    "source"
  ],
  "additionalProperties": false,
  "description": "Current value of one attribute: latest human correction if any, else the latest model value."
}
ItemImage
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
    },
    "view": {
      "type": "string",
      "enum": [
        "front",
        "back",
        "label",
        "detail",
        "unknown"
      ]
    },
    "position": {
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991
    },
    "width": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        {
          "type": "null"
        }
      ]
    },
    "height": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        {
          "type": "null"
        }
      ]
    },
    "urls": {
      "type": "object",
      "properties": {
        "original": {
          "anyOf": [
            {
              "type": "string",
              "format": "uri"
            },
            {
              "type": "null"
            }
          ]
        },
        "model_input": {
          "anyOf": [
            {
              "type": "string",
              "format": "uri"
            },
            {
              "type": "null"
            }
          ]
        },
        "thumbnail": {
          "anyOf": [
            {
              "type": "string",
              "format": "uri"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "original",
        "model_input",
        "thumbnail"
      ],
      "additionalProperties": false,
      "description": "Signed URLs valid for one hour"
    }
  },
  "required": [
    "id",
    "view",
    "position",
    "width",
    "height",
    "urls"
  ],
  "additionalProperties": false
}
Prediction
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
    },
    "model": {
      "type": "string"
    },
    "prompt_version": {
      "type": "string"
    },
    "latency_ms": {
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991
    },
    "input_tokens": {
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991
    },
    "output_tokens": {
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991
    },
    "attempts": {
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
    }
  },
  "required": [
    "id",
    "model",
    "prompt_version",
    "latency_ms",
    "input_tokens",
    "output_tokens",
    "attempts",
    "created_at"
  ],
  "additionalProperties": false
}
CreateWebhook
{
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "maxLength": 2000,
      "format": "uri"
    },
    "events": {
      "minItems": 1,
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "item.classified",
          "item.reviewed",
          "item.explained",
          "item.priced",
          "line.alert"
        ]
      }
    },
    "description": {
      "type": "string",
      "maxLength": 200
    }
  },
  "required": [
    "url",
    "events"
  ],
  "additionalProperties": false
}
Webhook
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
    },
    "url": {
      "type": "string"
    },
    "events": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "active": {
      "type": "boolean"
    },
    "description": {
      "type": [
        "string",
        "null"
      ]
    },
    "failure_count": {
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991
    },
    "last_delivery_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
    },
    "secret": {
      "description": "Only present in the creation response",
      "type": "string"
    }
  },
  "required": [
    "id",
    "url",
    "events",
    "active",
    "description",
    "failure_count",
    "last_delivery_at",
    "created_at"
  ],
  "additionalProperties": false
}
WebhookDelivery
{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
    },
    "event": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "pending",
        "delivered",
        "failed",
        "exhausted"
      ]
    },
    "status_code": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        {
          "type": "null"
        }
      ]
    },
    "attempts": {
      "type": "integer",
      "minimum": -9007199254740991,
      "maximum": 9007199254740991
    },
    "next_retry_at": {
      "type": "string",
      "format": "date-time",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
    },
    "delivered_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
        },
        {
          "type": "null"
        }
      ]
    },
    "last_error": {
      "type": [
        "string",
        "null"
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
    }
  },
  "required": [
    "id",
    "event",
    "status",
    "status_code",
    "attempts",
    "next_retry_at",
    "delivered_at",
    "last_error",
    "created_at"
  ],
  "additionalProperties": false
}
GarmentClassification
{
  "type": "object",
  "properties": {
    "garment_type": {
      "type": "object",
      "properties": {
        "value": {
          "type": "string",
          "enum": [
            "t_shirt",
            "shirt",
            "blouse",
            "polo",
            "tank_top",
            "sweater",
            "cardigan",
            "hoodie",
            "sweatshirt",
            "vest",
            "jeans",
            "trousers",
            "shorts",
            "skirt",
            "leggings",
            "joggers",
            "dress",
            "jumpsuit",
            "overalls",
            "jacket",
            "coat",
            "blazer",
            "parka",
            "raincoat",
            "underwear",
            "socks",
            "swimwear",
            "sportswear",
            "nightwear",
            "scarf",
            "hat",
            "gloves",
            "bag",
            "shoes",
            "home_textile",
            "workwear",
            "other",
            "unknown"
          ],
          "description": "Type of garment"
        },
        "confidence": {
          "type": "number",
          "minimum": 0,
          "maximum": 1,
          "description": "Confidence between 0 and 1"
        },
        "evidence": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 120
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "value",
        "confidence"
      ],
      "additionalProperties": false
    },
    "garment_category": {
      "type": "object",
      "properties": {
        "value": {
          "type": "string",
          "enum": [
            "tops",
            "bottoms",
            "full_body",
            "outerwear",
            "underwear",
            "accessories",
            "footwear",
            "home_textile",
            "other",
            "unknown"
          ],
          "description": "Category the garment type belongs to"
        },
        "confidence": {
          "type": "number",
          "minimum": 0,
          "maximum": 1,
          "description": "Confidence between 0 and 1"
        },
        "evidence": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 120
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "value",
        "confidence"
      ],
      "additionalProperties": false
    },
    "primary_color": {
      "type": "object",
      "properties": {
        "value": {
          "type": "string",
          "enum": [
            "black",
            "white",
            "grey",
            "navy",
            "blue",
            "light_blue",
            "green",
            "olive",
            "red",
            "burgundy",
            "pink",
            "purple",
            "orange",
            "yellow",
            "beige",
            "brown",
            "cream",
            "multicolor",
            "unknown"
          ],
          "description": "Colour covering most of the garment"
        },
        "confidence": {
          "type": "number",
          "minimum": 0,
          "maximum": 1,
          "description": "Confidence between 0 and 1"
        },
        "evidence": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 120
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "value",
        "confidence"
      ],
      "additionalProperties": false
    },
    "secondary_color": {
      "type": "object",
      "properties": {
        "value": {
          "type": "string",
          "enum": [
            "black",
            "white",
            "grey",
            "navy",
            "blue",
            "light_blue",
            "green",
            "olive",
            "red",
            "burgundy",
            "pink",
            "purple",
            "orange",
            "yellow",
            "beige",
            "brown",
            "cream",
            "multicolor",
            "none",
            "unknown"
          ],
          "description": "Second most prominent colour, or none"
        },
        "confidence": {
          "type": "number",
          "minimum": 0,
          "maximum": 1,
          "description": "Confidence between 0 and 1"
        },
        "evidence": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 120
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "value",
        "confidence"
      ],
      "additionalProperties": false
    },
    "color_hex": {
      "type": "object",
      "properties": {
        "value": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^#[0-9A-F]{6}$",
              "description": "Dominant colour as an uppercase hex value like #1B4D3E"
            },
            {
              "type": "string",
              "const": "unknown"
            }
          ]
        },
        "confidence": {
          "type": "number",
          "minimum": 0,
          "maximum": 1,
          "description": "Confidence between 0 and 1"
        },
        "evidence": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 120
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "value",
        "confidence"
      ],
      "additionalProperties": false
    },
    "pattern": {
      "type": "object",
      "properties": {
        "value": {
          "type": "string",
          "enum": [
            "solid",
            "striped",
            "checked",
            "floral",
            "graphic_print",
            "logo_print",
            "dotted",
            "camouflage",
            "animal",
            "abstract",
            "other",
            "unknown"
          ],
          "description": "Surface pattern"
        },
        "confidence": {
          "type": "number",
          "minimum": 0,
          "maximum": 1,
          "description": "Confidence between 0 and 1"
        },
        "evidence": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 120
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "value",
        "confidence"
      ],
      "additionalProperties": false
    },
    "condition_grade": {
      "type": "object",
      "properties": {
        "value": {
          "type": "string",
          "enum": [
            "A",
            "B",
            "C",
            "D",
            "unknown"
          ],
          "description": "Condition grade A to D per the rubric"
        },
        "confidence": {
          "type": "number",
          "minimum": 0,
          "maximum": 1,
          "description": "Confidence between 0 and 1"
        },
        "evidence": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 120
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "value",
        "confidence"
      ],
      "additionalProperties": false
    },
    "defects": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "stain",
              "hole",
              "tear",
              "pilling",
              "fading",
              "missing_button",
              "broken_zipper",
              "stretched",
              "odor_visible_signs",
              "discoloration",
              "other"
            ]
          },
          "severity": {
            "type": "string",
            "enum": [
              "minor",
              "moderate",
              "severe"
            ]
          },
          "location": {
            "type": "string",
            "maxLength": 60,
            "description": "Where on the garment, at most 60 characters"
          },
          "confidence": {
            "type": "number",
            "minimum": 0,
            "maximum": 1,
            "description": "Confidence between 0 and 1"
          }
        },
        "required": [
          "type",
          "severity",
          "location",
          "confidence"
        ],
        "additionalProperties": false
      }
    },
    "recommended_route": {
      "type": "object",
      "properties": {
        "value": {
          "type": "string",
          "enum": [
            "reuse",
            "repair",
            "recycle_fiber",
            "waste",
            "unknown"
          ],
          "description": "Recommended handling route"
        },
        "confidence": {
          "type": "number",
          "minimum": 0,
          "maximum": 1,
          "description": "Confidence between 0 and 1"
        },
        "evidence": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 120
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "value",
        "confidence"
      ],
      "additionalProperties": false
    },
    "material_primary": {
      "type": "object",
      "properties": {
        "value": {
          "type": "string",
          "enum": [
            "cotton",
            "polyester",
            "wool",
            "viscose",
            "linen",
            "nylon",
            "acrylic",
            "elastane",
            "silk",
            "cashmere",
            "denim_cotton",
            "leather",
            "blend",
            "unknown"
          ],
          "description": "Main fibre"
        },
        "confidence": {
          "type": "number",
          "minimum": 0,
          "maximum": 1,
          "description": "Confidence between 0 and 1"
        },
        "evidence": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 120
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "value",
        "confidence"
      ],
      "additionalProperties": false
    },
    "material_composition": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "fiber": {
            "type": "string",
            "description": "Fibre name as printed on the care label"
          },
          "percent": {
            "type": "number",
            "minimum": 0,
            "maximum": 100,
            "description": "Percentage 0 to 100"
          }
        },
        "required": [
          "fiber",
          "percent"
        ],
        "additionalProperties": false
      },
      "description": "Only from a visible care label. Empty when no label is readable."
    },
    "material_source": {
      "type": "string",
      "enum": [
        "care_label_ocr",
        "visual_estimate",
        "unknown"
      ]
    },
    "brand": {
      "type": "object",
      "properties": {
        "value": {
          "type": "string",
          "maxLength": 60,
          "description": "Brand from a visible label or unmistakable logo. Use \"unknown\" when not visible."
        },
        "confidence": {
          "type": "number",
          "minimum": 0,
          "maximum": 1,
          "description": "Confidence between 0 and 1"
        },
        "evidence": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 120
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "value",
        "confidence"
      ],
      "additionalProperties": false
    },
    "size": {
      "type": "object",
      "properties": {
        "value": {
          "type": "string",
          "maxLength": 12,
          "description": "Size from a visible label. Use \"unknown\" when not visible."
        },
        "confidence": {
          "type": "number",
          "minimum": 0,
          "maximum": 1,
          "description": "Confidence between 0 and 1"
        },
        "evidence": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 120
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "value",
        "confidence"
      ],
      "additionalProperties": false
    },
    "gender_segment": {
      "type": "object",
      "properties": {
        "value": {
          "type": "string",
          "enum": [
            "women",
            "men",
            "unisex",
            "kids",
            "baby",
            "unknown"
          ],
          "description": "Intended wearer"
        },
        "confidence": {
          "type": "number",
          "minimum": 0,
          "maximum": 1,
          "description": "Confidence between 0 and 1"
        },
        "evidence": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 120
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "value",
        "confidence"
      ],
      "additionalProperties": false
    },
    "sleeve_length": {
      "type": "object",
      "properties": {
        "value": {
          "type": "string",
          "enum": [
            "sleeveless",
            "short",
            "three_quarter",
            "long",
            "not_applicable",
            "unknown"
          ],
          "description": "Sleeve length"
        },
        "confidence": {
          "type": "number",
          "minimum": 0,
          "maximum": 1,
          "description": "Confidence between 0 and 1"
        },
        "evidence": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 120
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "value",
        "confidence"
      ],
      "additionalProperties": false
    },
    "closure": {
      "type": "object",
      "properties": {
        "value": {
          "type": "string",
          "enum": [
            "none",
            "buttons",
            "zipper",
            "hook",
            "drawstring",
            "velcro",
            "other",
            "unknown"
          ],
          "description": "Main closure"
        },
        "confidence": {
          "type": "number",
          "minimum": 0,
          "maximum": 1,
          "description": "Confidence between 0 and 1"
        },
        "evidence": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 120
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "value",
        "confidence"
      ],
      "additionalProperties": false
    },
    "season": {
      "type": "object",
      "properties": {
        "value": {
          "type": "string",
          "enum": [
            "summer",
            "winter",
            "all_season",
            "unknown"
          ],
          "description": "Season the garment is made for"
        },
        "confidence": {
          "type": "number",
          "minimum": 0,
          "maximum": 1,
          "description": "Confidence between 0 and 1"
        },
        "evidence": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 120
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "value",
        "confidence"
      ],
      "additionalProperties": false
    },
    "care_label_text": {
      "description": "Verbatim text of a visible care label, or null",
      "anyOf": [
        {
          "type": "string",
          "maxLength": 500
        },
        {
          "type": "null"
        }
      ]
    },
    "notes": {
      "description": "Anything an operator should know, or null",
      "anyOf": [
        {
          "type": "string",
          "maxLength": 300
        },
        {
          "type": "null"
        }
      ]
    },
    "scene": {
      "type": "string",
      "enum": [
        "single",
        "multiple",
        "partial",
        "empty",
        "foreign_object",
        "unknown"
      ],
      "description": "What the photos show"
    },
    "contamination": {
      "type": "string",
      "enum": [
        "none",
        "wet",
        "mould",
        "heavy_soil",
        "hazard",
        "unknown"
      ],
      "description": "Contamination visible on the garment"
    }
  },
  "required": [
    "garment_type",
    "garment_category",
    "primary_color",
    "secondary_color",
    "color_hex",
    "pattern",
    "condition_grade",
    "defects",
    "recommended_route",
    "material_primary",
    "material_composition",
    "material_source",
    "brand",
    "size",
    "gender_segment",
    "sleeve_length",
    "closure",
    "season"
  ],
  "additionalProperties": false,
  "description": "Full model output: every attribute with a 0–1 confidence, defects, composition and label text."
}

Webhooks

Subscribe in Settings to item.classified, item.reviewed and item.explained (the plain-language explanation of a classification, in data.explanation.text, once one is written: when someone opens the garment or calls POST /items/{id}/explain). Each delivery is a JSON POST { event, item_id, org_id, occurred_at, data } signed with your endpoint secret. Verify before acting on it. Failed deliveries retry five times over twelve hours.

line.alert tells a shift lead that the line needs a person now, checked every minute around the clock: data.alert is one of robot_silent, reunfold_high, trash_high, failures, slow_answers, model_api_down or test_signals_on, with robot_id, robot_name, a one-line message, the measured value and the threshold; item_id is null. The same alert is not repeated within 30 minutes. Point the webhook at Teams, Slack, Telegram or a pager through any relay that accepts a JSON POST.

import hashlib, hmac

def verify(secret: str, body: bytes, signature_header: str) -> bool:
    # X-Cikada-Signature: sha256=<hex HMAC of the raw body>
    expected = "sha256=" + hmac.new(secret.encode(), body, hashlib.sha256).hexdigest()
    return hmac.compare_digest(expected, signature_header)
Developers · Cikada Vision