Free setup on annual plans

Sign up today!

Representatives

API Reference: Representatives endpoints

Representatives are the users of a customer: the people who handle tickets and configure AnswerPal. These endpoints manage their accounts, roles, active state, passwords and e-mail signatures, always within the customer of the token.

Endpoints

Accounts

  • GET /api/CustomerReps
    Access: Bearer JWT (Administrator)
    List the representatives that are not deleted, sorted by name. Query: pageNumber (default 1) and pageSize (default 10). Returns items, totalCount and totalPages.
  • GET /api/CustomerReps/assignable
    Access: Bearer JWT (Supervisor or Administrator)
    List the active representatives that tickets can be assigned to, as customerRepID and name.
  • GET /api/CustomerReps/me
    Access: Bearer JWT
    Return the signed-in representative.
  • GET /api/CustomerReps/{id}
    Access: Bearer JWT (Administrator)
    Return one representative.
  • POST /api/CustomerReps
    Access: Public (no bearer token)
    Create a representative. With a token: Administrator only. Without a token: only to create the first representative of a new customer account (see below). Answers 201 Created with the representative.
  • PUT /api/CustomerReps/{id}
    Access: Bearer JWT
    Update a representative. An Administrator can update anyone; other users only themselves, and they cannot change their own role. Answers 204 No Content.
  • DELETE /api/CustomerReps/{id}
    Access: Bearer JWT (Administrator)
    Delete a representative: the account is deactivated, marked as deleted and removed from appointment pools and topic links. Answers 204 No Content.

Active state and password

  • POST /api/CustomerReps/{id}/activate
    Access: Bearer JWT (Administrator)
    Activate a representative, also one that was deleted. Refused with 409 when the plan’s user limit is reached or the username is now taken. Answers 204 No Content.
  • POST /api/CustomerReps/{id}/deactivate
    Access: Bearer JWT (Administrator)
    Deactivate a representative; the account can no longer sign in. Answers 204 No Content.
  • PUT /api/CustomerReps/{id}/change-password
    Access: Bearer JWT
    Change a password with customerRepID, currentPassword and newPassword. Users change their own password; an Administrator can call it for anyone but still needs that representative’s current password. Answers 204 No Content, or 401 when the current password is wrong.

E-mail signatures

  • GET /api/CustomerReps/{id}/signatures
    Access: Bearer JWT
    List the signatures of a representative, one per language.
  • POST /api/CustomerReps/{id}/signatures
    Access: Bearer JWT
    Create or replace the signature for one language. Body: lang (required), emailSignatureHTML, emailSignatureText.
  • GET /api/CustomerReps/{id}/signatures/{lang}
    Access: Bearer JWT
    Return the signature for one language, or 404.
  • DELETE /api/CustomerReps/{id}/signatures/{lang}
    Access: Bearer JWT
    Delete the signature for one language. Answers 204 No Content.

For the signature endpoints, users other than an Administrator can only use their own {id}; another ID gives 403 Forbidden.

Creating representatives

In normal use an Administrator creates representatives with a token. The call also works without a token, but only for one purpose: creating the very first representative of a new customer account, during account setup. That works only while the customer has no representatives at all, and the representative created this way always becomes an Administrator, whatever role is sent. As soon as a customer has one representative, a call without a token is refused with 403 Forbidden.

Create body

  • username (string, required, max 254)
    Must be unique; a username in use gives 409 with code UsernameInUse.
  • password (string, required, at least 6 characters)
  • name (string, required, max 100)
  • email (string, required, valid e-mail address, max 254)
  • role (user role, default Agent)
  • phoneNumber (string, max 20, starts with + and has at least 5 digits)
  • timeZone (max 50), locale (max 10), countryCode (max 2)
  • otherDetails, emailSignatureHTML, emailSignatureText (string)

When the plan’s user limit is reached the answer is 409 with code UserLimitExceeded.

POST /api/CustomerReps
Authorization: Bearer <token>
Content-Type: application/json

{
  "username": "jan.peeters@example.com",
  "password": "Welcome-2026",
  "name": "Jan Peeters",
  "email": "jan.peeters@example.com",
  "phoneNumber": "+32470123456",
  "timeZone": "Europe/Brussels",
  "locale": "nl-BE",
  "countryCode": "BE",
  "role": "Agent"
}
201 Created
Location: /api/CustomerReps/42

