Create the onboarding checklist
Create the onboarding checklist tasks for one contracted product line from its product line's task template. In normal use you do not call this directly: Update handover sub-stage calls it automatically, with the user's token, when a product line's sub-stage is set to "Meet Done" and the product line moves to Onboarding.
The call takes a lock on the product line so that two requests do not create the same tasks. It then reads the product line (dealer group, rooftop, registry, test account flag) and the products that are in Contracted or Onboarding, and fetches the task template with Get the onboarding task template. From the template it builds:
- every common task group and task, and
- the tasks of each product segment the product line has, for example a segment for
salesInboundonly when that product is contracted.
Tasks that already exist (same task group, task and segment) are skipped, so the call is safe to repeat. Some shared rooftop-level tasks start as COMPLETED when the same task is already done on another product line of the same rooftop: rooftop setup, department details and holidays, employee directory, user setup, CNAM registration, CRM integration, IMS integration, vehicle history integration and service scheduler. All other new tasks start as PENDING.
Send the bearer token of a signed-in Spyne Console user in Authorization: Bearer YOUR_TOKEN. The token is checked against the user validation endpoint, and it is forwarded to the task template call.
Before you call it
- The product line must exist, and its product line registry must have a task template. Otherwise the call returns
400. product_line_idis the product line ID, the same value asproduct_line_details_idin Save handover details.- The rate limit is not documented. A per-product-line lock (15 seconds, up to 5 retries 300 ms apart) blocks concurrent calls for the same product line.
- The call is synchronous. Tasks are created before the response.
Request
- Authenticate: send the
Authorization: Bearer YOUR_TOKENandContent-Type: application/jsonheaders. - Name the product line: send
product_line_id. - Check the count: check
totalCount. A value of0means every task already existed.
Headers
| Parameter | Type | Required | Description |
|---|---|---|---|
Authorization | string | Required | Bearer YOUR_TOKEN |
Content-Type | string | Required | application/json |
Body
| Parameter | Type | Required | Description |
|---|---|---|---|
product_line_id | string | Required | Product line ID. |
Sample request
curl -X POST "https://api.spyne.ai/console/v1/onboarding/task/create-onboarding-task-v2" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "product_line_id": "PRODUCT_LINE_ID" }'import requests
res = requests.post(
"https://api.spyne.ai/console/v1/onboarding/task/create-onboarding-task-v2",
json={"product_line_id": "PRODUCT_LINE_ID"},
headers={"Authorization": "Bearer YOUR_TOKEN"},
)
print(res.status_code, res.json())const res = await fetch("https://api.spyne.ai/console/v1/onboarding/task/create-onboarding-task-v2", {
method: "POST",
headers: { Authorization: "Bearer YOUR_TOKEN", "Content-Type": "application/json" },
body: JSON.stringify({ product_line_id: "PRODUCT_LINE_ID" }),
});
console.log(res.status, await res.json());Sample response
{
"message": "Successfully created 12 onboarding tasks",
"totalCount": 12,
"data": {
"enterpriseId": "ENTERPRISE_ID",
"teamId": "TEAM_ID",
"productLineId": "PRODUCT_LINE_ID",
"productLineRegistryId": "PRODUCT_LINE_REGISTRY_ID"
}
}{
"message": "No new onboarding tasks to create",
"totalCount": 0,
"data": {
"enterpriseId": "ENTERPRISE_ID",
"teamId": "TEAM_ID",
"productLineId": "PRODUCT_LINE_ID",
"productLineRegistryId": "PRODUCT_LINE_REGISTRY_ID"
}
}{ "error": "Another request is already creating onboarding tasks for this product line. Please retry." }{ "message": "Invalid Token", "error": true, "code": "ERROR_AUTH_401", "details": null, "data": null }Response parameters
| Parameter | Type | Description |
|---|---|---|
message | string | Result message. |
totalCount | number | Number of tasks created by this call. |
data.enterpriseId | string | Dealer group ID. |
data.teamId | string | Rooftop ID. |
data.productLineId | string | Product line ID. |
data.productLineRegistryId | string | Product line registry ID. |
error | string | Present on 400. It holds the error message. |
Errors
| Status | Message | When it happens |
|---|---|---|
400 | (framework) | product_line_id is missing. The body is not documented in code. |
400 | Another request is already creating onboarding tasks for this product line. Please retry. | Another call for the same product line holds the lock. |
400 | Underlying error message | Every other failure also returns 400 with an error message. Examples: the product line does not exist, the template call fails, or the template is empty. |
401 | Invalid or missing token | No Bearer token, or the token failed validation. |
408 | Request timed out | The token validation call could not connect. |
What happens next
The checklist now exists for the product line in Onboarding. The next sections cover rooftop setup, integrations and agent configuration. Those steps mark these tasks done. Start with Checklist.
Called before: Update handover sub-stage, which calls it automatically on "Meet Done". Called after: none in this section. It depends on Get the onboarding task template.
Updated about 1 hour ago
