Skip to content

GET   /ticket-rotations

Get all ticket rotations

Retrieve a paginated list of ticket 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 ticket rotations per page

search   query string

Search all ticket 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 ticket rotations by status. By default, only active rotations are shown.

ticketTypeId   query string

Filter ticket rotations by ticket type ID

name   query string

Filter ticket rotations by name

currentPosition   query integer

Filter ticket rotations by current position

Try it out

Loading...

Output:

Responses

Description

Successful response

{
"data": [
{
"id": 0,
"uniqueId": "string",
"accountId": "string",
"name": "string",
"ticketTypeId": "string",
"status": "string",
"userRotationArray": [
{
"userId": "string",
"email": "string",
"name": "string",
"weight": 0
}
],
"currentPosition": 0,
"createdAt": "string",
"updatedAt": "string",
"createdBy": "string",
"updatedBy": "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/UserRotationMember

type: object
description: A user in the rotation with their weight
properties:
userId:
type: string
description: Unique ID of the user
email:
type: string
description: Email of the user
name:
type: string
description: Display name of the user
weight:
type: integer
minimum: 1
maximum: 10
description: Weight for this user in the rotation (1-10). Higher weight means
they receive more tickets.
required:
- userId
- email
- name
- weight

#/components/schemas/TicketRotation

type: object
description: Ticket rotation object representing a weighted round-robin strategy
for distributing tickets among users
properties:
id:
type: integer
description: Internal database ID
uniqueId:
type: string
description: Unique identifier for the ticket rotation
accountId:
type: string
description: ID of the account that owns this ticket rotation
name:
type: string
description: Name of the ticket rotation
ticketTypeId:
type: string
description: ID of the ticket type associated with this rotation
status:
type: string
description: Status of the ticket rotation
enum:
- active
- inactive
userRotationArray:
type: array
items:
$ref: "#/components/schemas/UserRotationMember"
description: Array of users in the rotation with their assigned weights (1-10)
currentPosition:
type: integer
description: Current position in the weighted rotation array
createdAt:
type: string
format: date-time
description: When the ticket rotation was created
updatedAt:
type: string
format: date-time
description: When the ticket rotation was last updated
createdBy:
type: string
description: Email of the user who created the ticket rotation
updatedBy:
type: string
description: Email of the user who last updated the ticket rotation
required:
- id
- uniqueId
- accountId
- name
- status
- userRotationArray

#/components/schemas/TicketRotationList

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

Route Source Code

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

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