Skip to main content

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_CUSTOMER or READ_WRITE_CUSTOMER

Query Parameters​

ParameterTypeDescription
pageIntegerPage number to retrieve. Default is 1.
limitIntegerNumber of sales reps per page. Default is 10.
emailStringFilter by email address (partial, case-insensitive match).
statusStringFilter by status: active, pending, invited or inactive.
id:inStringFilter by a comma-separated list of sales rep IDs.
companyStringSales reps who have access to this company ID.
company:inStringSales reps who have access to any of these comma-separated company IDs.
date_created:minStringSales reps created on or after this date (YYYY-MM-DD).
date_created:maxStringSales reps created on or before this date (YYYY-MM-DD).
date_modified:minStringSales reps updated on or after this date (YYYY-MM-DD).
date_modified:maxStringSales reps updated on or before this date (YYYY-MM-DD).
metafields:<code>StringSales reps whose metafield <code> equals this value.
metafields-in:<code>StringSales 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​

FieldTypeDescription
idStringUnique identifier of the sales rep.
firstNameStringFirst name of the sales rep.
lastNameStringLast name of the sales rep.
emailStringEmail address of the sales rep.
phoneNumberStringPhone number of the sales rep.
imageStringURL of the sales rep's profile image.
statusStringStatus: active, pending, invited or inactive.
verifiedEmailBooleanWhether the sales rep has verified their email address.
accessAllBooleanWhether the sales rep can access every active company and all its customers.
notesStringInternal notes about the sales rep.
metaFieldsArrayCustom field values. See Metafields.
createdByObjectWho created the sales rep: name and type (api or admin).
salesRepCompaniesArrayCompanies the sales rep can access. See below.
createdAtStringDate and time the sales rep was created (ISO 8601).
updatedAtStringDate and time the sales rep was last updated (ISO 8601).

Sales Rep Companies Data​

FieldTypeDescription
idStringUnique identifier of the company access entry.
companyStringID of the company.
customersArrayIDs of the customers the sales rep can work with in this company.
rolesArrayIDs of the customer roles the sales rep can work with in this company.
accessTypeStringType of access: customer, roles or all.

Pagination Details​

FieldTypeDescription
pageIntegerCurrent page number.
totalIntegerTotal number of sales reps that match the filters.
countIntegerNumber of sales reps returned on this page.

Notes​