Light AIDocs Beta Open Light AI

Partners

Connect links & grants

Create single-use connect links, handle the redirect, confirm unbound grants and manage grant states.

curl -X POST "https://api.light-ai.app/v1/partner/connect_links" \
  -H "Authorization: Bearer $LIGHT_AI_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "scopes": [
    "leads:read",
    "leads:write",
    "clients:read",
    "projects:read",
    "quotes:read",
    "quotes:write",
    "events:read"
  ],
  "client_label": "Frosty Lights LLC",
  "external_reference": "ghl-location-7Qx2",
  "redirect_uri": "https://app.partner.example/light-ai/connected"
}'
  • The url is returned only in this response (and on an Idempotency-Key replay). Never e-mail API keys; send connect links.
  • Bound link: pass organization (org_…) when you already know it. Unbound link: client_label is required and the grant waits for your confirmation.
  • expires_in_hours: 1–168 (default 7 days). Live partner keys only.
  • redirect_uri must be HTTPS on your verified domain. Light AI appends connect_link, grant, organization and grant_status (active or pending) and keeps your own query parameters.

Grant states#

StatusMeaning
pendingApproved through an unbound link; waiting for your confirm or decline.
activeData flows (while the contractor is on Pro).
suspendedTemporarily carrying no data (for example the contractor dropped below Pro).
supersededReplaced by a new grant after the contractor re-consented with new scopes (replaces_grant_id).
revokedThe contractor disconnected you.
expiredThe grant expired.

Confirm or decline#

curl -X POST "https://api.light-ai.app/v1/partner/grants/grant_…/confirm" \
  -H "Authorization: Bearer $LIGHT_AI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'

Decline a pending grant that reached the wrong organization with /decline. Revoke an unused link with POST /v1/partner/connect_links/{id}/revoke.

Your reference#

curl -X PATCH "https://api.light-ai.app/v1/partner/grants/grant_…" \
  -H "Authorization: Bearer $LIGHT_AI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "external_reference": "ghl-location-7Qx2",
  "metadata": {
    "plan": "agency-gold"
  }
}'

external_reference and metadata are echoed in every event of that organization.