Skip to main content

Agents

Registering an agent​

POST /agents (scope write:agents) registers a new agent in one call. It also creates the agent's payee, contact and team membership records.

POST /agency-management/acme/agents
Content-Type: application/json

{
"firstName": "Dana",
"lastName": "Lopez",
"commonName": "Dana",
"email": "dana.lopez@example.com",
"governmentIdentifier": "123456789",
"birthDate": "1988-04-12",
"npn": "17654321",
"startDate": "2026-09-01T00:00:00Z",
"status": "Active",
"teams": {
"default": { "directUpline": "A1001", "level": 10 }
},
"homeAddress": {
"line1": "100 Main St",
"city": "Austin",
"jurisdiction": "US-TX",
"postalCode": "78701",
"country": "US"
},
"cellPhone": { "areaCode": "512", "phoneNumber": "5550123" },
"initiator": "jsmith@acme-agency.com"
}

Request fields​

FieldRequiredNotes
firstName, lastNameYes
middleName, commonNameNocommonName is the preferred or display first name.
agentCodeNoLeave it out to have a code generated. See Agent codes.
statusYesThe initial pay status. It must be a configured pay status.
teamsYesA dictionary keyed by team name (currently default). Each entry is { directUpline, level }.
startDateNoAn ISO 8601 UTC timestamp. Defaults to now. It can't be in the future or before 1900-01-01.
governmentIdentifierNoSSN/SIN. Also used to find an existing code in the master agency.
birthDate, gender, email, npn, customerId, isDedicatedNo
homeAddress, businessAddressNo{ line1, line2, city, jurisdiction, postalCode, country }
cellPhone, homePhone, businessPhone, faxNo{ areaCode, phoneNumber, countryCode }. countryCode defaults to 1.
directDepositNoBank details for US or Canadian accounts.
w9No{ name, businessName, taxClassification, exemptPayee, address { streetAddress, city, state, zipCode }, accountNumber, taxpayerIdentifier, signature, signatureDate }
initiatorYesSee Auditing.

The response contains the full agent, including the assigned agentCode.

warning

Not idempotent

POST /agents creates a new agent every time it's called. If a request times out, look for the agent (for example by governmentIdentifier, npn or email) before you retry.

Agent codes​

If you leave out agentCode, AgencyMax generates one from the agency's pool of available codes.

If you supply an agentCode, it must not already be in use in the agency.

Finding agents​

GET /agents (scope read:agents) returns a paged list.

ParameterDescription
agentCodesA list of agent codes (up to 100).
isActiveFilter by active or inactive pay status.
email, firstName, lastNameFilter by these fields.
jurisdictionFilter by jurisdiction, e.g. US-TX.
governmentIdentifier, npnLook up by identifier.
modifiedSinceOnly agents changed at or after this UTC timestamp. Ideal for incremental syncs.
pageIndex, pageSize, sortSee Pagination and sorting. Sort fields: agentCode, firstName, lastName, commonName, startDate, lastModified.

GET /agents/{agentCode} returns a single agent, or 404 if it doesn't exist.

An agent as of a date​

GET /agents/{agentCode}/on-date/{onDate} returns the agent as it was on onDate (YYYY-MM-DD). That includes the pay status, W9, and the default team's direct upline and level effective that day. Use it for commission calculations or for questions such as "who was this agent's upline on March 1?"

Updating an agent​

Agent data is spread across several PATCH operations, all needing write:agents and an initiator:

OperationUpdates
PATCH /agents/{agentCode}Core agent details: names, email, identifiers, dates and so on.
PATCH /agents/{agentCode}/contactAddresses and phone numbers.
PATCH /agents/{agentCode}/payeeCurrent pay status, W9 and direct deposit. See Payees.
PATCH /teams/{team}/members/{agentCode}Current direct upline and level. See Teams and hierarchy.
PATCH /agents/{agentCode}/tagsAssign or unassign tags.

All of them follow the partial update rules.

Deleting an agent​

DELETE /agents/{agentCode} needs the separate delete:agents scope. It permanently removes the agent and related data.

An agent who has been paid commissions can't be deleted. The request is rejected so the payment history stays intact. Change the agent's pay status instead, for example to a terminated status.

Aliases​

An alias is another identifier for an agent, optionally tied to a provider company, such as the writing number a carrier assigns. Aliases let you match inbound carrier data to agents.

  • POST /agents/{agentCode}/aliases with { identifier, providerCompany, initiator }
  • GET /agents/{agentCode}/aliases, GET /aliases, GET /aliases/{id}
  • DELETE /aliases/{id}

Tags​

Tags are labels defined by the agency (see Reference data) that can be assigned to agents.

PATCH /agency-management/acme/agents/A1051/tags

{
"tags": [
{ "operation": "Assign", "tag": "top-producer" },
{ "operation": "Unassign", "tag": "new-recruit" }
],
"initiator": "jsmith@acme-agency.com"
}

GET /tags/assigned lists tag assignments across all agents, with paging.