Run discovery now
const url = 'https://api.sloose.com/orgs/org_9f3c/discovery/run';const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
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/orgs/org_9f3c/discovery/run \ --header 'Authorization: Bearer <token>'Reads every module and field from the CRM using the org’s stored connection, and writes a snapshot. Existing annotations are preserved; a field the CRM no longer returns is flagged as removed rather than deleted, so a project that mapped it still explains itself.
This route needs a connected org (POST /auth/orgs/{org}/connect), because it runs with no browser present. It is not the only way to discover: an administrator signing in gets an org discovered automatically with the token Zoho issues on the way through, and GET /auth/zoho/start?rediscover=1 re-reads the CRM the same way. Connecting is for working when nobody is there.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The org id the session was issued for. A token for one org can never read another.
Example
org_9f3cThe org id the session was issued for. A token for one org can never read another.
Responses
Section titled “Responses”The snapshot that was written, and how it differs from the one before it.
object
object
What changed against the previous run: modules and fields added, removed or altered.
Examplegenerated
{ "run": { "id": "example", "status": "example", "moduleCount": 1, "fieldCount": 1, "activeUserCount": 1, "errors": [ "example" ], "startedByUserId": "example", "createdAt": "example" }, "diff": "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"}The bearer’s role is too low, or it was issued for a different org.
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"}The org has no usable Zoho connection, so there is nothing to read from.
object
Examplegenerated
{ "error": "example", "code": "example"}The CRM could not be read. The message says why, bounded to 500 characters.
object
Example
{ "code": "DISCOVERY_FAILED"}