Bank connections
A bank connection (bank_connection) links a company in your workspace to its bank, through a consent page hosted by our aggregator. A connection is not a bank account: accounts appear under it once a sync has run. No endpoint on this page emits anything to the regulatory network - neither PPF (Portail Public de Facturation) nor Peppol. Opening a consent session does call our aggregator, which is the whole point of the call.
Who can use the banking API
The banking API answers only for a company it is open to. Your OAuth client does not decide this; the workspace of the company the request targets does:
| Workspace | The banking API is open to the company... |
|---|---|
| Accounting firm | ...when it subscribes to the Premium offer (subscribed_offer is premium). Two companies of the same firm can therefore get different answers |
| Corporate or Grey label | ...when Scribee has enabled the Banking option for that workspace. The option covers all its companies |
| Any other kind | Never |
A request that targets no company - the workspace-level bank rules and the list of their exclusions - is decided on the workspace: for an accounting firm, as soon as at least one of its companies subscribes to the Premium offer; for a Corporate or Grey label workspace, by the Banking option. Creating or deleting an exclusion, however, is decided on the excluded company (Bank rule exclusions).
A refusal answers 403 with error set to forbidden and the generic message Vous n'êtes pas autorisé à effectuer cette action: exactly the body a token without the required scope gets, and nothing in the response tells the two causes apart. This check runs after the OAuth scope, your application's grant on the workspace and the check that the company belongs to that workspace: a company of another workspace answers 404, never 403.
Only one operation skips this check: disconnecting a connection (DELETE /api/v1/bank_connections/{id}). When the banking API closes for a company - the Banking option removed, or an accounting firm company no longer on the Premium offer - you can still disconnect its connections, to stop the aggregator's access to the bank. The OAuth scope, the grant on the workspace, resolving the connection within your grants and authorization all still apply. The exception concerns only the opening of the banking API: a new disconnection of an archived company's connection is still refused with 403 by authorization (403 Forbidden: archived company); only the replay of a disconnection that already succeeded, under the same Idempotency-Key, still returns its 200 (Disconnecting a connection). Every other operation on that connection answers 403.
The constraint to know before you start
There is no bank connection without a browser. A server-to-server integration cannot establish a single one: at some point a human must open the aggregator's consent page, choose their bank and authenticate with it. The API opens that page and gives you its address; it does not walk through it for you.
This is a constraint of the aggregator and the banks, not a Scribee limitation, and there is no way around it.
What Scribee does for you
- Opens the consent session with the aggregator and returns the address for you to have opened.
- Advances
statusonly on durable evidence - an event received from the aggregator or an explicit sync. The browser's return to your site is not evidence: it is a navigation signal, which anyone can replay. - Prevents a replayed call from opening a second session, through
Idempotency-Key. - Never publishes the aggregator's identifiers: they stay internal.
The endpoints
GET/POST /api/v1/workspaces/{workspace_id}/companies/{company_id}/bank_connections- list and openGET /api/v1/bank_connections/{id}- read one connection
As with accounting ledgers (Accounting ledgers), only the list and the creation are addressed per workspace and per company. GET /api/v1/bank_connections/{id} has no workspace_id in the path: the identifier is resolved across every workspace attached to your OAuth client.
A connection carries ten fields, all present in every response: id, company_id, status, origin, bank_name, last_synced_at, consent_url, consent_url_expires_at, created_at and updated_at.
last_synced_at is the later of two dates: the last read of the connection's state from the aggregator, and the last company sync that ran to completion, in full or in part. A failed sync does not stamp it at its end, but the read of the connection's state it starts with may still have advanced it, when that read itself succeeded. It does not move while the connection is disconnected. It is null until either has happened.
status takes one of these five values:
status | What it means |
|---|---|
pending | The consent session is open, nobody has completed it yet |
connected | Durable evidence confirms access to the bank |
disconnected | Access has been revoked; the history already imported is kept |
expired | Authentication with the bank has expired and must be redone |
error | The aggregator reports a problem on this connection |
Step 1: open a consent session
This call runs against your production workspace - there is no sandbox. A token carrying the write scope is required, along with an Idempotency-Key header.
user_email is required: it is the address of the person who will open the consent page. The aggregator refuses to open a session without one, and it may ask that person to validate it during the flow - so send the address of the human you are about to redirect, not a generic mailbox. We cannot derive it: on a partner flow there is no signed-in user on our side, and the workspace member who owns the company is not the one in front of the screen.
redirect_url is optional. It tells Scribee where to send the browser back to you once the session is finished; it must be one of the redirect URIs registered for your OAuth application, otherwise the call is refused.
The aggregator sends the browser to Scribee. That detour is what lets us record the session's outcome on the connection whose id you have just received, before handing you back control. There is nothing for you to do about this step other than know it exists.
curl -X POST https://app.scribee.tech/api/v1/workspaces/YOUR_WORKSPACE_ID/companies/YOUR_COMPANY_ID/bank_connections \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Idempotency-Key: 4f1c2a6e-0d1b-4f2a-9a11-8d0e2c3b7a55" \
-H "Content-Type: application/json" \
-d '{
"user_email": "consenting.user@example.com",
"redirect_url": "https://partner.example.com/banking/return"
}'
201 response:
{
"data": {
"id": 501,
"company_id": 34,
"status": "pending",
"origin": "synchronized",
"bank_name": null,
"last_synced_at": null,
"consent_url": "https://connect.example-provider.com/s/abc123",
"consent_url_expires_at": "2026-08-21T11:30:00+02:00",
"created_at": "2026-08-21T11:15:00+02:00",
"updated_at": "2026-08-21T11:15:00+02:00"
}
}
This 201 means a session exists, never that a bank is connected. The connection is pending and stays there until durable evidence arrives.
consent_url is single-use and short-lived. Do not cache it, do not log it, do not re-serve it to another user.
consent_url_expires_at carries the deadline we enforce, and it should be treated as one. Past it the page may still open, but a flow finished afterwards can no longer advance this connection: warn the user or open a new session rather than waiting. The aggregator itself returns no expiry date - we publish ours, not a guess at theirs.
When the answer is a 202
Sometimes the aggregator answers without settling anything: a timeout, an error on its side, or a success carrying no address. We then do not know whether a session was opened, and answering 201 or refusing you outright would both be claims we cannot stand behind.
So you get a 202 carrying the connection, with no consent_url - there is none to give. What to do with it:
- poll the
id. If a session did exist and the person completes it, this connection is the one that advances; - if it is still
pendingpastconsent_url_expires_at, open a new session with a freshIdempotency-Key.
Replaying the same key returns this same response instead of opening a second session.
Resuming a connection: reconnect
A connection goes expired when authentication with the bank runs out, or error when the aggregator reports a problem. Either way, resuming means a new consent session:
curl -X POST https://app.scribee.tech/api/v1/bank_connections/501/reconnect \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Idempotency-Key: 9b2e1f04-7c3a-4d15-b8e6-2a5c7d9e1f30" \
-H "Content-Type: application/json" \
-d '{
"redirect_url": "https://partner.example.com/banking/return"
}'
You get the connection back with a fresh consent_url, to be opened by a human exactly as the first time.
Two differences from creation, and they matter:
statusdoes not move. A new session is an intention, not evidence: the connection stays where the last read left it until an event or a sync says otherwise;- no
user_emailis expected. The aggregator's resume flow identifies the item, not a person.
A connection that never reached the aggregator - left pending with no session ever completing - has nothing to resume: the call is refused with invalid_argument. Open a new connection instead.
reconnect does not bring back a disconnected connection. Disconnecting (Disconnecting a connection) deletes the item at the aggregator, and a new session on a deleted item cannot restore it. reconnect is for a connection whose item still exists at the aggregator, for example to renew the authentication.
Disconnecting a connection: DELETE
curl -X DELETE https://app.scribee.tech/api/v1/bank_connections/501 \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
This is not a data-deletion endpoint. status becomes disconnected, the item is deleted at the aggregator when its aggregator item id is known, which stops its access to the bank (the connection keeps its identifier), and everything already imported is retained: accounts, operations, entries. The connection itself stays readable while the banking API is open to its company. The disconnection is the only call on a connection that closing the API does not refuse: when an accounting-firm company drops from the premium offer to the run offer, the DELETE can succeed while a GET on the same id answers 403. That 403 does not signal a failed disconnection. A pending connection whose consent has not returned yet has no aggregator item id: its disconnection moves it to disconnected without calling the aggregator.
A token carrying the destroy scope is enough; write is accepted too. No Idempotency-Key header is required; it is accepted without being demanded. Disconnecting a connection that is already disconnected changes nothing and answers 200 again; with a key, the second call returns the first call's stored response.
reconnect cannot bring the deleted item back. To connect the bank again, create a new connection with POST /api/v1/workspaces/{workspace_id}/companies/{company_id}/bank_connections.
This call stays available after the banking API closes for the connection's company (Who can use the banking API): it is what lets you stop the aggregator's access to the bank. reconnect, on the other hand, then answers 403. An archived company, for its part, also refuses a new disconnection of its connections, with 403. Replaying a disconnection that already succeeded is not a new one: if the first call carried an Idempotency-Key, the same call - same key, same body - sent again within the 24 hours that follow it returns the stored 200, with the Idempotency-Replayed: true header, even if the company was archived in the meantime, and the aggregator is not called again. The scope and the grant on the workspace are checked again, authorization is not. The same key with a different body answers 409 idempotency_key_reuse, whether the first call is still running or has finished: this code says nothing about the state of that first call. The same key sent again while the first call is still running answers 409 idempotency_request_in_progress: retry once it has finished. That retry returns the stored 200 only if the first call succeeded: a first call refused with 422 released the key, and a retry with it runs the disconnection again. It is also the answer when that first call ended in an unexpected error before its outcome was recorded; the key then stays held until 24 hours after its first receipt. In both cases this call disconnects nothing and the aggregator is not called.
A disconnection can also be refused with 422, and code says which of two cases applies. validation_failed: the Idempotency-Key header sent is not between 1 and 255 characters long; details.idempotency_key says so, and nothing is performed, because the key is checked before the call. operation_failed: the disconnection did not complete, and the connection keeps its state in Scribee - either the aggregator answered with an error, or Scribee refused it before calling the aggregator (for example because the company has no account with the aggregator on record). An aggregator error does not prove the aggregator refused: after a server error, the connection may already be deleted on its side, so its state at the aggregator is undetermined. The key, if one was sent, is released, and a retry with it runs the disconnection again, calling the aggregator only once the local cause is gone; a retry that finds the connection already absent at the aggregator treats that as success and moves it to disconnected.
Step 2: have a human open the page
Send the user to consent_url. There they choose their bank and authenticate. At the end, the aggregator returns the browser to Scribee, which records the session's outcome and then sends it on to your redirect_url if you supplied one.
That return proves nothing. It carries no authority: do not use it to display a success, nor to trigger any processing. Use it only to bring the user back into your interface. What it does guarantee is that the connection whose id you hold is the one the rest of the flow will advance - not that it is connected.
Step 3: poll the connection
This is where you learn what actually happened. A read token is enough.
curl https://app.scribee.tech/api/v1/bank_connections/501 \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
status becomes connected only once an aggregator event or a sync has confirmed it. While it reads pending, the connection is not established - whether or not the user has come back to your site.
bank_name carries the bank's name once we have been able to link the connection to it, and is null until that link is made. Two ordinary cases leave it null: the bank chosen is not in our catalogue yet, which is a snapshot of what the aggregator publishes and not a guarantee; or the aggregator has told us nothing about this connection's bank. So expect null including on a connected connection: this field says nothing about the connection's state, status is what carries it.
consent_url is null on this response: it is populated only when a session is opened.
Step 4: list a company's connections
curl "https://app.scribee.tech/api/v1/workspaces/YOUR_WORKSPACE_ID/companies/YOUR_COMPANY_ID/bank_connections?status=connected" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
The list is returned newest first and pages with page and per_page. The status filter accepts one of the five values above; any other value simply matches nothing.
include=bank_accounts adds to each connection the list of accounts that depend on it, each with its whole payload - the same one described in Bank accounts. Without that parameter, the key is absent.
Errors
| Status | code | When |
|---|---|---|
422 | validation_failed | The Idempotency-Key header or the user_email field is missing |
422 | validation_failed | On DELETE /api/v1/bank_connections/{id}, the optional Idempotency-Key of a disconnection has a length outside 1 to 255 characters; details.idempotency_key flags it. Nothing was disconnected |
422 | operation_failed | On DELETE /api/v1/bank_connections/{id}, the disconnection did not complete, on an aggregator error or a refusal by Scribee before calling it. When the aggregator refused or failed the disconnection, message says which: its authorization no longer holds (reconnect the bank account) or it answered an error (retry later). No details; the connection keeps its state in Scribee, its state at the aggregator is undetermined after a server error, and a retry, even with the same key, runs the disconnection again, calling the aggregator only once the local cause is gone; if it finds the connection already absent at the aggregator, it succeeds |
422 | invalid_argument | The user_email supplied is not a valid address, or the redirect_url supplied is not registered for your application |
422 | provider_quota_exceeded | The aggregator refuses to open one more connection for this account |
422 | operation_failed | The aggregator refused the session for a transient reason, or another session is already being opened for the same company - retry |
409 | idempotency_key_reuse | The same Idempotency-Key has already served a different body or query string |
409 | idempotency_request_in_progress | An earlier call carrying this key is still running |
403 | - | Your token does not carry the scope the verb expects, your OAuth client holds no grant on this workspace, or the banking API is not open to the company concerned (Who can use the banking API) - except for DELETE /api/v1/bank_connections/{id}, which does not check that last point. On that DELETE, the 403 also comes from an archived company, but for a new disconnection only: the replay of a disconnection that succeeded before the archiving, under the same Idempotency-Key and with the same body and the same query string, returns the stored 200 |
404 | - | The company or the connection is not reachable by your grants. On GET /api/v1/bank_connections/{id}, POST /api/v1/bank_connections/{id}/reconnect and DELETE /api/v1/bank_connections/{id}, a workspace_id sent is checked first: outside your grants, or naming a workspace whose IP allowlist refuses the caller, it answers 403 before any lookup. Past that check (no workspace_id, or a workspace_id naming a permitted workspace, even another than the connection's), a connection of a workspace whose IP allowlist refuses the caller also answers 404. On DELETE /api/v1/bank_connections/{id}, the answer is the same whether or not the banking API is open to the company: nothing is disconnected and the aggregator is not called |
413 | - | The request body is over 4 MiB, or its JSON holds more than 500,000 nodes or more than 100,000 objects and arrays, nests them more than 16 levels deep, or holds a key path longer than 128 bytes or a number longer than 128 bytes. Empty-bodied response; nothing was done and the request is not counted in the shared limit - see API conventions |
429 | rate_limited | Your OAuth application went over the partner API's common limit. Nothing was done; replay the request after the delay in the Retry-After header - see API conventions |
The two 409s are not retried the same way. idempotency_key_reuse asks for a fresh key - or for the original body and query string, if what you wanted was to replay the stored response. That original request replays the stored response only if the first call recorded one, and answers idempotency_request_in_progress while that first call is still running. While the current body-comparison rule takes effect, idempotency_key_reuse can also answer a retry that resends the first call's body byte for byte, when the first call was handled under the new rule and the retry still under the old one: that 409 then proves neither that the first call did nothing nor that it acted. In that case, do not take a fresh key: retry with the same key and the same request, since a retry handled under the new rule replays the first call's stored response if that call succeeded, or check what the first call did by listing the company's connections. idempotency_request_in_progress means the key is held by a first call that is still running, or that ended with its outcome unknown. It is not final: retry later, at a spaced interval, with the same key and the same request. If the first call ends with a 2xx response, the retry replays its stored response at once; if it is refused with a 422, the key is released and the request can be run again with it. Waiting for the key to expire, 24 hours after its first receipt, only applies when the first call's outcome stays unknown: it was interrupted by an unexpected error before that outcome was recorded, and the key stays held until that expiry; then check what it did by listing the company's connections. Take a fresh key only once you have established that the first call failed: under a fresh key, a request the first call may still complete runs a second time. It is never an invitation to loop.
provider_quota_exceeded names an action on your side: free an existing connection or move to another plan with us. Retrying unchanged will be refused again.