put https://api.toriihq.com/v1.0/services/sync/custom
Use the following code snippet to validate an uploaded data file and sync a custom integration
curl -X PUT -d '{"idFile":"{FILE_ID}", "idAppAccount": "{APP_ACCOUNT_ID}"}' -H "Authorization: Bearer API_KEY" -H "Content-Type: application/json" "https://api.toriihq.com/v1.0/services/sync/custom"
- The uploaded file must be a JSON file.
- Before uploading a file using File upload API, follow the file schema.
- File type is "customIntegrationData".
- Only one sync can run at a time, a 409 error code will be returned if there's an attempt to run more than one sync at a time.
File schema
Default values are marked in red- users - Array [required] - Must have at least 1 valid user
- id - String [optional] - The unique identifier of a user in the application
- email - String [required]
- firstName - String [optional]
- lastName - String [optional]
- status - Enum (active/deleted ) [optional] - The status of the user in Torii. Only active users are displayed as users of the application
- externalStatus - String [optional] - The status of the user as it appears on the application’s site
- roles - String[] [optional]
- lastUsedDate - Date [optional] - ISO 8601 (YYYY-MM-DD)
- licenses - Array [optional]
- name - String [required]
- unassignedAmount - Number [optional] - Number of licenses that are not assigned to users
- users - Array [optional]
- email - String [required] - user's email
- licenseStatus - Enum ( active/inactive/deleted ) [optional] - If not provided, will be defined by user status
- pricePerUser - Number [optional] - should be sent in cents (will be saved in the organization's display currency)
User object:
License object:
License user object:
File example
{
"users": [
{
"id: "15893",
"email": "[email protected]",
"firstName": "Adam",
"lastName": "Test",
"status": "active",
"externalStatus": "Active",
"roles": ["Admin", "Super admin"],
"lastUsedDate": "2021-07-05T20:43:14Z"
},
{
"id": "39471",
"email": "[email protected]",
"firstName": "Tony",
"lastName": "Example",
"status": "active",
"externalStatus": "Deactivated",
"roles": ["Member"],
"lastUsedDate": "2021-05-05T14:43:14Z"
}
],
"licenses": [
{
"name": "Pro",
"unassignedAmount": 10,
"users": [
{
"email": "[email protected]",
"licenseStatus": "active"
}
],
"pricePerUser": 15000
},
{
"name": "Basic",
"unassignedAmount": 5,
"users": [],
"pricePerUser": 0
},
{
"name": "Corp",
"unassignedAmount": 20,
"users": [
{
"email": "[email protected]",
"licenseStatus": "inactive"
}
],
"pricePerUser": 20000
}
]
}
- Rate limit: 200 requests per minute