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. - 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
| Name | Where | Type | Required | What it does |
|---|---|---|---|---|
id | path | string | required | Registered source id. |
filename | query | string | optional | Recorded 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.
| Field | Type | What it carries |
|---|---|---|
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. |
schema ImportResult
fetch_idinteger — The fetch the import recorded for the file: the one its claims cite.import_run_idinteger — The import's run: the idGET /v1/ops/imports/{id}takes.insertedinteger — Claims created or re-versioned.confirmedinteger — Claims the fetch restated unchanged.expiredinteger — Claims, relations and signatures the source stopped saying.skippedinteger — 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.rejectedinteger — 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_countinteger — Records the parser emitted from the file, distinct by record key, the rejected ones included: rows as parsed, not claims (seeSource.last_fetch.record_count).provisionalinteger — 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.promotedinteger — 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.
| Field | Type | What it carries |
|---|---|---|
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. |
schema
import_run_idinteger — The import's run: poll it atGET /v1/ops/imports/{id}.source_idstring — The source being imported.statusstring — Alwaysrunning: the import goes on past the budget. · one of "running"
Errors
| Status | Code | When |
|---|---|---|
| 400 | invalid_input | The 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. |
| 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 | An agent may import only a source flagged agent_may_publish; a human may import any (forbidden). |
| 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 | source_inactive | Source inactive (source_inactive), or a link-out whose author has not granted reuse (link_out): nothing is fetched or recorded. |
| 413 | too_large | Body over the size cap (too_large). |
| 422 | parse_failed | Parser 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. |
| 429 | quota_exceeded | An 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" | jqThis 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.