v1

latestOpenAPI 3.0.12026-07-22120163333.7 KB
Agent User

Create a new agent

Creates a new agent under the caller's team using the supplied profile.

Notes:

  • accountInfo.phoneNumber and accountInfo.emailAddress are required.
  • When phoneCode is omitted, '1' (US) is used by default.
  • When roleName is supplied, it is resolved to the team's matching role; unknown names are ignored and the agent is created without a role binding.
  • Long text fields (address, licenseId, position, personalWebsite, personalIntroduction, social-media item values) are silently truncated to their individual limits.
  • The response envelope carries errorCode = 0 on success; non-zero values indicate validation failure or upstream error, with errorMsg describing the cause.
post/v1.0/agent/profile/add

Headers

Authorizationstring required

Bearer [access_token]

Content-Typestring required

application/json

Request body

accountTypeinteger required

The account type of the agent

hasBackOfficeboolean
agentPidstring
fullSyncboolean
shouldSyncboolean
checkRosterNumboolean

Example request

{
  "accountInfo": {
    "headUrl": "http://xxx",
    "lastName": "Bob",
    "firstName": "Bob",
    "emailAddress": "aaaa@google.com",
    "phoneNumber": "83834748",
    "phoneCode": "000001",
    "phoneCountry": "000001",
    "tagIds": [
      12345,
      67890
    ],
    "roleName": "role of the agent",
    "seatTypeName": "Full Time Agent"
  },
  "workInfo": {
    "streetAddress": "123 Main St",
    "city": "New York",
    "country": "US",
    "state": "NY",
    "zipcode": "10001",
    "licenseId": "xxx",
    "companyName": "xxx",
    "companyAddress": "xxx",
    "position": "xxx",
    "personalWebsite": "xxx",
    "personalIntroduction": "xxx"
  }
}

Response

Envelope with the new agent's user ID, or a non-zero errorCode on failure.

datainteger

User ID of the newly created agent. Zero when creation fails or an existing agent is returned without a new ID.

errorCodeinteger

Business error code. 0 indicates success.

errorMsgstring

Human-readable error message when errorCode != 0.

Example response

{
  "data": 100234
}