---
title: "Refresh a connection"
method: PUT
path: "/connections/{connection_id}/refresh"
tags: ["Connections"]
---

# Refresh a connection

`PUT /connections/{connection_id}/refresh`

Allows you to trigger a refetch of the data associated with a specific connection.
Note that you can refresh a connection only if it has an active [consent](#consents).
If the response is successful, it will contain the `next_refresh_possible_at` value, and you can expect the [usual callbacks](#callbacks) of the fetching workflow.

## Path parameters

- `connection_id` string, required

## Request body

- RefreshConnectionRequestBody
  - `data` object, required
    - `attempt` AttemptRequestBody
      - `fetch_scopes` string[] — fetching mode. Defaults to [consent](#consents-object) scopes. The allowed values for this parameter must comply to the [consent](#consents-object) `scopes` restriction.
      - `from_date` string, date — date from which you want to fetch data for your connection. Defaults to [consent](#consents-object) `from_date`. The allowed values for this parameter must be within exactly 365 days ago and it should comply to the fetching period restrictions in the [consent](#consents-object).
      - `to_date` string, date — date until which you want to fetch data for your connection. Defaults to `null` (today). The allowed values for this parameter must be equal or more than `from_date` and less or equal than tomorrow. Also it should comply to the fetching period restrictions in the [consent](#consents-object).
      - `fetched_accounts_notify` boolean — whether Salt Edge should send a success callback after fetching accounts.
      - `custom_fields` object — a JSON object, which will be sent back on any of your callbacks.
      - `locale` string — the language of the Connect widget and of the returned error message(s) in the <a href='http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes' target="_blank">ISO 639-1</a> format. Possible values are: `bg`, `cz`, `de`, `en`, `es-MX`, `es`, `fi`, `fr`, `he`, `hr`, `hu`, `it`, `nl`, `pl`, `pt-BR`, `pt`, `ro`, `ru`, `si`, `sk`, `sv`, `tr`, `uk`, `zh-HK`(Traditional), `zh`(Simplified). Defaults to `en`.
      - `include_natures` string[], nullable — the natures of the accounts that need to be fetched. Check [accounts attributes](#accounts-attributes) for possible values. If `null`, all accounts will be fetched.
      - `customer_last_logged_at` string, date-time — the datetime when user was last active in your application
      - `exclude_accounts` string[] — array of [account `ids`](#accounts-list) which will not be fetched. Applied to `reconnect` and `refresh` atempts.
      - `store_credentials` boolean, required — whether the credentials should be stored on Salt Edge side
      - `unduplication_strategy` string — This parameter mandates how duplicated transactions are managed. Possible values include: `mark_as_pending`, `mark_as_duplicate`, `delete_transactions`. The default is set to `mark_as_pending`. The provided value remains unchanged until other value is sent on [connect_session/reconnect](/account_information/v5/#connections-reconnect) or [connect_session/refresh](/account_information/v5/#connections-refresh). - `mark_as_pending` - leaves identified duplicated transactions in `Pending` status for clients that establish connections with providers having a non-null `custom_pendings_period` - `mark_as_duplicate` - identifies transactions as duplicated and sets the `duplicated` flag to `true` - `delete_trasactions` - removes identified duplicated transactions
      - `user_present` boolean — whether the request was initiated by the end-user of your application. It is taken into account only for PSD2-compliant providers and used for `reconnect` and `refresh`.
      - `return_to` string — the URL the user will be redirected to, defaults to client's home URL. If the provider has `api` mode and interactive `true` then this field is `mandatory`.
    - `daily_refresh` boolean — whether the connection should be automatically refreshed by Salt Edge.
    - `include_fake_providers` boolean — if sent as `true`, the customers of [live](/general/v5/#live) clients will be able to connect [fake providers](#providers-fake).
    - `categorization` 'none' | 'personal' | 'business' — the type of categorization applied.

## Response `200`

OK

- ConnectionResponse
  - `data` Connection — A connection represents a set of credentials required to access the [accounts](#accounts) and [transactions](#transactions) through a specific [provider](#providers).
    - `id` string, required — the `id` of the connection
    - `secret` string, required — the secret key associated with a specific `connection`. It allows to read the information related to a connection using API keys of type `app`.
    - `provider_id` string, required — the `id` of the provider the connection belongs to
    - `provider_code` string, required — the code of the provider the connection belongs to
    - `provider_name` string, required — the name of the provider the connection belongs to
    - `daily_refresh` boolean, required — whether the connection will be refreshed daily
    - `customer_id` string, required — customer's `id`
    - `created_at` string, date-time, required — time and date when the connection was added
    - `updated_at` string, date-time, required — the last time when the connection's balance was changed, new accounts were imported or new transactions added/removed
    - `last_success_at` string, date-time, required — time when the connection was successfully fetched
    - `status` 'active' | 'inactive' | 'disabled', required
    - `country_code` string, required — code of the country the provider belongs to
    - `next_refresh_possible_at` string, date-time — when the next refresh will be available. May contain `null` value if connection has `automatic_fetch` set as `false`, or is already processing
    - `store_credentials` boolean, required — whether the credentials were stored on our side
    - `last_attempt` SimplifiedAttempt, required
      - `api_mode` 'app' | 'service' — the API mode of the customer that queried the API.
      - `api_version` string — the API version in which the attempt was created
      - `automatic_fetch` boolean — whether the connection related to the attempt can be automatically fetched
      - `daily_refresh` boolean — latest assigned value for `daily_refresh` in connection
      - `categorize` boolean — whether attempt is categorized
      - `created_at` string, date-time — when the attempt was made
      - `custom_fields` object — the custom fields that had been sent when creating connection/connect\_session/oauth\_provider
      - `device_type` 'desktop' | 'tablet' | 'mobile' — the type of the device that created the attempt.
      - `remote_ip` string — the IP of the device that created the attempt
      - `exclude_accounts` string[] — the `ids` of accounts that do not need to be refreshed
      - `user_present` boolean — whether the request was initiated by the end-user of your application
      - `customer_last_logged_at` string, date-time — the datetime when user was last active in your application
      - `fail_at` string, date-time — when the attempt failed to finish
      - `fail_error_class` string — class of error that triggered the fail for attempt
      - `fail_message` string — message that describes the error class
      - `fetch_scopes` string[] — fetching mode.
      - `finished` boolean — whether the connection had finished fetching
      - `finished_recent` boolean — whether the connection had finished data for recent range
      - `from_date` string, date — date from which the data had been fetched
      - `id` string — `id` of the attempt
      - `interactive` boolean — whether the connection related to the attempt is interactive
      - `locale` string — the language of the Connect widget and of the returned error message(s) in the <a href='http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes' target="_blank">ISO 639-1</a> format. Possible values are: `bg`, `cz`, `de`, `en`, `es-MX`, `es`, `fi`, `fr`, `he`, `hr`, `hu`, `it`, `nl`, `pl`, `pt-BR`, `pt`, `ro`, `ru`, `si`, `sk`, `sv`, `tr`, `uk`, `zh-HK`(Traditional), `zh`(Simplified). Defaults to `en`.
      - `partial` boolean — whether the connection was partially fetched
      - `store_credentials` boolean — whether the credentials were stored on our side
      - `success_at` string, date-time — when the attempt succeeded and finished
      - `to_date` string, date-time — date until which the data has been fetched
      - `updated_at` string, date-time — when last attempt update occurred
      - `show_consent_confirmation` boolean — whether any consent was given for this connection
      - `include_natures` string[] — the natures of the accounts that need to be fetched
      - `last_stage` Stage
        - `created_at` string, date-time, required — when the stage was created
        - `id` string, required — the `id` of the stage
        - `interactive_fields_names` string[], nullable — the interactive fields that are currently required by the provider. Appears only for the interactive connections
        - `interactive_html` string, nullable — HTML code that shows the current interactive state of the connection. Appears only for the interactive connections
        - `name` 'start' | 'connect' | 'interactive' | 'fetch_holder_info' | 'fetch_accounts' | 'fetch_recent' | 'fetch_full' | 'disconnect' | 'finish', required — the name of the stage.
        - `updated_at` string, date-time, required — when the stage was last updated
    - `show_consent_confirmation` boolean, required — whether any consent was given for this connection on Salt Edge side
    - `last_consent_id` string, required — the `id` of the last [consent](#consents)

## Other responses

- `400` — The passed `from_date` - `to_date` interval is out of consent `from_date` - `to_date` range
- `404` — We could not find a connection with the requested `connection_id`
- `406` — Refresh is not possible because the consent has expired

---

[API](https://skmtc.net/saltedge/apis/salt-edge-account-information-api.md) · [All operations](https://skmtc.net/saltedge/apis/salt-edge-account-information-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/saltedge/salt-edge-account-information-api/versions/f18f4f36d0b3/schema)
