Skip to content

GET   /lead-sources

Get all lead sources

Retrieve a paginated list of lead sources 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 sources per page

search   query string

Search all lead sources 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)

active   query boolean

Filter lead sources by active status. By default, all lead sources are shown.

name   query string

Filter lead sources by name

Try it out

Loading...

Output:

Responses

Description

Successful response

{
"data": [
{
"id": 0,
"name": "string",
"accountId": "string",
"active": true,
"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/LeadSource

type: object
description: Lead source object representing a channel through which leads are acquired
properties:
id:
type: integer
description: Unique identifier for the lead source
name:
type: string
description: Name of the lead source
accountId:
type: string
description: ID of the account that owns this lead source
active:
type: boolean
default: true
description: Whether the lead source is active
createdBy:
type: string
description: Email of the user who created the lead source
updatedBy:
type: string
description: Email of the user who last updated the lead source
createdAt:
type: string
format: date-time
description: When the lead source was created
updatedAt:
type: string
format: date-time
description: When the lead source was last updated
required:
- id
- name
- accountId

#/components/schemas/LeadSourceList

type: object
description: Paginated list of lead sources
properties:
data:
type: array
items:
$ref: "#/components/schemas/LeadSource"
description: Array of lead sources
totalCount:
type: integer
description: Total number of lead sources matching the query
totalPages:
type: integer
description: Total number of pages
currentPage:
type: integer
description: Current page number

Route Source Code

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

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