Get All Sales Reps
Retrieves a list of sales reps with pagination. Each sales rep includes the companies, customers and roles they can access.
HTTP Request
- URL:
/salesRep - Method:
GET - Headers:
accessToken: Required. Your API access token.
- Required scope:
READ_CUSTOMERorREAD_WRITE_CUSTOMER
Query Parameters
| Parameter | Type | Description |
|---|---|---|
page | Integer | Page number to retrieve. Default is 1. |
limit | Integer | Number of sales reps per page. Default is 10. |
email | String | Filter by email address (partial, case-insensitive match). |
status | String | Filter by status: active, pending, invited or inactive. |
id:in | String | Filter by a comma-separated list of sales rep IDs. |
company | String | Sales reps who have access to this company ID. |
company:in | String | Sales reps who have access to any of these comma-separated company IDs. |
date_created:min | String | Sales reps created on or after this date (YYYY-MM-DD). |
date_created:max | String | Sales reps created on or before this date (YYYY-MM-DD). |
date_modified:min | String | Sales reps updated on or after this date (YYYY-MM-DD). |
date_modified:max | String | Sales reps updated on or before this date (YYYY-MM-DD). |
metafields:<code> | String | Sales reps whose metafield <code> equals this value. |
metafields-in:<code> | String | Sales reps whose metafield <code> matches any of these comma-separated values. |
cURL Example
curl --location '<BASE_URL>/salesRep?page=1&limit=10&status=active&company=665434c100e82884676936b9' \
--header 'accessToken: <ACCESS_TOKEN>'
Response
- 200 OK: The list of sales reps was returned successfully.
- 400 Bad Request: The access token is missing or invalid, the token does not have the required scope, or a filter value is not valid.
Sample JSON Response
{
"success": true,
"data": [
{
"id": "66b1c2d3e4f5a6b7c8d9e0f1",
"firstName": "James",
"lastName": "Carter",
"email": "james.carter@aximcommerce.com",
"phoneNumber": "2125550188",
"status": "active",
"verifiedEmail": true,
"accessAll": false,
"notes": "Northeast territory",
"metaFields": [],
"createdBy": {
"name": "ERP Connector api",
"type": "api"
},
"salesRepCompanies": [
{
"id": "66b1c2d3e4f5a6b7c8d9e0f2",
"company": "665434c100e82884676936b9",
"customers": ["66a5023524b16685e42a1eda"],
"roles": [],
"accessType": "customer"
}
],
"createdAt": "2024-08-06T09:12:51.204Z",
"updatedAt": "2024-09-18T15:40:02.731Z"
}
],
"pagination": {
"page": 1,
"total": 14,
"count": 10
}
}
Response Details
Sales Rep Data
| Field | Type | Description |
|---|---|---|
id | String | Unique identifier of the sales rep. |
firstName | String | First name of the sales rep. |
lastName | String | Last name of the sales rep. |
email | String | Email address of the sales rep. |
phoneNumber | String | Phone number of the sales rep. |
image | String | URL of the sales rep's profile image. |
status | String | Status: active, pending, invited or inactive. |
verifiedEmail | Boolean | Whether the sales rep has verified their email address. |
accessAll | Boolean | Whether the sales rep can access every active company and all its customers. |
notes | String | Internal notes about the sales rep. |
metaFields | Array | Custom field values. See Metafields. |
createdBy | Object | Who created the sales rep: name and type (api or admin). |
salesRepCompanies | Array | Companies the sales rep can access. See below. |
createdAt | String | Date and time the sales rep was created (ISO 8601). |
updatedAt | String | Date and time the sales rep was last updated (ISO 8601). |
Sales Rep Companies Data
| Field | Type | Description |
|---|---|---|
id | String | Unique identifier of the company access entry. |
company | String | ID of the company. |
customers | Array | IDs of the customers the sales rep can work with in this company. |
roles | Array | IDs of the customer roles the sales rep can work with in this company. |
accessType | String | Type of access: customer, roles or all. |
Pagination Details
| Field | Type | Description |
|---|---|---|
page | Integer | Current page number. |
total | Integer | Total number of sales reps that match the filters. |
count | Integer | Number of sales reps returned on this page. |
Notes
- To page through a single sales rep's company access, use Get All Sales Rep Company Access.