Get contracting data

Get the active contracts for a rooftop, with the product lines and products on each one.

GEThttps://api.spyne.ai/credit/v6/get-team-contracting-data
AuthBearer token (console user)Rate limitNot documentedProcessingSynchronous.

The API reads the rooftop's product line plans in the Contracted or Contract-Live stage, groups them by contract, and returns each contract with its product lines and product names. It also returns the dealer group's name. Nothing is written.

Before you call it

  • Send Authorization: Bearer YOUR_TOKEN. The token is the signed-in console user's session token. It is checked against the user service on every call.
  • You need the rooftop's teamId and its dealer group's enterpriseId. Both come from the signed-in user's selected rooftop.
  • A contract must exist for the rooftop. It is created in the contracting stage. If no plan is in Contracted or Contract-Live, contracts is an empty array.
  • The call is synchronous. Rate limit: not documented.

Query parameters

Requiredalways send
Request checklist
  1. Authenticate: send Authorization: Bearer YOUR_TOKEN.
  2. Identify the rooftop: pass enterpriseId and teamId as query parameters.
  3. Find the Vini line: pick the contract whose productLines[].productLineDisplayName is the Vini line, for example "Conversational AI", and take its productLineId.
ParameterTypeRequiredDescription
enterpriseIdstringRequiredDealer group ID.
teamIdstringRequiredRooftop ID.

Sample request

curl -X GET "https://api.spyne.ai/credit/v6/get-team-contracting-data?enterpriseId=<enterpriseId>&teamId=<teamId>" \
  -H "Authorization: Bearer YOUR_TOKEN"
import requests

resp = requests.get(
    "https://api.spyne.ai/credit/v6/get-team-contracting-data",
    params={"enterpriseId": "<enterpriseId>", "teamId": "<teamId>"},
    headers={"Authorization": "Bearer YOUR_TOKEN"},
)
print(resp.status_code, resp.json())
const params = new URLSearchParams({ enterpriseId: "<enterpriseId>", teamId: "<teamId>" });
const res = await fetch(`https://api.spyne.ai/credit/v6/get-team-contracting-data?${params}`, {
  headers: { Authorization: "Bearer YOUR_TOKEN" },
});
const body = await res.json();

Sample response

{
  "message": "",
  "error": false,
  "code": "",
  "details": null,
  "data": {
    "contracts": [
      {
        "contractId": "<contractId>",
        "productLines": [
          {
            "productLineId": "<productLineId>",
            "productLineDisplayName": "Conversational AI",
            "productNames": ["inboundSales", "outboundService"],
            "displayProductNames": ["Sales Inbound", "Service Outbound"],
            "plan": null
          }
        ],
        "contractStage": "Contracted",
        "contractUrl": "",
        "arr": "<amount>",
        "contractedDate": "2026-01-15T00:00:00.000Z",
        "summary": "This is a summary of the contract"
      }
    ],
    "enterpriseName": "<enterpriseName>",
    "enterpriseId": "<enterpriseId>"
  }
}
{
  "message": "Invalid Token",
  "error": true,
  "code": "ERROR_AUTH_401",
  "details": "",
  "data": null
}
{
  "message": "<connection error message>",
  "error": true,
  "code": "ERROR_REQ_TIMEOUT_408",
  "details": "",
  "data": null
}
{
  "message": "General API error. Please try again later.",
  "error": true,
  "code": "ERROR_SERVER_500",
  "details": ""
}

Response parameters (200)

ParameterTypeDescription
data.contractsarrayOne entry per contract with a plan in Contracted or Contract-Live for this rooftop. Empty when there is none.
data.contracts[].contractIdstringContract ID.
data.contracts[].productLinesarrayProduct lines on this contract for the rooftop.
data.contracts[].productLines[].productLineIdstringThe rooftop's product line ID.
data.contracts[].productLines[].productLineDisplayNamestringProduct line display name, or its registry name when there is no display name.
data.contracts[].productLines[].productNamesstring[]Product names on the plan, for example inboundSales.
data.contracts[].productLines[].displayProductNamesstring[]Display names of the same products.
data.contracts[].productLines[].planstring or nullPlan label. Always null for the Conversational AI line.
data.contracts[].contractStagestringContract stage, or "".
data.contracts[].contractUrlstringContract document URL, or "".
data.contracts[].arrnumberContract value field. Confidential, not shown here.
data.contracts[].contractedDatestring or nullDate the contract was signed.
data.contracts[].summarystringAlways the fixed text "This is a summary of the contract".
data.enterpriseNamestring or nullDealer group name.
data.enterpriseIdstring or nullEcho of the dealer group ID.

Errors

StatusCodeWhen it happens
400Missing parameterenterpriseId or teamId is missing. The framework rejects the request and sets the body, not this API.
401ERROR_AUTH_401No Authorization header, it does not start with Bearer, or the token is not valid.
408ERROR_REQ_TIMEOUT_408The token check could not reach the user service.
500ERROR_SERVER_500Any failure while reading contracts or the dealer group name.

What happens next

Use the Conversational AI product line's productLineId and productNames to confirm what the rooftop contracted. Then call Get contract product lines.

This call comes after the contracting endpoints in the Contracting section.


Did this page help you?