POST
Create an agent (client account)
Client space User accounts only For: Administrator · Permission: agents.create Conditions
  • The caller must be a member (user, client or organization account) of the client space; agent accounts cannot create agent accounts.
  • first_name and last_name are required (3 to 250 characters each) and password is required (at least 8 characters with letters of both cases, a number and a symbol).
  • profile_id is required and must be a profile of the current client account that can be assigned to this kind of agent account.
  • username is not accepted: it is generated by the server.
  • working_hours, when sent, must follow the week schedule format (days and time ranges).
What else happens
  • The server generates a username from the first and last name (lowercase slug, up to 80 characters), adding a numeric suffix such as -2 when the name is already used in the client account; a concurrent clash is retried up to 5 times, then refused with a username error.
  • The agent account is created active.
  • No email or notification is sent: agent accounts have no email address.
Part of Manage agent accounts.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

response
enum<string>
default:none

Response mode. Default none; none answers 204 No Content.

Available options:
none,
resource
fields
string

Comma-separated JSON keys of the root resource (id is always rendered). Available: id, username, first_name, last_name, type, working_hours, is_active, created_at, updated_at, profile_id, is_direct_seller.

include
string

Comma-separated include paths, each optionally followed by its fields in parentheses: units(id,sku),units.uomUnit(id,name). Max depth 6, max 40 paths. Available: company, company.organization, client, organization.

Response

Resource (only with response=resource).

id

Identifier of the agent account (27-character KSUID string).

username

Login name of the agent account, lowercase. Generated from the first and last name at creation; unique within its company, client account or organization.

first_name

First name of the agent account.

last_name

Last name of the agent account.

type

Kind of agent account: agent (company), client_agent or organization_agent.

working_hours
object | null

Weekly schedule during which the agent account may work, keyed by day name (monday to sunday) with time ranges such as 09:00-12:00, plus optional dated exceptions; null when no schedule is set.

is_active
boolean

Whether the agent account can sign in. Set to false by deactivation.

created_at

Date and time the record was created (ISO 8601, UTC).

updated_at

Date and time the record was last changed (ISO 8601, UTC).

profile_id

Identifier of the access profile assigned to the agent account (27-character KSUID string).

is_direct_seller
boolean

True when the agent account is a seller of its company with no cash register (sells directly). Always false for client and organization agent accounts.

company
object | null

Short company the agent account belongs to, for company agent accounts. Only rendered when requested with the include parameter.

client
object | null

Short client account the agent account belongs to, for client agent accounts. Only rendered when requested with the include parameter.

organization
object | null

Organization the agent account belongs to. Only rendered for organization agent accounts, and only when requested with the include parameter.