---
title: "Sync custom integration"
method: PUT
path: "/services/sync/custom"
tags: ["Integrations"]
---

# Sync custom integration

`PUT /services/sync/custom`

## Request

- Base URL: `https://api.toriihq.com/v1.0`
- URL: `https://api.toriihq.com/v1.0/services/sync/custom`
- Auth: API key in header `Authorization`

<div>Use the following code snippet to validate an uploaded data file and sync a custom integration</div>
        <code class="hljs">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"</code>
        <ul>
          <li>The uploaded file must be a JSON file.</li>
          <li>Before uploading a file using <a href="#operation--files-url-get">File upload API</a>, follow the file schema.</li>
          <li>File type is "customIntegrationData".</li>
          <li>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.</li>
        </ul>
        <details>
          <summary>File schema</summary>
          Default values are marked in <span style="color:red;">red</span>
          <ol>
            <li>users - Array [required] - Must have at least 1 valid user</li>
            <div>User object:</div>
            <ul>
                <li>id - String [optional] - The unique identifier of a user in the application</li>
                <li>email - String [required]</li>
                <li>firstName - String [optional]</li>
                <li>lastName - String [optional]</li>
                <li>status - Enum (<span style="color:red;">active</span>/deleted ) [optional] - The status of the user in Torii. Only active users are displayed as users of the application</li>
                <li>externalStatus - String [optional] - The status of the user as it appears on the application’s site</li>
                <li>roles - String[] [optional]</li>
                <li>lastUsedDate - Date [optional] - ISO 8601 (YYYY-MM-DD)</li>
            </ul>
            <li>licenses - Array [optional]</li>
            <div>License object:</div>
            <ul>
               <li>name - String [required]</li>
               <li>unassignedAmount - Number [optional] - Number of licenses that are not assigned to users</li>
               <li>users - Array [optional]</li>
               <div>License user object:</div>
               <ul>
                  <li>email - String [required] - user's email</li>
                  <li>licenseStatus - Enum ( active/inactive/deleted ) [optional] - If not provided, will be defined by user status</li>
               </ul>
               <li>pricePerUser - Number [optional] - should be sent in cents (will be saved in the organization's display currency) </li>
            <ul>
          </ol>
        </details>
        <details>
          <summary>File example</summary>
<pre>
 {
  "users": [
    {
      "id: "15893",
      "email": "adam@example.com",
      "firstName": "Adam",
      "lastName": "Test",
      "status": "active",
      "externalStatus": "Active",
      "roles": ["Admin", "Super admin"],
      "lastUsedDate": "2021-07-05T20:43:14Z"
    },
    {
      "id": "39471",
      "email": "tony@example.com",
      "firstName": "Tony",
      "lastName": "Example",
      "status": "active",
      "externalStatus": "Deactivated",
      "roles": ["Member"],
      "lastUsedDate": "2021-05-05T14:43:14Z"
    }
  ],
  "licenses": [
    {
      "name": "Pro",
      "unassignedAmount": 10,
      "users": [
        {
          "email": "adam@example.com",
          "licenseStatus": "active"
        }
      ],
      "pricePerUser": 15000
    },
    {
      "name": "Basic",
      "unassignedAmount": 5,
      "users": [],
      "pricePerUser": 0
    },
    {
      "name": "Corp",
      "unassignedAmount": 20,
      "users": [
        {
          "email": "tony@example.com",
          "licenseStatus": "inactive"
        }
      ],
      "pricePerUser": 20000
    }
  ]
}</pre>
</details>
<p><ul><li>Rate limit: 200 requests per minute</li></ul></p>

## Request body

- CustomIntegrationSyncConfiguration: Custom integration sync configuration
  - `idFile` integer, required: Unique file identifier
  - `idAppAccount` integer, required: Unique app account identifier

## Other responses

- `409`: Error Response

---

[API](https://skmtc.dev/toriihq/apis/torii-api-documentation.md) - [All operations](https://skmtc.dev/toriihq/apis/torii-api-documentation/llms.txt) - [OpenAPI document](https://skmtc.dev/toriihq/apis/torii-api-documentation/revisions/15fd1512591b?raw)
