Approve a batch of drafts after reviewing a sample (human curator or admin)
POST /v1/ops/drafts/batch- quién puede llamarla
- Un operador
- una persona:
adminocurator· Never the proposer of a draft in the batch. - cuán reciente
- Nunca en caché
- cada respuesta lleva la altura del índice y la del nodo
- Herramienta MCP
- Ninguna
En esta página
The batch holds 1 to 500 drafts, every one still a draft, none proposed by the reviewer. reviewed lists the sample the reviewer checked: at least 25 drafts of the batch, or all of them when it holds fewer. A draft a guard holds stays a draft for its own decision: a subject another source names as a service (collision), an abuse word no other source gives the subject (single_source), a chain fact that does not match (chain_mismatch). The other drafts are published one by one with the reviewer as actor; a failure stops the batch at stopped_at. One draft_batch audit row records the batch, the sample and the note.
Parámetros
| Nombre | Dónde | Tipo | Obligatorio | Qué hace |
|---|---|---|---|---|
draft_ids | cuerpo | array | obligatorio | The drafts to approve, 1 to 500, each once: every one still a draft, and none proposed by the reviewer. |
reviewed | cuerpo | array | obligatorio | The sample the reviewer checked; part of draft_ids. |
note | cuerpo | string | obligatorio | What the reviewer checked. |
El cuerpo es application/json.
esquema
draft_idsarray de integer obligatorio — The drafts to approve, 1 to 500, each once: every one still a draft, and none proposed by the reviewer.reviewedarray de integer obligatorio — The sample the reviewer checked; part of draft_ids.notestring obligatorio — What the reviewer checked.
Qué responde
What was approved, what a guard held and, on a failure, where the batch stopped.
| Campo | Tipo | Qué lleva |
|---|---|---|
approved | array | The drafts approved and published, in the batch's order. |
approved[].draft_id | integer | The draft's id. |
approved[].claim_id | string | ann_<n> for an annotation draft. |
held | array | The drafts a guard held: they stay drafts, each for its own decision. |
held[].draft_id | integer | The draft's id. |
held[].reason | string | The guard that holds it, with the text the CSV gives: single_source: …, collision: … or chain_mismatch: …. |
stopped_at | object | Where the batch stopped on a failure: the draft that failed, and why. The drafts after it stay drafts. Absent when the batch ran to its end. |
esquema
approvedarray de object obligatorio — The drafts approved and published, in the batch's order.draft_idinteger obligatorio — The draft's id.claim_idstring — ann_<n> for an annotation draft.
heldarray de object obligatorio — The drafts a guard held: they stay drafts, each for its own decision.draft_idinteger obligatorio — The draft's id.reasonstring obligatorio — The guard that holds it, with the text the CSV gives:single_source: …,collision: …orchain_mismatch: ….
stopped_atobject — Where the batch stopped on a failure: the draft that failed, and why. The drafts after it stay drafts. Absent when the batch ran to its end.draft_idinteger — The draft whose approval failed.errorstring — What went wrong, as the writer said it.
Errores
| Estado | Código | Cuándo |
|---|---|---|
| 400 | invalid_input | Malformed input (invalid_input). |
| 401 | unauthorized | unauthorized: the request does not say who makes it, or what it offers does not verify: no key or session where one is needed, or a password, a code, a passkey or a signed event that does not check. The message says what is missing. |
| 403 | forbidden | forbidden: the caller is known but may not do this: a key without the scope or the tier the action needs, a session without an npub, a second factor or a recent sign-in, an operator without the role or switched off, or a source that does not allow it. The message says which. |
| 404 | not_found | not_found: what the path names is not known: not in the index (for a transaction, not in the node's mempool either), or no such record. The message says which. |
| 409 | conflict | A draft of the batch was decided already (conflict, naming them). |
| 422 | invalid_input | invalid_input: a draft of the batch has no source to publish under. |
| 429 | quota_exceeded | quota_exceeded: the caller's tier ran out of requests for the minute or the day. Retry-After says when to try again; every rate-limited answer carries X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset and X-RateLimit-Tier. While the deployment runs in log-only mode the decision is logged instead and X-RateLimit-Policy: log-only is set. |
Cada uno llega en el sobre de error único, y ninguno se guarda en caché: un error lleva Cache-Control: no-store.
Ejemplo
curl y jq, en cualquier shell.
curl -s -X POST https://api.btcintel.io/v1/ops/drafts/batch \
-H "Authorization: Bearer $BTCINTEL_KEY" \
-H 'Content-Type: application/json' \
-d '{"draft_ids":[],"reviewed":[],"note":"…"}' | jqThis route needs an operator credential. Set BTCINTEL_KEY to the ops bearer or a btci_ key with the ops:agent scope first: the snippet reads it from there and holds no key.