---
title: "Create sync job"
method: POST
path: "/api/v1/add/syncjob"
tags: ["Sync jobs"]
---

# Create sync job

`POST /api/v1/add/syncjob`

You can create new sync job using this action. It takes a JSON object containing a domain informations.

## Request body

- object
  - `parameters` string — your local mailcow mailbox
  - `host1` string — the smtp server where mails should be synced from
  - `port1` string — the smtp port of the target mail server
  - `user1` string — the username of the mailbox
  - `password` string — the password of the mailbox
  - `enc1` string — the encryption method used to connect to the mailserver
  - `mins_internal` number — the interval in which messages should be syned
  - `subfolder2` string — sync into subfolder on destination (empty = do not use subfolder)
  - `maxage` number — only sync messages up to this age in days
  - `maxbytespersecond` number — max speed transfer limit for the sync
  - `timeout1` number — timeout for connection to remote host
  - `timeout2` number — timeout for connection to local host
  - `exclude` string — exclude objects (regex)
  - `custom_params` string — custom parameters
  - `delete2duplicates` boolean — delete duplicates on destination (--delete2duplicates)
  - `delete1` boolean — delete from source when completed (--delete1)
  - `delete2` boolean — delete messages on destination that are not on source (--delete2)
  - `automap` boolean — try to automap folders ("Sent items", "Sent" => "Sent" etc.) (--automap)
  - `skipcrossduplicates` boolean — skip duplicate messages across folders (first come, first serve) (--skipcrossduplicates)
  - `subscribeall` boolean — subscribe all folders (--subscribeall)
  - `active` boolean — enables or disables the sync job

## Response `200`

OK

- object
  - `log` unknown[] — contains request object
    - unknown
  - `msg` unknown[]
    - unknown
  - `type` 'success' | 'danger' | 'error'

## Other responses

- `401` — Unauthorized

## Changes

- **2024-12-14** `844ea6eb90b8` — 1 info
  - added the new optional request property `user1`
- **2020-08-14** `a43e2da3da1d` — 1 info
  - added optional request body
- **2020-06-07** `47523aca063a` — 1 breaking
  - removed the request body

[Change history](https://skmtc.dev/mailcow/apis/mailcow-api/changes/api/v1/add/syncjob/post.md)

---

[API](https://skmtc.dev/mailcow/apis/mailcow-api.md) · [All operations](https://skmtc.dev/mailcow/apis/mailcow-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/mailcow/mailcow-api/revisions/ae01d1d7886a/schema)
