btcintel

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: admin o curator · Never the proposer of a draft in the batch.
qué cuesta
1 petición de la cuota
niveles y claves
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

NombreDóndeTipoObligatorioQué hace
draft_idscuerpoarrayobligatorioThe drafts to approve, 1 to 500, each once: every one still a draft, and none proposed by the reviewer.
reviewedcuerpoarrayobligatorioThe sample the reviewer checked; part of draft_ids.
notecuerpostringobligatorioWhat the reviewer checked.

El cuerpo es application/json.

esquema
  • draft_ids array de integer obligatorio — The drafts to approve, 1 to 500, each once: every one still a draft, and none proposed by the reviewer.
  • reviewed array de integer obligatorio — The sample the reviewer checked; part of draft_ids.
  • note string obligatorio — What the reviewer checked.

Qué responde

What was approved, what a guard held and, on a failure, where the batch stopped.

CampoTipoQué lleva
approvedarrayThe drafts approved and published, in the batch's order.
approved[].draft_idintegerThe draft's id.
approved[].claim_idstringann_<n> for an annotation draft.
heldarrayThe drafts a guard held: they stay drafts, each for its own decision.
held[].draft_idintegerThe draft's id.
held[].reasonstringThe guard that holds it, with the text the CSV gives: single_source: …, collision: … or chain_mismatch: ….
stopped_atobjectWhere 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
  • approved array de object obligatorio — The drafts approved and published, in the batch's order.
    • draft_id integer obligatorio — The draft's id.
    • claim_id string — ann_<n> for an annotation draft.
  • held array de object obligatorio — The drafts a guard held: they stay drafts, each for its own decision.
    • draft_id integer obligatorio — The draft's id.
    • reason string obligatorio — 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.
    • draft_id integer — The draft whose approval failed.
    • error string — What went wrong, as the writer said it.

Errores

EstadoCódigoCuándo
400invalid_inputMalformed input (invalid_input).
401unauthorizedunauthorized: 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.
403forbiddenforbidden: 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.
404not_foundnot_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.
409conflictA draft of the batch was decided already (conflict, naming them).
422invalid_inputinvalid_input: a draft of the batch has no source to publish under.
429quota_exceededquota_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":"…"}' | jq

This 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.