Propose a mapping for a file
const url = 'https://api.sloose.com/ai/auto-map';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"columns":["example"],"sampleRows":[],"enabledModules":["example"],"decided":{"additionalProperty":["example"]}}'};
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.sloose.com/ai/auto-map \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "columns": [ "example" ], "sampleRows": [], "enabledModules": [ "example" ], "decided": { "additionalProperty": [ "example" ] } }'Given the file’s columns and a few sample rows, proposes a destination field for each column, with a confidence and a reason, plus match rules for the modules involved.
Every proposal is validated against the org’s own fields before it is returned — the model cannot invent a field that does not exist, and a proposal that fails validation is downgraded or dropped rather than handed to you. This is a proposal, not a mutation: nothing is saved.
Fields the org has annotated as personal data are masked before any sample leaves the server, and an org whose AI sample policy is deny sends no rows at all.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
The source file’s column headings, in order.
Sample rows for context. At most 20 are used; the rest are ignored rather than refused. Fields annotated as personal data are masked before anything leaves the server, and an org whose AI sample policy is deny sends none at all.
One source row: column name → cell value, always as a string.
object
Restrict the proposal to these modules. Defaults to everything the org has enabled.
Fields already settled, as module key → field apiNames — chosen by a person, or wired by your own defaults. They are named in the prompt so the model spends its effort on what is genuinely open. Never send a mapping your own name matcher guessed: a guess that happened to run first would silence the better answer, which is the thing being paid for.
object
Responses
Section titled “Responses”The proposal. libraryProblems reports any helper library that would not load.
A validated mapping proposal, with what it cost.
object
This call’s id. It is also the ledger’s idempotency key.
Credits settled for this call.
Token counts, including cache reads and writes.
object
The model that answered.
Examplegenerated
{ "requestId": "example", "credits": 1, "usage": { "additionalProperty": "example" }, "model": "example"}The body did not match the schema (BAD_INPUT, with issues), or a named module or field does not exist.
object
Examplegenerated
{ "error": "example", "code": "example"}No bearer, or one that is expired, revoked or no longer resolves to a member.
The error envelope every non-2xx answer uses.
object
Human-readable explanation.
Machine-readable reason. Absent on a few legacy 400s.
Examplegenerated
{ "error": "example", "code": "example"}Not enough AI credits, or the org is suspended. balance shows what is left.
object
AI credits. Included credits reset each period; purchased ones do not.
object
Included + purchased − reserved
Examplegenerated
{ "error": "example", "code": "example", "balance": { "included": 1, "purchased": 1, "reserved": 1, "available": 1, "periodStart": "example", "periodEnd": "example" }}No such org.
object
Example
{ "code": "ORG_NOT_FOUND"}The org has no module registry yet — run discovery and enable some modules first.
object
Example
{ "code": "ORG_NOT_CONFIGURED"}The model declined. category says why.
object
Example
{ "code": "AI_REFUSED"}The model’s answer could not be used.
object
Example
{ "code": "AI_BAD_OUTPUT"}AI is not configured on this deployment. Unconfigured paths say so rather than failing.
object
Example
{ "code": "AI_NOT_CONFIGURED"}