π₯ 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:
- Auth0 organization is configured β Set up authentication in the dashboard. Your Auth0 organization must be created before you can provision users.
- Free access is disabled β The
freeAccesssetting must befalse. 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
| Field | Type | Required | Description |
|---|---|---|---|
action | string | No | "provision" (default) or "deprovision" |
email | string | Yes | The user's email address |
result_url | string | Yes (provision only) | URL the user is redirected to after setting their password |
What Happens
- A user account is created in your Auth0 organization
- A password reset email is sent to the user
- The user clicks the link, sets their password, and is redirected to your
result_url - 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
| Code | Cause |
|---|---|
| 400 | Missing email, missing result_url (for provision), freeAccess is enabled, or Auth0 organization not configured |
| 403 | Sandbox account or insufficient permissions |
| 404 | Pine whitelabel configuration not found for your account |
| 503 | Internal service not configured or upstream error |
Related
- π² provision user API reference
- Dashboard Configuration β Configure authentication and free access settings
Updated about 3 hours ago