> ## Documentation Index
> Fetch the complete documentation index at: https://docs.parley.so/llms.txt
> Use this file to discover all available pages before exploring further.

# Sync a folder

> 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.



## OpenAPI

````yaml https://api.parley.so/openapi.json post /syncs
openapi: 3.1.1
info:
  title: Parley API
  version: 1.0.0
  description: >-
    Manage Parley's projects (matters or cases), accounts (client
    organizations), contacts (people), tasks, custom fields, notes, files,
    activity, automations, and skills. Records refer to each other as { type,
    id, name } references; writes take IDs. Errors are { error: { code, message,
    details } }, where code names what went wrong and each operation lists the
    codes it can return. In a query string, write a timestamp's offset as Z or
    %2B, because a raw + arrives as a space. The MCP server at /mcp offers the
    same data as a smaller set of tools.
servers:
  - url: https://api.parley.so/v1
security:
  - bearerAuth: []
tags:
  - name: Projects
    description: >-
      A project is a matter or case: it groups the files, notes, activity, and
      tasks for one engagement, and links to the accounts and contacts it
      involves.
  - name: Accounts
    description: >-
      An account is a client organization. Contacts belong to it, and projects
      link to it.
  - name: Contacts
    description: >-
      A contact is a person, optionally belonging to one account and linked to
      projects.
  - name: Tasks
    description: >-
      A task is a to-do with a status, assignee, and due date, optionally about
      one project, account, or contact.
  - name: Fields
    description: >-
      Custom fields defined for projects, accounts, contacts, or tasks. Records
      carry their values in fields, keyed by field name.
  - name: Notes
    description: >-
      Markdown notes on a project, account, or contact. Updates take the version
      you last read, so concurrent edits fail with 409 VERSION_CONFLICT instead
      of overwriting.
  - name: Files
    description: >-
      Files and folders of a project, account, contact, or intake, or the
      organization's Library. Add a file by creating an upload, PUTting its
      bytes, and adding the upload to a location.
  - name: Syncs
    description: >-
      Folders from Google Drive, Microsoft, Dropbox, Box, or Egnyte that Parley
      keeps up to date in a project's, account's, contact's, or intake's files,
      or the Library, through your own connection to the provider. Synced files
      can't be changed in Parley.
  - name: Activity
    description: >-
      What happened across the organization or on one record: changes, links,
      notes, files, USCIS case updates, and synced emails and meetings. Each
      item's kind says which details it carries.
  - name: Sessions
    description: >-
      Conversations with Parley's assistant, from the web app, Word, Outlook,
      automation runs, and the API. Start one with a message, follow up or steer
      it while it works, and read its replies.
  - name: Automations
    description: >-
      Instructions Parley's assistant carries out on a schedule, as the person
      who created them, with nobody present.
  - name: Skills
    description: >-
      Reusable playbooks for Parley's assistant: a SKILL.md plus optional
      bundled documents, addressed by slug.
  - name: Users
    description: The people in your organization, and the caller.
