Import target users from Excel for a customer

As a Reseller you can bulk-import target users for a customer by uploading an Excel or CSV file through the API. The flow mirrors the platform UI: upload the file, map columns to user fields, preview the parsed rows, then confirm the import. Use a credential with Client Role = Reseller. Send X-KEEPNET-Company-Id with every request so the users are created under the correct customer.


POST /api/companies/search

Get the customer's Company ID first. Use the resourceId from the response as X-KEEPNET-Company-Id in all subsequent 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


POST /api/target-users/example-file

Downloads an example Excel template with the expected column headers. Use this as a reference when preparing your file. Send X-KEEPNET-Company-Id. Body: exportType ("Csv" or "Excel").

Get example user list file

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
exportTypestringRequired

Excel or Csv

Example: Excel
Responses
chevron-right
200

OK

No content

post
/api/target-users/example-file
200

OK

No content

Example body:


POST /api/target-users/upload

Uploads the Excel/CSV file containing target users. Send the file as multipart/form-data with the field name File. Send X-KEEPNET-Company-Id. The response returns a transactionId — use it in all subsequent steps.

Upload target user list file

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
Filestring · binaryOptional
Responses
chevron-right
200

OK

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

OK

Example request headers:


GET /api/target-users/upload/{transactionId}

Returns the upload summary: detected column headers, sheet names, and row count. Use the column names from this response to build the field mappings in the next step. Send X-KEEPNET-Company-Id.

Get uploaded target user list file summary

get
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:
Path parameters
transactionIdstringRequired
Responses
chevron-right
200

OK

application/json
statusstringOptional
messagestring · nullableOptional
validationMessagesstring[] · nullableOptional
get
/api/target-users/upload/{transactionId}
200

OK


POST /api/target-users/create-mapping

Maps Excel column headers to Keepnet target user fields and starts the mapping job. Send X-KEEPNET-Company-Id. Body: transactionId, fieldMappings (array of column-to-field pairs), and optionally targetGroupResourceIds to assign imported users to existing groups.

Creates a mapping job for transaction id

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
transactionIdstringRequiredExample: <transactionId-from-upload>
targetGroupResourceIdsstring[]Optional

Optional: assign users to groups

Responses
chevron-right
200

OK

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

OK

Example body:

The response returns a resourceId for the mapping job — use it to poll the job status.


GET /api/target-users/mapping-job/{resourceId}

Polls the mapping job status. The job parses Excel rows and validates them against the field mappings. Send X-KEEPNET-Company-Id. Poll until the job status indicates completion, then proceed to preview or import.

Gets the status of the mapping job

get
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:
Path parameters
resourceIdstringRequired
Responses
chevron-right
200

OK

application/json
statusstringOptional
messagestring · nullableOptional
validationMessagesstring[] · nullableOptional
get
/api/target-users/mapping-job/{resourceId}
200

OK


POST /api/target-users/{transactionId}/search

Preview the parsed target users before importing. Returns a paginated list of temporary user records parsed from the uploaded file. Send X-KEEPNET-Company-Id. Use this to verify the data looks correct before confirming the import.

Returns a list of tmp target users to be imported

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:
Path parameters
transactionIdstringRequired
Body
pageNumberintegerRequiredExample: 1
pageSizeintegerRequiredExample: 20
orderBystringOptionalExample: Email
ascendingbooleanOptionalExample: true
Responses
chevron-right
200

OK

application/json
statusstringOptional
messagestring · nullableOptional
newUserCountinteger · int32Optional
existingUserCountinteger · int32Optional
invalidUserCountinteger · int32Optional
post
/api/target-users/{transactionId}/search
200

OK


POST /api/target-users/{transactionId}/import

Confirms and imports the parsed users into the customer's target user list. Send X-KEEPNET-Company-Id. Body: importType (e.g. "All" to import all rows, or "Selected" with selectedResourceIds to import specific users).

Imports a list of tmp target users

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:
Path parameters
transactionIdstringRequired
Body
importTypestringRequired

All or Selected

Example: All
selectedResourceIdsstring[]Optional

Required when importType is Selected

Responses
chevron-right
200

OK

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

OK

Example body (import all):


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.

  • 400 Bad Request — File format not supported, or field mappings do not match the uploaded file's columns. Verify column names from GET /api/target-users/upload/{transactionId}.

  • 404 Not Found — Invalid transactionId or resourceId. The transaction may have expired — re-upload the file.

circle-info

Platform UI: Import target users under Company → Target Users → Import. Target Users →

Related: Add target users for a customer → for adding users one by one via API. Scope API requests to a customer → for how Company ID is used across endpoints.

Last updated