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.

POSThttps://api.spyne.ai/user-management/v1/team/add-live-products
AuthBearer token (console user)Rate limitNot documentedProcessingSynchronous; writes, task creation and stage rollup finish before the response

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. Send enterpriseId too, 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 to teamId.
  • For the Receptionist, products is ["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

Requiredalways sendOptionalcan be left out
Request checklist
  1. Headers: set Authorization: Bearer YOUR_TOKEN and Content-Type: application/json.
  2. Body: set teamId, products: ["receptionWebChat"] and enterpriseId.
  3. Send it and check for 200.
  4. If it fails, do not repeat the phone number purchase. Retry only this call.
ParameterTypeRequiredDescription
teamIdstringRequiredRooftop ID.
productsstring[]RequiredNon-empty array of product registry names. Receptionist: receptionWebChat.
enterpriseIdstringOptionalDealer group ID. If sent, it must match the rooftop's dealer group.
updatedBystringOptionalActor recorded on the stage events. Defaults to the caller, then to system.
reasonstringOptionalReason recorded on the stage events. Default: "Enabled as Live via agent marketplace".
sourcestringOptionalOne 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)

ParameterTypeDescription
messagestring"Products added as Live successfully".
errorbooleanfalse on success.
data.teamIdstringRooftop ID.
data.enterpriseIdstringThe rooftop's dealer group, read from the rooftop record.
data.productLines[]arrayOne entry per product line touched.
productLineIdstringProduct line row ID.
productLineRegistryIdstringRegistry ID of the line.
productLineRegistryNamestringRegistry name of the line.
stage / subStagestringAlways Live / OB Live.
createdbooleantrue if the line was created by this call.
alreadyLivebooleantrue if the line was already at Live / OB Live.
products[]arrayProducts under that line.
productIdstringProduct row ID.
productRegistryIdstringRegistry ID.
productRegistryNamestringRegistry name, for example receptionWebChat.
stage / subStagestringLive / OB Live.
arrnumberAlways 0 for marketplace products.
createdbooleantrue if the product row was created.
alreadyLivebooleantrue if it was already Live.
onboardingTasksCreatednumberOnboarding tasks created for this product. 0 if none are configured or creation failed.
data.hierarchyobjectOne entry each for team, enterprise and organisation. Each is changed: false, or when changed also carries previousStage, previousSubStage, newStage and newSubStage.

Errors

StatusCodeWhen it happens
400products must be a non-empty arrayproducts is missing, not an array, or empty.
400products must be an array of registry name stringsAn entry is not a string. The message lists the invalid entries.
400Products not found in the credit-service registryA name is not in the product registry.
400No valid products to enableNothing resolved to a product line.
400Team does not belong to enterpriseenterpriseId was sent and does not match the rooftop.
400Missing or invalid inputteamId missing, or source not one of the allowed values. The exact body for this case is not documented.
401Invalid TokenMissing or rejected Bearer token.
404Team not foundNo rooftop with this teamId.
500Internal server errorUnexpected 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.


Did this page help you?