Employees
Batch Update Roles
Updates many seats in one request. Each row is matched by tgaRoleInOrgID, then loginEmail, then externalEmployeeID or positionID. A row that matches no live seat creates a new person and employee (USER) seat. Unknown fields are refused.
This is the v1 (legacy) API. The current API is in the API reference.
curl --request PUT \
--url 'https://app.toku.com/api/tokuApi/v1/batchUpdateRoleInOrg' \
--header 'Authorization: Bearer <token>' \
--header 'x-role-type: CLIENT_ORG_ADMIN' \
--header 'Content-Type: application/json' \
--data '{
"updates": [
{
"employeeID": "string",
"givenName": "string",
"familyName": "string",
"loginEmail": "user@example.com",
"externalEmployeeID": "string",
"positionID": "string",
"baseSalary": "string",
"baseSalaryCurrency": "string",
"tgaRoleInOrgID": "string"
}
],
"orgID": "string"
}'{
"data": {
"updated": 0,
"failed": 0,
"results": [
{
"employeeID": "string",
"success": true,
"error": "string",
"roleInOrgID": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
]
},
"error": null
}Authorizations
AuthorizationstringheaderrequiredBearer authentication header of the form Bearer <token>, where <token> is your API token.
Headers
x-role-typestringrequiredSeat role the token acts as. The token's creator must hold this role in the token's org; TOKU_ADMIN and unknown values are refused with 401. This operation accepts CLIENT_ORG_ADMIN only; other roles get 403.
Available options: CLIENT_ORG_ADMIN
Body
application/json
updatesobject[]requiredShow child attributes
employeeIDstringrequiredCaller's identifier for the row; echoed in results.
Allowed: at least 1 characters
givenNamestringfamilyNamestringloginEmailstring<email>Used to find the seat; also used as the login of a newly created person.
externalEmployeeIDstringpositionIDstringMatched against and stored as externalEmployeeID when externalEmployeeID is absent.
baseSalarystringDecimal string
Allowed: matches ^\d+(?:\.\d+)?$
baseSalaryCurrencystringCurrency code (TaxCurrencyCode), e.g. USD.
tgaRoleInOrgIDstringSeat ID to update; tried first.
orgIDstringOptional. Must be the token's org if sent.
Response
200Batch update results
dataobjectrequiredShow child attributes
updatedintegerRows updated or created
failedintegerresultsobject[]Show child attributes
employeeIDstringsuccessbooleanerrorstringroleInOrgIDstring<uuid>errorobject | nullrequiredAlways null on success
401The token is missing, invalid or expired
errorstringrequiredWhat went wrong
403The token's seat doesn't have the permission this operation needs
errorobjectrequiredShow child attributes
messagestringrequired429Too many requests from this address or token. Wait for the number of seconds in the Retry-After header, then retry.
errorstringrequiredWhat went wrong
500The operation failed. This includes input that doesn't match what the operation accepts; error.message says what was wrong.
errorobjectrequiredShow child attributes
messagestringrequired