{
  "customerRepID": 42,
  "username": "jan.peeters@example.com",
  "name": "Jan Peeters",
  "email": "jan.peeters@example.com",
  "phoneNumber": "+32470123456",
  "timeZone": "Europe/Brussels",
  "locale": "nl-BE",
  "countryCode": "BE",
  "role": "Agent",
  "lastLoginAt": null,
  "isActive": true,
  "calendarEnabled": false,
  "calendarMailbox": null,
  "homeBaseAddress": null,
  "homeBaseByDay": {}
}
409 Conflict

{
  "code": "UsernameInUse",
  "message": "This username is already in use. Choose a different username.",
  "errors": { "username": ["This username is already in use. Choose a different username."] }
}

Fields

Representative

Returned by the list, me, get and create endpoints.

  • customerRepID (integer)
  • username, name, email (string)
  • phoneNumber, otherDetails, timeZone, locale, countryCode (string or null)
  • emailSignatureHTML, emailSignatureText (string or null)
    The default signature; signatures per language are managed with the signature endpoints.
  • role (user role, as a name)
  • lastLoginAt (date-time or null), isActive (boolean)
  • calendarEnabled (boolean), calendarMailbox, calendarLastError (string or null), calendarLastErrorAt (date-time or null)
    The link with the representative’s Microsoft 365 calendar.
  • homeBaseAddress (string or null), homeBaseByDay (object)
    Starting address for travel time, and per weekday (keys 0 Sunday to 6 Saturday) an address that replaces it.

Update body

PUT /api/CustomerReps/{id} replaces the profile: send all fields, not only the changed ones. The username and password cannot be changed here.

  • customerRepID (integer, required)
    Must equal {id}.
  • name (required, max 100), email (required, valid, max 254)
  • phoneNumber, otherDetails, emailSignatureHTML, emailSignatureText, timeZone, locale, countryCode
    Same limits as on create.
  • role (user role)
    Only an Administrator’s change is applied.
  • calendarEnabled (boolean or null), calendarMailbox (string or null, valid address, max 254)
    Administrator only; ignored for other users. Linking the calendar needs the Microsoft 365 e-mail provider on the customer; unlinking is refused while the representative is in the pool of an online appointment type. null keeps the current value; an empty mailbox clears it.
  • homeBaseAddress (string or null, max 400), homeBaseByDay (object or null, keys 0 to 6, values max 400)
    null keeps the current value; an empty address clears it.

User roles

role is sent and returned as a name; the number is also accepted on input.

  • 0 RestrictedUser
    Works only on tickets assigned to them.
  • 1 Agent
    Handles assigned and unassigned tickets.
  • 2 Supervisor
    Handles and assigns tickets, sees reports.
  • 3 Configurator
    Configures channels, topics, actions, documents and settings, and handles tickets.
  • 4 Administrator
    Everything, including users and billing.
  • 5 Analyst
    Reports and costs.

Each endpoint on these pages shows which roles may call it.

Status codes

  • 200 OK, 201 Created, 204 No Content
    Success.
  • 400 Bad Request
    Validation errors (a list of field errors), an ID in the body that differs from the path, or an invalid calendar or home base value.
  • 401 Unauthorized
    No valid token, or a wrong current password on change-password.
  • 403 Forbidden
    The role may not call the endpoint, or a user who is not an Administrator works on another representative.
  • 404 Not Found
    No such representative in this customer, or no signature for that language.
  • 409 Conflict
    UsernameInUse or UserLimitExceeded, with a message.

FAQ

Only the first representative of a new customer account, during account setup; it always becomes an Administrator. After that, an Administrator creates representatives with a token.

The account is deactivated and marked as deleted, and it leaves appointment pools and topic links. Its tickets and history stay. An Administrator can bring it back with the activate endpoint, if the username is still free and the user limit allows it.

Every active representative of the customer that is not deleted. Supervisors and Administrators can read the list.

No. Users other than an Administrator can update their own profile, but a role change from them is ignored.

Need more help?

Table of Contents

AnswerPal: AI-powered customer service solutions to elevate your support and communication effortlessly.

Contact

For all support, sales, and partnership inquiries, email us at info@answerpal.eu

AnswerPal
Bisschoppenhoflaan 380
2100 Antwerp
Belgium

+32.36416685

BE 0862.692.858