---
title: "Sync a folder"
method: POST
path: "/syncs"
tags: ["Syncs"]
---

# Sync a folder

`POST /syncs`

## Request

- Base URL: `https://api.parley.so/v1`
- URL: `https://api.parley.so/v1/syncs`
- Auth: HTTP bearer

Sync a folder from Google Drive, Microsoft (OneDrive or SharePoint), Dropbox, Box, or Egnyte into a project's, account's, contact's, or intake's files, or the Library: pass exactly one of projectId, accountId, contactId, intakeId, or library, and folderId to place it inside a folder there. The sync uses your own connection to the provider, and Parley keeps the folder's files up to date in the background; they can't be changed in Parley. You sync a folder into a location once, while other people can sync the same folder there, each seeing what their own account can open: syncing it again into the same folder returns your existing sync, and into another folder of the location returns 409 FOLDER_ALREADY_SYNCED. Returns 409 CONNECTION_REQUIRED when you haven't connected the provider or must reconnect it, 400 INVALID_REFERENCE when the folder doesn't exist at the provider, isn't a folder, or your connection can't open it, and 429 TOO_MANY_REQUESTS when Egnyte's daily limit for your account is used up, until it resets at midnight UTC.

## Request body

- object
  - `projectId` string: Sync into this project's files. Pass exactly one of projectId, accountId, contactId, intakeId, or library.
  - `accountId` string: Sync into this account's files. Pass exactly one of projectId, accountId, contactId, intakeId, or library.
  - `contactId` string: Sync into this contact's files. Pass exactly one of projectId, accountId, contactId, intakeId, or library.
  - `intakeId` string: Sync into this intake's files. Pass exactly one of projectId, accountId, contactId, intakeId, or library.
  - `library` unknown
  - `folderId` string: Put it inside this folder. Omit for the top level.
  - `source` union, required: The folder to sync from a provider you've connected: the provider, and the folder's ID there.
    - object
      - `provider` 'google_drive', required
      - `folderId` string, required: The folder's Google Drive file ID.
    - object
      - `provider` 'microsoft', required
      - `driveId` string, required: The ID of the OneDrive or SharePoint document library (drive) the folder is in.
      - `folderId` string, required: The folder's item ID in that drive.
    - object
      - `provider` 'dropbox', required
      - `folderId` string, required: The folder's Dropbox ID, which starts with id:. A path isn't accepted, because the sync follows the folder when it's renamed or moved.
    - object
      - `provider` 'box', required
      - `folderId` string, required: The folder's Box ID. Box's root folder, 0, can't be synced.
    - object
      - `provider` 'egnyte', required
      - `folderId` string, required: The folder's Egnyte folder ID. A path, which starts with /, isn't accepted.

## Response `201`

Created.

- object
  - `id` string, required: The sync ID.
  - `location` union, required: Whose files these are: a project's, an account's, a contact's, or an intake's, or the organization's Library.
    - RecordRef: A reference to a project, account, or contact.
      - `type` 'project' | 'account' | 'contact', required: The kind of record: project, account, or contact.
      - `id` string, required: Its ID.
      - `name` string, required: The record's name. A contact's is its first and last name, or an email address when it has no name.
    - object: The intake's type, ID, and name.
      - `type` 'intake', required
      - `id` string, required: Its ID.
      - `name` string, required: The intake title.
    - object: The organization's shared Library.
      - `type` 'library', required
  - `folder` object, nullable, required: The folder's type, ID, and name.
    - `type` 'folder', required
    - `id` string, required: Its ID.
    - `name` string, required: The folder name.
  - `rootFolder` object, nullable, required: The folder's type, ID, and name.
    - `type` 'folder', required
    - `id` string, required: Its ID.
    - `name` string, required: The folder name.
  - `source` object, required
    - `provider` 'google_drive' | 'microsoft' | 'dropbox' | 'box' | 'clio' | 'egnyte', required: Where the synced folder lives: Google Drive, Microsoft (OneDrive or SharePoint), Dropbox, Box, Clio, or Egnyte.
    - `folderId` string, required: The synced folder's ID at the provider.
    - `driveId` string, nullable, required: For Microsoft, the ID of the drive the folder is in, which identifies the folder together with folderId. null for every other provider.
    - `name` string, nullable, required: The folder's name at the provider, or null when Parley hasn't read it.
  - `status` 'pending' | 'active' | 'interrupted' | 'failed', required: pending: created, and its first run hasn't finished. active: syncing. interrupted: a run hit a problem Parley is resolving on its own. failed: it stopped syncing; delete it and sync the folder again.
  - `reconnectRequired` boolean, required: true when the connection the sync reads through stopped working. The sync doesn't run until the person who owns that connection reconnects it.
  - `lastSyncedAt` string, date-time, nullable, required: When a run last finished, or null before the first.
  - `createdAt` string, date-time, required: When the sync was created.
  - `updatedAt` string, date-time, required: When the sync last changed, including its status.

## Other responses

- `400`: The request was invalid. VALIDATION_FAILED, INVALID_REFERENCE.
- `401`: Missing or invalid credentials. UNAUTHORIZED.
- `403`: You don't have permission. FORBIDDEN.
- `409`: The request conflicts with the current state. CONNECTION_REQUIRED, FOLDER_ALREADY_SYNCED.
- `429`: Too many requests, or a usage limit was reached. TOO_MANY_REQUESTS.

---

[API](https://skmtc.dev/parley/apis/parley-api.md) - [All operations](https://skmtc.dev/parley/apis/parley-api/llms.txt) - [OpenAPI document](https://skmtc.dev/parley/apis/parley-api/revisions/6b78aeee07bc?raw)
