Propose a pattern for a selection
const url = 'https://api.facteur.eu/v1/inboxes/example/extractors/suggest';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"source":"example","selection":"example","offset":1}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.facteur.eu/v1/inboxes/example/extractors/suggest \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "source": "example", "selection": "example", "offset": 1 }'Backs the visual editor: given a message body and the part of it you selected, the ingestion engine proposes a pattern that captures it.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The inbox identifier — the same string that prefixes its receiving address.
Request Bodyrequired
Section titled “Request Bodyrequired”object
The message body to propose a pattern against.
The part of it you want captured.
Where the selection starts in the source, or -1 when unknown.
Examplegenerated
{ "source": "example", "selection": "example", "offset": 1}Responses
Section titled “Responses”What the engine proposes.
object
Examplegenerated
{}No usable credential. UNAUTHENTICATED when none was presented,
KEY_UNKNOWN, KEY_REVOKED or KEY_EXPIRED when a key was — kept
distinct on purpose, because “mint a new one” and “somebody took this
away from you” are different facts to whoever is reading a red pipeline.
Every failure has this shape. Branch on error.code; error.message is
written for a human and is in French today.
object
object
The stable, machine-readable reason.
A sentence for whoever is reading the failure. Not part of the contract.
Example
{ "error": { "code": "SCOPE_INSUFFICIENT" }}SCOPE_INSUFFICIENT (the message names the scope this request wanted and
the ones the key holds), KEY_CANNOT_REACH (no scope opens this route to
a key at all), FORBIDDEN, or one of the stated refusals listed under
x-api-key-refusals.
Every failure has this shape. Branch on error.code; error.message is
written for a human and is in French today.
object
object
The stable, machine-readable reason.
A sentence for whoever is reading the failure. Not part of the contract.
Example
{ "error": { "code": "SCOPE_INSUFFICIENT" }}INBOX_NOT_FOUND. An inbox in a workspace the key does not reach answers
the same way as one that does not exist — telling the two apart would let
anyone map a colleague’s workspaces one request at a time.
Every failure has this shape. Branch on error.code; error.message is
written for a human and is in French today.
object
object
The stable, machine-readable reason.
A sentence for whoever is reading the failure. Not part of the contract.
Example
{ "error": { "code": "SCOPE_INSUFFICIENT" }}ENGINE_UNAVAILABLE — the extraction engine did not answer.
Every failure has this shape. Branch on error.code; error.message is
written for a human and is in French today.
object
object
The stable, machine-readable reason.
A sentence for whoever is reading the failure. Not part of the contract.
Example
{ "error": { "code": "SCOPE_INSUFFICIENT" }}