Connect the org for server-side work
const url = 'https://api.sloose.com/auth/orgs/org_9f3c/connect';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"return":"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/auth/orgs/org_9f3c/connect \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "return": "example" }'Returns a URL that starts Zoho’s offline-scope grant. Signing in gives us an access token for one browser session; connecting gives us a refresh token so the server can read the CRM on its own — which is what discovery and, later, scheduled runs need.
Only an administrator can connect, and only with the same Zoho user they are signed in as. The refresh token is encrypted at rest and never leaves the server. The popup ends by posting { type: "sloose:connected", orgId } to the opener, or { type: "sloose:auth-error", message }.
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.
Query Parameters
Section titled “Query Parameters”Alternative to the body field.
Alternative to the body field.
Request Body
Section titled “Request Body”object
Where to post the outcome. Must be the widget origin. Also accepted as a ?return= query parameter.
Examplegenerated
{ "return": "example"}Responses
Section titled “Responses”Where to send the administrator.
object
Open this in a popup.
Examplegenerated
{ "url": "example"}The request body did not match the schema. issues carries the Zod issue list.
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 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 session’s data centre is unknown, or ZOHO_CLIENT_ID is not configured.
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"}