Create Rooftop
Adds one or more rooftops (teams) to an existing dealer. The reseller is resolved from your token, so reseller_id is never sent in the request.
POST
AuthBearer token
Body parameters
- enterprise_id (string, required) — Dealer to add rooftops to.
- rooftops (array, required) — One or more rooftops to add (see Rooftop object).
Rooftop object
- teamName (string, required) — Rooftop name.
- productLines (array, required): the products to turn on for this rooftop, as a list of product names from the table below, for example
["Image", "360 Spin", "Sales Inbound"]. Names are not case-sensitive. - address (object, optional): the rooftop's address. Any of
address_line,city,state,country,pin_code, all strings. - email (string, optional) — Makes this email the rooftop admin (invited if new).
Product names
| Product name | Turns on |
|---|---|
Image | Studio images |
360 Spin | 360° spins |
Video | Videos |
Sales Inbound | Sales inbound agent |
Sales Outbound | Sales outbound agent |
Service Inbound | Service inbound agent |
Service Outbound | Service outbound agent |
Sample request
curl --request POST \
--url 'https://api.spyne.ai/api/pv1/enterprise/create-team' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"enterprise_id": "<enterprise_id>",
"rooftops": [
{
"teamName": "Second Rooftop",
"productLines": ["Image", "360 Spin", "Video", "Sales Inbound"],
"address": { "address_line": "1200 Main St", "city": "Austin", "state": "TX", "pin_code": "78701" }
}
]
}'Sample response
{
"message": "Rooftop added",
"error": false,
"data": {
"enterpriseId": "<enterprise_id>",
"teamId": "<team_id>",
"teams": [
{ "teamId": "<team_id>", "teamName": "Second Rooftop", "productLines": [] }
]
}
}Response parameters
| Parameter | Type | Description |
|---|---|---|
| message | string | Confirmation message. |
| error | boolean | false on success. |
| data.enterpriseId | string | The dealer the rooftops were added to. |
| data.teamId | string | The first created rooftop's id. |
| data.teams | array | Created rooftops, each with teamId, teamName and productLines. |
Errors
| Status code | Description |
|---|---|
| 400 | Invalid or missing parameters, or rooftops was empty. |
| 401 | Missing or invalid token. |
| 403 | The token's user lacks permission on the target reseller. |
| 404 | No dealer matches the given enterprise_id. |
| 500 | Unexpected server error. |
Updated 7 days ago
Did this page help you?
