PUT
Update an agent (organization)
Organization space User accounts only For: Administrator · Permission: agents.update Conditions
  • The caller must be a member (user, client or organization account) of the organization space; agent accounts cannot manage agent accounts.
  • username, when sent, is lowercased and must match 3 to 100 letters, digits, dots, dashes or underscores, and be unique among the agent accounts of the same organization (the current agent account is ignored).
  • password is optional on update; when sent it must meet the same strength rule as on creation.
  • profile_id, when sent, must be a profile of the current organization that can be assigned to this kind of agent account; sending null or omitting it keeps the current profile.
What else happens
  • When password, profile_id or is_active changes, the agent account’s current session is invalidated: it is signed out and must log in again.
  • When is_active goes from true to false, the public accounting export links created by this agent account are revoked, and reactivating the agent account does not reopen them.
  • Fields left out keep their current value; working_hours is cleared only when sent as null.
Part of Manage agent accounts.

Authorizations

Authorization
string
header
required

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

Path Parameters

agentId
string
required

Identifier of the agent (27-character KSUID string). It must belong to the current space.

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.