Add target users for a customer

Get a customer’s Company ID from the companies list, then add target users for that company by sending the Company ID in the request. Reseller-only — use a credential with Client Role = Reseller. This use-case ties together listing companies and scoping the target-users API to one customer.


POST /api/companies/search

Get the customer’s Company ID by calling this endpoint; use the resourceId of the desired company in the next step.

Retrieves a paginated list of all companies you manage with license details. Each item includes resourceId — use it as the Company ID for scoped requests. Test it: Authorize with Client ID/Secret, then Send — request body is pre-filled.

Retrieves a list of all companies

post
chevron-right
lockRequired scopes
This endpoint requires the following scopes:
  • : API
Authorizations
OAuth2clientCredentialsRequired

Client ID and Client Secret from Company → Company Settings → REST API. Enter credentials to auto-fetch token.

Token URL:
Body
pageNumberintegerRequiredExample: 1
pageSizeintegerRequiredExample: 10
orderBystringRequiredExample: CreateTime
ascendingbooleanRequiredExample: false
isTargetUserCountExceededLimitbooleanOptional

If true, only companies exceeding license limit are returned

Example: false
Responses
chevron-right
200

OK

application/json
statusstringOptional
messagestring · nullableOptional
validationMessagesstring[] · nullableOptional
post
/api/companies/search
200

OK

From the response, pick the company (e.g. by name) and note its resourceId. Example: "resourceId": "xC5kfGz7w2Nz" → use xC5kfGz7w2Nz as Company ID when calling POST /api/target-users.


POST /api/target-users

Add target users for that company by sending the Company ID in the X-KEEPNET-Company-Id header. Without it, the user may be created in the wrong context or the request may fail.

Creates a new target user. As a Reseller, send X-KEEPNET-Company-Id: <companyResourceId> with the customer’s Company ID from the companies search response. Body: email, firstName, lastName, and optional fields (e.g. department). Test it: Endpoints → TargetUserCreates a new target user — use dummy data (H8d) and set the header to a Company ID from companies/search.

Creates a new target user

post
chevron-right
lockRequired scopes
This endpoint requires the following scopes:
  • : API
Authorizations
OAuth2clientCredentialsRequired

Client ID and Client Secret from Company → Company Settings → REST API. Enter credentials to auto-fetch token.

Token URL:
Body
emailstring · min: 1 · max: 320Required
firstNamestring · max: 256 · nullableOptional
lastNamestring · max: 256 · nullableOptional
departmentstring · max: 256 · nullableOptional
prioritystringOptional
isActivebooleanOptional
phoneNumberstring · min: 1Required
targetGroupResourceIdsstring[] · nullableOptional
timeZoneIdstring · nullableOptional
preferredLanguageIdstring · nullableOptional
managerFirstNamestring · max: 256 · nullableOptional
managerLastNamestring · max: 256 · nullableOptional
managerEmailstring · max: 320 · nullableOptional
Responses
chevron-right
200

OK

application/json
statusstringOptional
messagestring · nullableOptional
validationMessagesstring[] · nullableOptional
post
/api/target-users
200

OK

Example request headers:

Example body (dummy data):


Common errors

  • 403 Forbidden — Credential is not Reseller, or the Company ID is not one you manage. Set Client Role = Reseller. Roles and permissions →

  • 401 Unauthorized — Missing or invalid token. Request a new token via POST /connect/token.

  • 404 Not Found / 400 Bad Request — Invalid Company ID or missing required body fields. Verify Company ID from POST /api/companies/search and check Endpoints → TargetUser for the request body schema.

Related: Scope API requests to a customer → for how Company ID is used across endpoints. Add system user for a customer → for the same flow with system users.

Last updated