Hivebuy External API (v2)

Sections

Theme switcher

Batch upsert users

Header Parameters

Authorizationstring

Path Parameters

companyIdstring Required

Company ID. Must be one of the IDs returned by GET /api/v2/companies/.

Body Parameters

emailstring Required

The matching key, case-insensitive. Required on every item.

newEmailstring

Email-change mode: move this user's login to a new address. The target must be an active member of the URL company. No other field is applied.

firstNamestring
lastNamestring
isActiveboolean

False deactivates the login itself, not just this membership.

Default value
true
externalIdstring

Your reference, e.g. the personnel number in your HR system.

rolesarray

Applied to the URL company's membership on EVERY item, omitted counts as [] and strips roles, so always send the complete set. An item that would strip the last active OWNER is refused.

Enum values:
OMDACBUAPALCOAUCRNA
... 2 other enums

Show child attributes

supervisorstring

UUID or email of a user of this company. An unresolvable value is silently ignored (legacy behaviour, preserved).

memberOfDepartmentsarray

Departments by id, name (case-insensitive) or cost center, resolved within the URL company only. An unknown reference fails the item.

Show child attributes

approverOfDepartmentsarray

Departments this person approves for. Same reference forms as memberOfDepartments.

Show child attributes

budgetOwnerOfDepartmentsarray

Departments this person owns budgets for. Same reference forms as memberOfDepartments.

Show child attributes

createUserboolean

When nothing matches: true creates the user row immediately (no invite email, exported to the identity provider); false creates an invitation the person completes themselves.

Default value
false
idpNamestring

Which identity provider the two idp fields below belong to. Defaults to microsoft.

Enum values:
microsoftgoogle
idpUserIdstring

The user's object id at the identity provider. Must not already belong to another user.

idpUsernamestring

The user's sign-in name at the identity provider. Must not already belong to another user.

Response

200
Object

Empty body when every item succeeded; otherwise the error list, a top-level array with one entry per FAILED item (successes are not echoed). Entries are single error objects, except that an item failing several validations at once contributes an array of them.

Response Attributes

statusstring
emailstring | null
messagestring
invalidRolesarray

Show child attributes

errorobject

Show child attributes

400
Object

Two cases. Every item failed: the same error-list shape as the 200. Or the request was refused whole (a body that is not a JSON array, or more than 50 items) with a plain {"error": …} body as on the bulk-upsert routes.

Response Attributes

errorstring
receivedinteger

Only on the over-limit refusal.

upsertLimitinteger

Only on the over-limit refusal.

401
Object

Missing, invalid, or expired API key, or a session credential was used instead of an API key.

Response Attributes

typestring
Enum values:
validationErrorclientErrorserverError
errorsarray

Show child attributes

403
Object

Authenticated but not entitled: the key's user is not an active member of this company, the External API feature (or the resource's own feature) is not enabled for it, the key lacks the scope this verb needs, or a browser session was used.

Response Attributes

typestring
Enum values:
validationErrorclientErrorserverError
errorsarray

Show child attributes

429
Object

Rate limit exceeded (60 requests per minute per API key). Retry after the number of seconds given in the message.

Response Attributes

typestring
Enum values:
validationErrorclientErrorserverError
errorsarray

Show child attributes

POST

/

Select
1

Response