Propose value maps for picklists and lookups
const url = 'https://api.sloose.com/ai/value-map';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"fields":[{"module":"example","apiName":"example","mapType":"picklist","values":["example"],"counts":{"additionalProperty":1},"targets":[{"label":"example","value":"example"}]}],"columns":[],"sampleRows":[],"enabledModules":["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/value-map \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "fields": [ { "module": "example", "apiName": "example", "mapType": "picklist", "values": [ "example" ], "counts": { "additionalProperty": 1 }, "targets": [ { "label": "example", "value": "example" } ] } ], "columns": [], "sampleRows": [], "enabledModules": [ "example" ] }'Maps the values in a file onto the values a destination field accepts — the step the free matcher cannot do, because no amount of string distance gets from “Aus” to “Australia”.
Every option it names is checked against the field’s own before you see it: picklist options from the org’s schema, and lookup targets only from the records the caller sent, since the API has no CRM connection here. A name that two of those records share resolves to neither.
Certainty decides what happens next. An answer that is both confident and clearly ahead of its runner-up is applied; anything else comes back as candidates, best first, and nothing is written until a person picks one. A confident wrong answer is the expensive kind — it is the one nobody reads.
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
object
object
object
object
Responses
Section titled “Responses”Proposals. Applied and offered are separated, so a client never has to guess which is which.
Per field: the mappings confident enough to apply, and candidates for the rest.
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"}