btcintel

Push a source file through its parser (ops)

POST /v1/sources/{id}/import
who may call it
An operator
An agent imports only a source flagged agent_may_publish.
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 source must be registered (btcintel intel source add) and signed off. Body: the raw file, or multipart/form-data with a file field. Runs synchronously within the import budget (30 s) and answers 202 with the run id otherwise (poll /v1/ops/imports/{id}). A campaign source writes its claims as the campaign's members, in the state the guards decide (provisional counts them). A record that is not text PostgreSQL stores (a NUL byte, raw or \u0000, an escaped surrogate outside a pair, bytes that are not UTF-8, or in XML a character reference to a surrogate) is rejected and the rest of the file imported: nothing of it is written, rejected counts it and the run's notes name it by its position and key, never by its content; the import withdraws nothing that record may have stated. An ATT&CK relationship to an object rejected so is rejected with it, since the fetch does not describe that object.

Parameters

NameWhereTypeRequiredWhat it does
idpathstringrequiredRegistered source id.
filenamequerystringoptionalRecorded in the fetch notes. One that holds a private key is a 400, and nothing is recorded.

The body is application/octet-stream.

schema

string (binary)

What it answers

200 · application/json

Import finished.

FieldTypeWhat it carries
fetch_idintegerThe fetch the import recorded for the file: the one its claims cite.
import_run_idintegerThe import's run: the id GET /v1/ops/imports/{id} takes.
insertedintegerClaims created or re-versioned.
confirmedintegerClaims the fetch restated unchanged.
expiredintegerClaims, relations and signatures the source stopped saying.
skippedintegerClaims left out and noted on the run: an invalid subject, a word outside the vocabulary, a campaign member without a campaign role (victim, sweep, vault, cash_out), a victim with an abuse word.
rejectedintegerRecords left out whole because they are not text PostgreSQL stores (a NUL byte, an escaped surrogate outside a pair, bytes that are not UTF-8, or in XML a character reference to a surrogate), with, for a dossier source, every record of a dossier that holds one, and an ATT&CK relationship to an object rejected so, or because they hold a Bitcoin private key (a WIF key or an extended private key); named on the run by position and key, by position alone for a private key; included in record_count. Nothing of them is written and nothing they may have stated is withdrawn: their claims stay as they were, and while a fetch rejects a record no relation, signature, alias or identifier of the source is withdrawn.
record_countintegerRecords the parser emitted from the file, distinct by record key, the rejected ones included: rows as parsed, not claims (see Source.last_fetch.record_count).
provisionalintegerCampaign members that landed provisional: a source's first import into the campaign, a batch over the batch size, or a sweep, vault or cash-out named by one source. Included in inserted.
promotedintegerMembers held back only for want of a second source that another source now names: current now.
schema ImportResult
  • fetch_id integer — The fetch the import recorded for the file: the one its claims cite.
  • import_run_id integer — The import's run: the id GET /v1/ops/imports/{id} takes.
  • inserted integer — Claims created or re-versioned.
  • confirmed integer — Claims the fetch restated unchanged.
  • expired integer — Claims, relations and signatures the source stopped saying.
  • skipped integer — Claims left out and noted on the run: an invalid subject, a word outside the vocabulary, a campaign member without a campaign role (victim, sweep, vault, cash_out), a victim with an abuse word.
  • rejected integer — Records left out whole because they are not text PostgreSQL stores (a NUL byte, an escaped surrogate outside a pair, bytes that are not UTF-8, or in XML a character reference to a surrogate), with, for a dossier source, every record of a dossier that holds one, and an ATT&CK relationship to an object rejected so, or because they hold a Bitcoin private key (a WIF key or an extended private key); named on the run by position and key, by position alone for a private key; included in record_count. Nothing of them is written and nothing they may have stated is withdrawn: their claims stay as they were, and while a fetch rejects a record no relation, signature, alias or identifier of the source is withdrawn.
  • record_count integer — Records the parser emitted from the file, distinct by record key, the rejected ones included: rows as parsed, not claims (see Source.last_fetch.record_count).
  • provisional integer — Campaign members that landed provisional: a source's first import into the campaign, a batch over the batch size, or a sweep, vault or cash-out named by one source. Included in inserted.
  • promoted integer — Members held back only for want of a second source that another source now names: current now.

202 · application/json

Import still running after the budget; poll the run.

FieldTypeWhat it carries
import_run_idintegerThe import's run: poll it at GET /v1/ops/imports/{id}.
source_idstringThe source being imported.
statusstringAlways running: the import goes on past the budget.
schema
  • import_run_id integer — The import's run: poll it at GET /v1/ops/imports/{id}.
  • source_id string — The source being imported.
  • status string — Always running: the import goes on past the budget. · one of "running"

Errors

StatusCodeWhen
400invalid_inputThe file carries a private key (invalid_input): a Nostr nsec1 anywhere, any private key in a dossier source's file (a WIF key or an extended private key such as xprv), or one a parser's refusal would quote; a record that cannot be read to its end counts as holding one. Nothing is imported, and the fetch is recorded as failed without it. Another source's record that holds a Bitcoin private key is left out alone, counted in rejected. A filename that holds a private key is refused before anything is recorded.
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.
403forbiddenAn agent may import only a source flagged agent_may_publish; a human may import any (forbidden).
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.
409source_inactiveSource inactive (source_inactive), or a link-out whose author has not granted reuse (link_out): nothing is fetched or recorded.
413too_largeBody over the size cap (too_large).
422parse_failedParser failure (parse_failed); the fetch is recorded as failed and no claim changes. The message is the parser's, at most 200 bytes cut on a character, or a sentence in its place when it quotes what is not text.
429quota_exceededAn import of this source is already running (quota_exceeded, Retry-After).

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/sources/ransomwhere/import \
  -H "Authorization: Bearer $BTCINTEL_KEY" | jq

This route needs a key. Set BTCINTEL_KEY in your environment first: the snippet reads it from there and holds no key. The description above names the tiers the route takes.