paths:
  /syncs:
    post:
      tags:
        - Syncs
      summary: Sync a folder
      description: >-
        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.
      operationId: createSync
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                projectId:
                  type: string
                  minLength: 1
                  description: >-
                    Sync into this project's files. Pass exactly one of
                    projectId, accountId, contactId, intakeId, or library.
                accountId:
                  type: string
                  minLength: 1
                  description: >-
                    Sync into this account's files. Pass exactly one of
                    projectId, accountId, contactId, intakeId, or library.
                contactId:
                  type: string
                  minLength: 1
                  description: >-
                    Sync into this contact's files. Pass exactly one of
                    projectId, accountId, contactId, intakeId, or library.
                intakeId:
                  type: string
                  minLength: 1
                  description: >-
                    Sync into this intake's files. Pass exactly one of
                    projectId, accountId, contactId, intakeId, or library.
                library:
                  const: true
                  description: >-
                    true for the organization's Library. Pass exactly one of
                    projectId, accountId, contactId, intakeId, or library.
                folderId:
                  type: string
                  minLength: 1
                  description: Put it inside this folder. Omit for the top level.
                source:
                  anyOf:
                    - type: object
                      properties:
                        provider:
                          const: google_drive
                        folderId:
                          type: string
                          minLength: 1
                          description: The folder's Google Drive file ID.
                      required:
                        - provider
                        - folderId
                      additionalProperties: false
                    - type: object
                      properties:
                        provider:
                          const: microsoft
                        driveId:
                          type: string
                          minLength: 1
                          description: >-
                            The ID of the OneDrive or SharePoint document
                            library (drive) the folder is in.
                        folderId:
                          type: string
                          minLength: 1
                          description: The folder's item ID in that drive.
                      required:
                        - provider
                        - driveId
                        - folderId
                      additionalProperties: false
                    - type: object
                      properties:
                        provider:
                          const: dropbox
                        folderId:
                          type: string
                          pattern: ^id:.+
                          description: >-
                            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.
                      required:
                        - provider
                        - folderId
                      additionalProperties: false
                    - type: object
                      properties:
                        provider:
                          const: box
                        folderId:
                          type: string
                          minLength: 1
                          description: >-
                            The folder's Box ID. Box's root folder, 0, can't be
                            synced.
                      required:
                        - provider
                        - folderId
                      additionalProperties: false
                    - type: object
                      properties:
                        provider:
                          const: egnyte
                        folderId:
                          type: string
                          pattern: ^[^/]
                          description: >-
                            The folder's Egnyte folder ID. A path, which starts
                            with /, isn't accepted.
                      required:
                        - provider
                        - folderId
                      additionalProperties: false
                  description: >-
                    The folder to sync from a provider you've connected: the
                    provider, and the folder's ID there.
              required:
                - source
              additionalProperties: false
      responses:
        '201':
          description: Created.
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    minLength: 1
                    description: The sync ID.
                  location:
                    anyOf:
                      - $ref: '#/components/schemas/RecordRef'
                      - type: object
                        properties:
                          type:
                            const: intake
                          id:
                            type: string
                            description: Its ID.
                          name:
                            type: string
                            description: The intake title.
                        required:
                          - type
                          - id
                          - name
                        description: The intake's type, ID, and name.
                      - type: object
                        properties:
                          type:
                            const: library
                        required:
                          - type
                        description: The organization's shared Library.
                    description: >-
                      Whose files these are: a project's, an account's, a
                      contact's, or an intake's, or the organization's Library.
                  folder:
                    anyOf:
                      - type: object
                        properties:
                          type:
                            const: folder
                          id:
                            type: string
                            description: Its ID.
                          name:
                            type: string
                            description: The folder name.
                        required:
                          - type
                          - id
                          - name
                        description: The folder's type, ID, and name.
                      - type: 'null'
                    description: >-
                      The folder the synced folder is placed in, or null at the
                      top level.
                  rootFolder:
                    anyOf:
                      - type: object
                        properties:
                          type:
                            const: folder
                          id:
                            type: string
                            description: Its ID.
                          name:
                            type: string
                            description: The folder name.
                        required:
                          - type
                          - id
                          - name
                        description: The folder's type, ID, and name.
                      - type: 'null'
                    description: >-
                      The folder in Parley that holds the synced files, or null
                      until the first run creates it. Its files are listed and
                      read like any others, but can't be changed in Parley.
                  source:
                    type: object
                    properties:
                      provider:
                        enum:
                          - google_drive
                          - microsoft
                          - dropbox
                          - box
                          - clio
                          - egnyte
                        type: string
                        description: >-
                          Where the synced folder lives: Google Drive, Microsoft
                          (OneDrive or SharePoint), Dropbox, Box, Clio, or
                          Egnyte.
                      folderId:
                        type: string
                        description: The synced folder's ID at the provider.
                      driveId:
                        anyOf:
                          - type: string
                          - type: 'null'
                        description: >-
                          For Microsoft, the ID of the drive the folder is in,
                          which identifies the folder together with folderId.
                          null for every other provider.
                      name:
                        anyOf:
                          - type: string
                          - type: 'null'
                        description: >-
                          The folder's name at the provider, or null when Parley
                          hasn't read it.
                    required:
                      - provider
                      - folderId
                      - driveId
                      - name
                  status:
                    enum:
                      - pending
                      - active
                      - interrupted
                      - failed
                    type: string
                    description: >-
                      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:
                    type: boolean
                    description: >-
                      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:
                    anyOf:
                      - type: string
                        format: date-time
                      - type: 'null'
                    description: When a run last finished, or null before the first.
                  createdAt:
                    type: string
                    format: date-time
                    description: When the sync was created.
                  updatedAt:
                    type: string
                    format: date-time
                    description: When the sync last changed, including its status.
                required:
                  - id
                  - location
                  - folder
                  - rootFolder
                  - source
                  - status
                  - reconnectRequired
                  - lastSyncedAt
                  - createdAt
                  - updatedAt
        '400':
          description: The request was invalid. VALIDATION_FAILED, INVALID_REFERENCE.
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/ValidationFailedError'
                  - $ref: '#/components/schemas/InvalidReferenceError'
        '401':
          description: Missing or invalid credentials. UNAUTHORIZED.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedError'
        '403':
          description: You don't have permission. FORBIDDEN.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ForbiddenError'
        '409':
          description: >-
            The request conflicts with the current state. CONNECTION_REQUIRED,
            FOLDER_ALREADY_SYNCED.
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/ConnectionRequiredError'
                  - $ref: '#/components/schemas/FolderAlreadySyncedError'
        '429':
          description: Too many requests, or a usage limit was reached. TOO_MANY_REQUESTS.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TooManyRequestsError'
