Grant the live product
Add the Receptionist product (receptionWebChat) to a rooftop directly at stage Live, sub-stage OB Live. In the onboarding console this unlocks the Reception menu.
Products are named by their product registry name; the registry decides which product line each one belongs to. For each product line, Spyne creates the line or moves it to Live (a churned or inactive line is revived), creates or updates each product at Live, creates the product's onboarding tasks when the registry defines them, sets ARR to 0, and logs a stage change event (Contracted to Live). It then recalculates the rooftop, dealer group and organisation stages.
Auth: Bearer token of a signed-in user · Rate limit: not documented · Processing: synchronous; all writes, task creation and the stage rollup finish before the response
Before you call it
- You need the rooftop's
teamId. SendenterpriseIdtoo, as a guard: the call is rejected when it does not match the rooftop's dealer group. The route does not check that the caller belongs toteamId. - For the Receptionist,
productsis["receptionWebChat"]. - Call it after the phone number has been bought.
- Calling it twice is safe; the second call reports
alreadyLive: true. The call is not a no-op, though, so do not call it just to check status. - ARR is set to 0 because marketplace products are not part of a signed contract.
- Onboarding-task creation is best-effort. A failure is logged and reported as
onboardingTasksCreated: 0.
Request body
- Headers: set
Authorization: Bearer YOUR_TOKENandContent-Type: application/json. - Body: set
teamId,products: ["receptionWebChat"]andenterpriseId. - Send it and check for
200. - If it fails, do not repeat the phone number purchase. Retry only this call.
| Parameter | Type | Required | Description |
|---|---|---|---|
teamId | string | Required | Rooftop ID. |
products | string[] | Required | Non-empty array of product registry names. Receptionist: receptionWebChat. |
enterpriseId | string | Optional | Dealer group ID. If sent, it must match the rooftop's dealer group. |
updatedBy | string | Optional | Actor recorded on the stage events. Defaults to the caller, then to system. |
reason | string | Optional | Reason recorded on the stage events. Default: "Enabled as Live via agent marketplace". |
source | string | Optional | One of manual, automatic, system, api, webhook. Default api. |
Sample request
curl -X POST "https://api.spyne.ai/user-management/v1/team/add-live-products" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"teamId": "<teamId>",
"products": ["receptionWebChat"],
"enterpriseId": "<enterpriseId>"
}'import requests
res = requests.post(
"https://api.spyne.ai/user-management/v1/team/add-live-products",
headers={"Authorization": "Bearer YOUR_TOKEN"},
json={"teamId": "<teamId>", "products": ["receptionWebChat"], "enterpriseId": "<enterpriseId>"},
)
print(res.status_code, res.json())const res = await fetch(
'https://api.spyne.ai/user-management/v1/team/add-live-products',
{
method: 'POST',
headers: {
Authorization: 'Bearer YOUR_TOKEN',
'Content-Type': 'application/json',
},
body: JSON.stringify({
teamId: '<teamId>',
products: ['receptionWebChat'],
enterpriseId: '<enterpriseId>',
}),
}
);
console.log(res.status, await res.json());Sample response
{
"message": "Products added as Live successfully",
"error": false,
"code": "",
"details": null,
"data": {
"teamId": "<teamId>",
"enterpriseId": "<enterpriseId>",
"productLines": [
{
"productLineId": "<productLineId>",
"productLineRegistryId": "<productLineRegistryId>",
"productLineRegistryName": "<productLineRegistryName>",
"stage": "Live",
"subStage": "OB Live",
"created": false,
"alreadyLive": false,
"products": [
{
"productId": "<productId>",
"productRegistryId": "<productRegistryId>",
"productRegistryName": "receptionWebChat",
"stage": "Live",
"subStage": "OB Live",
"arr": 0,
"created": true,
"alreadyLive": false,
"onboardingTasksCreated": 0
}
]
}
],
"hierarchy": {
"team": { "changed": true, "previousStage": "<stage>", "previousSubStage": "<subStage>", "newStage": "Live", "newSubStage": "OB Live" },
"enterprise": { "changed": false },
"organisation": { "changed": false }
}
}
}{
"message": "Team \"<teamId>\" does not belong to enterprise \"<enterpriseId>\"",
"error": true,
"code": "",
"details": null,
"data": null
}{
"message": "Invalid Token",
"error": true,
"code": "ERROR_AUTH_401",
"details": "",
"data": null
}{
"message": "Team \"<teamId>\" not found",
"error": true,
"code": "",
"details": null,
"data": null
}{
"message": "<error message>",
"error": true,
"code": "",
"details": null,
"data": null
}Response parameters (200)
| Parameter | Type | Description |
|---|---|---|
message | string | "Products added as Live successfully". |
error | boolean | false on success. |
data.teamId | string | Rooftop ID. |
data.enterpriseId | string | The rooftop's dealer group, read from the rooftop record. |
data.productLines[] | array | One entry per product line touched. |
productLineId | string | Product line row ID. |
productLineRegistryId | string | Registry ID of the line. |
productLineRegistryName | string | Registry name of the line. |
stage / subStage | string | Always Live / OB Live. |
created | boolean | true if the line was created by this call. |
alreadyLive | boolean | true if the line was already at Live / OB Live. |
products[] | array | Products under that line. |
productId | string | Product row ID. |
productRegistryId | string | Registry ID. |
productRegistryName | string | Registry name, for example receptionWebChat. |
stage / subStage | string | Live / OB Live. |
arr | number | Always 0 for marketplace products. |
created | boolean | true if the product row was created. |
alreadyLive | boolean | true if it was already Live. |
onboardingTasksCreated | number | Onboarding tasks created for this product. 0 if none are configured or creation failed. |
data.hierarchy | object | One entry each for team, enterprise and organisation. Each is changed: false, or when changed also carries previousStage, previousSubStage, newStage and newSubStage. |
Errors
| Status | Code | When it happens |
|---|---|---|
400 | products must be a non-empty array | products is missing, not an array, or empty. |
400 | products must be an array of registry name strings | An entry is not a string. The message lists the invalid entries. |
400 | Products not found in the credit-service registry | A name is not in the product registry. |
400 | No valid products to enable | Nothing resolved to a product line. |
400 | Team does not belong to enterprise | enterpriseId was sent and does not match the rooftop. |
400 | Missing or invalid input | teamId missing, or source not one of the allowed values. The exact body for this case is not documented. |
401 | Invalid Token | Missing or rejected Bearer token. |
404 | Team not found | No rooftop with this teamId. |
500 | Internal server error | Unexpected error. The message is the error text. |
What happens next
Mark Assign Number done. Then re-read the Receptionist agent to confirm it has a phone number, which is what makes it live.
Updated about 1 hour ago
