POST
/
salesreps
Create a new Sales Rep
curl --request POST \
  --url https://commerce.driv.ly/api/salesreps \
  --header 'Content-Type: application/json' \
  --data '{
  "id": "srep_8f9v2j1kd92j",
  "emails": [
    "sales.rep@example.com",
    "contact@example.com"
  ],
  "lastName": "Smith",
  "firstName": "Alice",
  "templates": [
    "Welcome Template",
    "Follow-up Template"
  ],
  "creditBands": [
    "Prime",
    "Subprime"
  ],
  "primaryEmail": "sales.rep@example.com",
  "phoneNumbers": [
    "+1-555-0123",
    "+1-555-0456"
  ],
  "primaryPhoneNumber": "+1-555-0123",
  "isAcceptingNewLeads": true
}'
{
  "data": {
    "id": "srep_8f9v2j1kd92j",
    "emails": [
      "sales.rep@example.com",
      "contact@example.com"
    ],
    "lastName": "Smith",
    "firstName": "Alice",
    "templates": [
      "Welcome Template",
      "Follow-up Template"
    ],
    "creditBands": [
      "Prime",
      "Subprime"
    ],
    "primaryEmail": "sales.rep@example.com",
    "phoneNumbers": [
      "+1-555-0123",
      "+1-555-0456"
    ],
    "primaryPhoneNumber": "+1-555-0123",
    "isAcceptingNewLeads": true
  },
  "success": true
}

Query Parameters

depth
integer

The number of levels of related objects to include in the response

Body

application/json
lastName
string
required

Contact has Last Name

firstName
string
required

Contact has First Name

id
string

Contact is uniquely identified by id

agent

Contact is automated Agent

address

Contact has Address

primaryPhoneNumber
string

Contact has Primary Phone Number

primaryEmail
string<idn-email>

Contact has Primary Email

emails
string<idn-email>[]

Contact has Email

phoneNumbers
string[]

Contact has Phone Number

roles
string[]

Contact has Role

creditBands
(string | Credit Band · object)[]

Sales Rep accepts leads from Credit Band

templates
(string | Template · object)[]

Sales Rep uses Template

isAcceptingNewLeads
boolean

Sales Rep is accepting new leads

Response

Sales Rep Created

data
object
Examples:
{
"id": "srep_8f9v2j1kd92j",
"emails": [
"sales.rep@example.com",
"contact@example.com"
],
"lastName": "Smith",
"firstName": "Alice",
"templates": ["Welcome Template", "Follow-up Template"],
"creditBands": ["Prime", "Subprime"],
"primaryEmail": "sales.rep@example.com",
"phoneNumbers": ["+1-555-0123", "+1-555-0456"],
"primaryPhoneNumber": "+1-555-0123",
"isAcceptingNewLeads": true
}
success
boolean