Skip to content

GET   /lead-rotations

Get all lead rotations

Retrieve a paginated list of lead rotations with optional filtering

Authentication Required

Authorization: Bearer {token}   header string

This header is required to access this endpoint

Required Parameters

x-account-id   header string

Account ID for the request

Optional Parameters

Click here to view an exhaustive list of all available parameters
page   query integer

Page number

pageSize   query integer

Number of lead rotations per page

search   query string

Search all lead rotations for any text that matches the search query (not case sensitive)

sort   query string

Comma separated list of fields to sort by, prefix with - for descending order. (ie. sort=name,-createdAt)

status   query string

Filter lead rotations by status. By default, only active rotations are shown.

teamId   query integer

Filter lead rotations by team ID

name   query string

Filter lead rotations by name

Try it out

Loading...

Output:

Responses

Description

Successful response

{
"data": [
{
"id": 0,
"name": "string",
"accountId": "string",
"status": "string",
"teamId": 0,
"userRotationArray": [
"string"
],
"currentPosition": 0,
"createdAt": "string",
"updatedAt": "string",
"createdBy": "string",
"updatedBy": "string",
"team": {
"id": 0,
"account_id": "string",
"accountId": "string",
"name": "string",
"active": true,
"members": [
{
"userId": 0,
"email": "string",
"name": "string"
}
],
"createdBy": "string",
"updatedBy": "string",
"createdAt": "string",
"updatedAt": "string"
}
}
],
"totalCount": 0,
"totalPages": 0,
"currentPage": 0
}

References

#/components/parameters/xAccountIdHeader

in: header
name: x-account-id
schema:
type: string
description: Account ID for the request
required: true
example: "2311"

#/components/schemas/TeamMember

type: object
description: User who is a member of a team
properties:
userId:
type: integer
description: ID of the user
email:
type: string
description: Email of the user
name:
type: string
description: Name of the user
required:
- userId
- email

#/components/schemas/Team

type: object
description: Team information
properties:
id:
type: integer
description: Team ID
readOnly: true
account_id:
type: string
description: ID of the account that owns this team
accountId:
type: string
description: ID of the account that owns this team
name:
type: string
description: Team name
active:
type: boolean
default: true
description: Whether the team is active
members:
type: array
items:
$ref: "#/components/schemas/TeamMember"
description: Users who are members of this team
createdBy:
type: string
description: Email of the user who created the team
updatedBy:
type: string
description: Email of the user who last updated the team
createdAt:
type: string
format: date-time
description: When the team was created
readOnly: true
updatedAt:
type: string
format: date-time
description: When the team was last updated
readOnly: true
required:
- name

#/components/schemas/LeadRotation

type: object
description: Lead rotation object representing a strategy for distributing leads among users
properties:
id:
type: integer
description: Unique identifier for the lead rotation
name:
type: string
description: Name of the lead rotation
accountId:
type: string
description: ID of the account that owns this lead rotation
status:
type: string
description: Status of the lead rotation
enum:
- active
- archived
- queued
teamId:
type: integer
description: ID of the team associated with this lead rotation
userRotationArray:
type: array
items:
type: string
description: Array of user emails in the rotation order
currentPosition:
type: integer
description: Current position in the rotation array
createdAt:
type: string
format: date-time
description: When the lead rotation was created
updatedAt:
type: string
format: date-time
description: When the lead rotation was last updated
createdBy:
type: string
description: Email of the user who created the lead rotation
updatedBy:
type: string
description: Email of the user who last updated the lead rotation
team:
$ref: "#/components/schemas/Team"
required:
- id
- name
- accountId
- status
- userRotationArray

#/components/schemas/LeadRotationList

type: object
properties:
data:
type: array
items:
$ref: "#/components/schemas/LeadRotation"
totalCount:
type: integer
totalPages:
type: integer
currentPage:
type: integer

Route Source Code

Check out the source code for this route entrypoint here: /lead-rotations/route.ts

Or the swagger.yaml spec this documentation was generated from: /lead-rotations/swagger.yaml