components:
  schemas:
    RecordRef:
      type: object
      properties:
        type:
          enum:
            - project
            - account
            - contact
          type: string
          description: 'The kind of record: project, account, or contact.'
        id:
          type: string
          description: Its ID.
        name:
          type: string
          description: >-
            The record's name. A contact's is its first and last name, or an
            email address when it has no name.
      required:
        - type
        - id
        - name
      description: A reference to a project, account, or contact.
    ValidationFailedError:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              const: VALIDATION_FAILED
            message:
              type: string
              examples:
                - The request is invalid.
            details:
              type: object
              properties:
                issues:
                  type: array
                  items:
                    type: object
                    properties:
                      path:
                        type: string
                        description: >-
                          Where the problem is, as a dotted path into the input
                          such as accountIds.add.0 or reminder.remindAt. Empty
                          for the input as a whole.
                      message:
                        type: string
                        description: What is wrong with the value.
                    required:
                      - path
                      - message
                  description: Each problem with the input.
              required:
                - issues
          required:
            - code
            - message
            - details
      required:
        - error
    InvalidReferenceError:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              const: INVALID_REFERENCE
            message:
              type: string
              examples:
                - >-
                  The request refers to a record or user that doesn't exist or
                  that you can't use.
            details:
              type: object
              properties:
                field:
                  type: string
                  description: The input that holds the reference, such as accountIds.
                ids:
                  type: array
                  items:
                    type: string
                  description: The IDs that could not be used.
              required:
                - field
                - ids
          required:
            - code
            - message
            - details
      required:
        - error
    UnauthorizedError:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              const: UNAUTHORIZED
            message:
              type: string
              examples:
                - Missing or invalid credentials.
          required:
            - code
            - message
      required:
        - error
    ForbiddenError:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              const: FORBIDDEN
            message:
              type: string
              examples:
                - You don't have permission to do this.
          required:
            - code
            - message
      required:
        - error
    ConnectionRequiredError:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              const: CONNECTION_REQUIRED
            message:
              type: string
              examples:
                - Connect the provider before syncing its folders.
            details:
              type: object
              properties:
                reason:
                  enum:
                    - not_connected
                    - reconnect_required
                  type: string
                  description: >-
                    not_connected: you haven't connected the provider.
                    reconnect_required: your connection to it stopped working
                    and must be reconnected.
                connector:
                  type: string
                  description: The connector to connect, such as Google Drive.
              required:
                - reason
                - connector
          required:
            - code
            - message
            - details
      required:
        - error
    FolderAlreadySyncedError:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              const: FOLDER_ALREADY_SYNCED
            message:
              type: string
              examples:
                - >-
                  You already sync this folder into another folder of the same
                  location.
            details:
              type: object
              properties:
                syncId:
                  type: string
                  description: Your sync that already syncs the folder.
              required:
                - syncId
          required:
            - code
            - message
            - details
      required:
        - error
    TooManyRequestsError:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              const: TOO_MANY_REQUESTS
            message:
              type: string
              examples:
                - Too many requests.
          required:
            - code
            - message
      required:
        - error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: A Parley API key.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.