Skip to content

The CRM’s API credits, as far as they are known

GET
/orgs/{org}/connectors/{id}/credits
curl --request GET \
--url https://api.sloose.com/orgs/org_9f3c/connectors/cnn_9f2a/credits \
--header 'Authorization: Bearer <token>'

What is known of a Zoho CRM’s daily API allowance, for the tenant (CRM organisation, data centre and host) this connection reaches — every Sloose organisation holding it shares the one pool, so a count read through any of them is returned. Zoho CRM connections only: a connection of any other kind is answered with nothing known — remaining, remainingAt, allowance and edition null, and allowanceAtLeast false — whatever is stored under its spelling. Asks the CRM nothing and spends no credit: it reads what earlier calls and the connect recorded. The run page compares its estimate with remaining and warns; a run that writes is refused only while spent is true (DESTINATION_ALLOWANCE_SPENT at its authorisation). POST …/credits/check asks the CRM first.

org
required

The organisation id the session was issued for. A token for one organisation can never read another.

string
Example
org_9f3c

The organisation id the session was issued for. A token for one organisation can never read another.

id
required

The connector id, from the list.

string
Example
cnn_9f2a

The connector id, from the list.

What is known.

Media typeapplication/json
object
credits
required
object
remaining
required

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.

number | null
remainingAt
required

When the CRM said so, any organisation’s call counted.

string | null
allowance
required

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.

number | null
allowanceAtLeast
required

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.

boolean
edition
required

The edition the licence was read as, where it was recognised.

string | null
spent
required

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.

boolean
spentAt
required

When Sloose first heard the allowance was spent, or null while it is not.

string | null
Examplegenerated
{
"credits": {
"remaining": 1,
"remainingAt": "example",
"allowance": 1,
"allowanceAtLeast": true,
"edition": "example",
"spent": true,
"spentAt": "example"
}
}

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).

Media typeapplication/json

The error envelope every non-2xx answer uses.

object
error
required

Human-readable explanation.

string
code

Machine-readable reason. Absent on a few legacy 400s.

string
key
additional properties
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.

Media typeapplication/json

The error envelope every non-2xx answer uses.

object
error
required

Human-readable explanation.

string
code

Machine-readable reason. Absent on a few legacy 400s.

string
key
additional properties
Examplegenerated
{
"error": "example",
"code": "example"
}

No such connector, or it is not visible to this session.

Media typeapplication/json

The error envelope every non-2xx answer uses.

object
error
required

Human-readable explanation.

string
code

Machine-readable reason. Absent on a few legacy 400s.

string
key
additional properties
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.

Media typeapplication/json
object
error
required
string
code
required
string
Allowed value: MAINTENANCE
Example
{
"code": "MAINTENANCE"
}
Retry-After
integer

Seconds until asking again is worth it (300 while the switch is on).

Report a problem with this page

sloose.com