πŸ‘₯ User Provisioning

Provision and deprovision users in your Pine AI whitelabel organization via API

User Provisioning

The provision user endpoint lets you programmatically add and remove users from your Pine AI whitelabel organization.

Prerequisites

Before provisioning users, ensure:

  1. Auth0 organization is configured β€” Set up authentication in the dashboard. Your Auth0 organization must be created before you can provision users.
  2. Free access is disabled β€” The freeAccess setting must be false. When free access is enabled, all users can access the chat without provisioning, and the provisioning endpoint is disabled.

Provisioning a User

Send a POST request to create a new user in your Auth0 organization. The user will receive a password reset email and be redirected to your result_url after setting their password.

cURL

curl -X POST https://api.sharpsports.io/v1/pine/partner/provision-user \
  -H "Authorization: Token YOUR_PRIVATE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "action": "provision",
    "email": "[email protected]",
    "result_url": "https://chat.yoursite.com"
  }'

Python

import requests

response = requests.post(
    "https://api.sharpsports.io/v1/pine/partner/provision-user",
    headers={
        "Authorization": "Token YOUR_PRIVATE_API_KEY",
        "Content-Type": "application/json"
    },
    json={
        "action": "provision",
        "email": "[email protected]",
        "result_url": "https://chat.yoursite.com"
    }
)

print(response.json())

Parameters

FieldTypeRequiredDescription
actionstringNo"provision" (default) or "deprovision"
emailstringYesThe user's email address
result_urlstringYes (provision only)URL the user is redirected to after setting their password

What Happens

  1. A user account is created in your Auth0 organization
  2. A password reset email is sent to the user
  3. The user clicks the link, sets their password, and is redirected to your result_url
  4. The user can now log in to your whitelabel chat application

Deprovisioning a User

Remove a user from your organization. This revokes their access to your whitelabel chat.

cURL

curl -X POST https://api.sharpsports.io/v1/pine/partner/provision-user \
  -H "Authorization: Token YOUR_PRIVATE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "action": "deprovision",
    "email": "[email protected]"
  }'

Python

import requests

response = requests.post(
    "https://api.sharpsports.io/v1/pine/partner/provision-user",
    headers={
        "Authorization": "Token YOUR_PRIVATE_API_KEY",
        "Content-Type": "application/json"
    },
    json={
        "action": "deprovision",
        "email": "[email protected]"
    }
)

print(response.json())

Error Codes

CodeCause
400Missing email, missing result_url (for provision), freeAccess is enabled, or Auth0 organization not configured
403Sandbox account or insufficient permissions
404Pine whitelabel configuration not found for your account
503Internal service not configured or upstream error

Related