btcintel

Approve a batch of drafts after reviewing a sample (human curator or admin)

POST /v1/ops/drafts/batch
who may call it
An operator
a human: admin or curator · Never the proposer of a draft in the batch.
what it costs
1 request of the quota
tiers and keys
how fresh
Never cached
every answer carries the index's height and the node's
MCP tool
None
On this page

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.

Parameters

NameWhereTypeRequiredWhat it does
draft_idsbodyarrayrequiredThe drafts to approve, 1 to 500, each once: every one still a draft, and none proposed by the reviewer.
reviewedbodyarrayrequiredThe sample the reviewer checked; part of draft_ids.
notebodystringrequiredWhat the reviewer checked.

The body is application/json.

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

What it answers

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

FieldTypeWhat it carries
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.
schema
  • approved array of object required — The drafts approved and published, in the batch's order.
    • draft_id integer required — The draft's id.
    • claim_id string — ann_<n> for an annotation draft.
  • held array of object required — The drafts a guard held: they stay drafts, each for its own decision.
    • draft_id integer required — The draft's id.
    • reason string required — 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.

Errors

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

Each comes in the one error envelope, and none is cached: an error carries Cache-Control: no-store.

Example

curl and jq, in any 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.