Ask the CRM about its API credits, then say what is known
const url = 'https://api.sloose.com/orgs/org_9f3c/connectors/cnn_9f2a/credits/check';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/connectors/cnn_9f2a/credits/check \ --header 'Authorization: Bearer <token>'What GET …/credits answers, after asking the CRM once where it may be asked — for a page’s “Check again”, since the read alone can only repeat a count no call has refreshed. Zoho CRM connections only; a connection of any other kind, or one that cannot call (disconnected, or holding no working grant), is answered with what is known and nothing is asked.
The one call is the CRM’s organisation record (GET /org), sent with the connection’s own grant through the gate every call to that CRM passes. It names no module and reads one record; Zoho’s published table charges it one API credit, and Zoho’s own dashboard counts a call it refuses as well. What the answer says of the licence is kept, so an edition changed since the last read shows in allowance and edition too.
It is not sent every time:
- while the CRM’s day is known spent (
spent), Sloose lets one call a minute through to that CRM, whoever makes it — a call somebody made, never a read Sloose makes for its own upkeep; a check inside that minute sends nothing. The call that goes is the one that can clearspent: Zoho doing it as asked does, and a refusal or a failure does not; - otherwise at most once in 30 seconds a connection; a check sooner sends nothing.
Whether one was sent is asked, and whether the CRM answered it answered (#2140): as asked, or with the refusal that says its day is spent. A call that went and met nothing it could read — a timeout, a failure, a grant the CRM no longer honours — is sent and not answered, and credits then says only what was known before. Where nothing was sent, notAsked says why. The answer is 200 either way, and the connection’s own page says what state it is in. Zoho names no time at which credits return, and nothing here does.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The organisation id the session was issued for. A token for one organisation can never read another.
Example
org_9f3cThe organisation id the session was issued for. A token for one organisation can never read another.
The connector id, from the list.
Example
cnn_9f2aThe connector id, from the list.
Responses
Section titled “Responses”What is known, after the CRM was asked where it could be.
object
object
The credits the CRM last said were left (X-API-CREDITS-REMAINING), or null: Zoho sends it on any call once half the day is spent and not before, and a count more than a day old is none.
When the CRM said so, any organisation’s call counted.
The CRM’s day, from its licence by Zoho’s published table — or null where its edition or licence count is not known. Add-on credits and other apps’ use of the pool cannot be seen.
Whether allowance is a floor: the figure Zoho publishes for the edition, which its own dashboard has shown a CRM to exceed (the Free edition). False for a figure the table gives outright, and where there is none.
The edition the licence was read as, where it was recognised.
Whether the CRM’s API allowance is known to be spent now: Zoho refused a call because the last 24 hours’ credits are used up, and no call has been answered since. While it is, Sloose refuses this CRM’s calls before sending them, letting one a minute through to ask again; the first of those Zoho does as asked makes this false, and one that fails or is refused does not. Zoho names no time at which credits return.
When Sloose first heard the allowance was spent, or null while it is not.
Whether a call was sent to the CRM for this check. False inside the minute a known spent day allows one call in, inside the 30 seconds between checks, and for a connection that cannot be asked.
Whether the CRM answered the call it was sent: as asked, or refusing it because its day is spent. False where nothing was sent, and where the call failed, timed out or was refused for its grant — the CRM said nothing of its credits then.
Why nothing was sent, or null where a call was: cannot, the connection cannot be asked at all (another kind, disconnected, or holding no working grant), so no later check will ask either until it is reconnected; too_soon, inside the minute a spent day allows one call in, or the 30 seconds between checks.
Example
{ "notAsked": "cannot"}No bearer, or one that no longer resolves: a session that is unknown or expired (code: AUTH_REQUIRED), or an API token that was revoked or expired (TOKEN_REVOKED, TOKEN_EXPIRED), whose organisation is gone (ORG_NOT_FOUND) or whose member or user row is (MEMBERSHIP_GONE).
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 (code: ROLE_REQUIRED), or it was issued for a different organisation; the organisation has been closed (code: ORG_CLOSED, either kind of bearer); the person is banned (code: BANNED, a session); or it is a session that is signed in but in no organisation (code: NO_ORG): one that never joined one, or whose person was taken out of the one it was in, or left it. Signing in again changes nothing for NO_ORG; choosing or making an organisation does.
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"}No such connector, or it is not visible to this session.
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 restore switch is on (code: MAINTENANCE): every route but /health and /robots.txt is refused before anything is read, except the operator’s own POST /staff/people/{id}/delete with the ADMIN_TOKEN. Sloose is down for maintenance. Please try again in a few minutes.
object
Example
{ "code": "MAINTENANCE"}Headers
Section titled “Headers”Seconds until asking again is worth it (300 while the switch is on).