---
title: "Sync a bank connection"
method: POST
path: "/api/connections/{connection-id}/sync"
tags: ["XS2A.api.connections"]
---

# Sync a bank connection

`POST /api/connections/{connection-id}/sync`

Syncing a bank connection means that the login to the bank is repeated, the new balance and the new list of turnovers is fetched and the list of accounts associated to the bank  user is updated accordingly.
**Note**: Every event that occurs when synchronizing bank connections is sent out to a webhook URL. See the [Bank Connection Events Section](#tag/XS2A.api-Bank-Connection-Events) for more details.
### Error Handling
Any bank connections that are in sync mode full are synced automatically by XS2A. No further steps are needed the  turnovers and balance information on the accounts will always be up to date. If a sync process fails for some reason,  e.g. the user has changed her password, that the automatic sync will stop. The field sync_message will contain more  information about the error. The field sync_fail_counter will have the number of subsequent failures. sync_active will  be set to false an the connection will not be synced again.
If the case above the sync can however be forced via the API, using the `force` parameter as described below.  After 2 failures in a row the bank connection will be disabled and can not be synced again. It will have to be deleted and recreated. The user will have to re-enter his credentials.

## Path parameters

- `connection-id` string, required

## Request body

- Xs2aApiConnectionsSync
  - `credentials` string — **Only required** if the sync mode is *shared*: Your part of the shared credentials.
  - `force` boolean — If an error occurred during syncing, you may force a retry. If the sync_fail_counter goes up to 3 no more syncs are allowed.

## Response `202`

If the sync requires any form of user interaction a structure containing a new wizard_session_key will be returned, similar to creating a new bank connection. The HTTP response code will be 202 in this case.

- WizardSessionResponse
  - `wizard_session_key` string — Using the wizard_session_key you can now initialize our Wizard which is running on your website
  - `transaction` string — We suggest that you store the internally used XS2A transaction id transaction with your transaction data, because if you later have questions about a transaction, we need this number to be able to quickly assist you.

## Other responses

- `204` — The server successfully processed the request and is not returning any content. (The sync process will be executed without any user interaction)
- `401` — Authentication failed API key missing or not valid
- `403` — Forbidden Access blocked
- `404` — Product not enabled or Not found The requested object does not exist on the server
- `422` — Validation failed Something is wrong with the user input
- `500` — An internal server problem occurred

---

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