---
updatedAt: 2026-07-05T23:19:05.000Z
agentTools:
  projectIndex: https://docs.astrada.co/llms.txt
---

# Complete bank link

Completes a bank link enrollment, transitioning it from `pending` to `completed` state. The request body must contain `state: "completed"`.

When a bank link is completed, the system exchanges the enrollment credentials with the provider, creates a bank subscription (connection), and discovers the associated bank accounts.

This endpoint is idempotent: completing an already-completed bank link succeeds without change.

The PATCH response echoes the bank link record only. The discovered `bankAccounts` (with each account's `cardIds` and any minted `cards`) are returned by `GET /bank-links/{bankLinkId}`, not by this PATCH.


# OpenAPI definition

```json
{
  "openapi": "3.0.3",
  "info": {
    "title": "Astrada Banking API",
    "version": "2024-02-28",
    "contact": {
      "email": "developer@astrada.co"
    },
    "description": "The Banking API connects bank accounts (via Plaid), syncs bank\ntransactions, and reconciles them against card transactions. Import\nthis definition into Postman to get a ready-to-run collection. See\nthe \"Banking API in Postman\" guide for auth and base URLs.\n"
  },
  "servers": [
    {
      "url": "https://api.astrada.co"
    }
  ],
  "tags": [
    {
      "name": "bank-links",
      "description": "Manage bank enrollment links. A bank link represents an invitation for a user to connect their bank account via Plaid."
    }
  ],
  "externalDocs": {
    "description": "Find out more about Astrada API.",
    "url": "https://docs.astrada.co/reference"
  },
  "paths": {
    "/bank-links/{bankLinkId}": {
      "parameters": [
        {
          "$ref": "#/components/parameters/bank-link-id"
        }
      ],
      "patch": {
        "tags": [
          "bank-links"
        ],
        "summary": "Complete bank link",
        "description": "Completes a bank link enrollment, transitioning it from `pending` to `completed` state. The request body must contain `state: \"completed\"`.\n\nWhen a bank link is completed, the system exchanges the enrollment credentials with the provider, creates a bank subscription (connection), and discovers the associated bank accounts.\n\nThis endpoint is idempotent: completing an already-completed bank link succeeds without change.\n\nThe PATCH response echoes the bank link record only. The discovered `bankAccounts` (with each account's `cardIds` and any minted `cards`) are returned by `GET /bank-links/{bankLinkId}`, not by this PATCH.\n",
        "operationId": "PatchBankLink",
        "security": [
          {
            "main-auth": [
              "banking:write"
            ]
          }
        ],
        "requestBody": {
          "description": "Bank link completion request",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "state": {
                    "description": "The target state for the bank link. Only `completed` is accepted.",
                    "type": "string",
                    "enum": [
                      "completed"
                    ]
                  }
                },
                "required": [
                  "state"
                ]
              },
              "examples": {
                "BankLinkRequestExample": {
                  "value": {
                    "state": "completed"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Bank link completed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/bank-link"
                },
                "examples": {
                  "Example Complete Bank Link Response": {
                    "$ref": "#/components/examples/bank-link"
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/bad-request"
          },
          "401": {
            "$ref": "#/components/responses/unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/forbidden"
          },
          "404": {
            "$ref": "#/components/responses/not-found"
          },
          "409": {
            "$ref": "#/components/responses/conflict"
          },
          "500": {
            "$ref": "#/components/responses/server-error"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "main-auth": {
        "type": "oauth2",
        "flows": {
          "implicit": {
            "authorizationUrl": "https://api.astrada.co/auth/realms/{accountId}/protocol/openid-connect/token",
            "refreshUrl": "https://api.astrada.co/auth/realms/{accountId}/protocol/openid-connect/token",
            "scopes": {
              "accounts:write": "Accounts write resource",
              "accounts:read": "Accounts read resource",
              "subaccounts:write": "Subaccounts write resource",
              "subaccounts:read": "Subaccounts read resource",
              "card-connector-data-links:write": "card-connector-data-link resource",
              "card-connector-consents:read": "Card Consent read resource",
              "card-connector-consents:write": "Card Consent write resource",
              "webhooks:read": "Read Webhook resources",
              "webhooks:write": "Write Webhook resources",
              "card-subscriptions:write": "Create card subscription",
              "card-subscriptions:read": "Read card subscription",
              "card-verifications:write": "Create card verification",
              "card-verifications:read": "Read Card verification",
              "cards:read": "Read Card resources",
              "cardholder:read": "Read Cardholder resources",
              "cardholder:write": "Write Cardholder resources",
              "transactions:read": "Read Transaction resources",
              "transaction-messages:read": "Read Transaction Message resources",
              "network-bulk-feeds:read": "Read network bulk feed",
              "network-bulk-feeds:write": "Write network bulk feed",
              "network-bulk-enrollments:read": "Read network bulk enrollment",
              "network-bulk-enrollments:write": "Write network bulk enrollment and confirmation",
              "network-links:write": "Write network link",
              "enrollment-methods:write": "Write enrollment methods",
              "simulation:write": "Write sandbox simulations",
              "banking:read": "Read banking resources",
              "banking:write": "Write banking resources",
              "banking:admin": "Admin banking operations",
              "appstore:enrollment:write": "Enroll cards via the appstore B2C flow",
              "appstore:cards:read": "View enrolled cards in the appstore",
              "appstore:transactions:read": "View synced transactions in the appstore",
              "appstore:transactions:sync": "Trigger transaction sync in the appstore",
              "appstore:sessions:read": "Read appstore session state",
              "appstore:sessions:write": "Write or delete appstore session state",
              "appstore:tokens:read": "Read appstore stored tokens and connections",
              "appstore:tokens:write": "Write appstore stored tokens and connections"
            }
          }
        }
      }
    },
    "parameters": {
      "bank-link-id": {
        "in": "path",
        "name": "bankLinkId",
        "description": "The client-provided identifier of the bank link.",
        "required": true,
        "schema": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256,
          "pattern": "^[a-zA-Z0-9_-]+$"
        },
        "example": "enrollment_792dcb7d"
      }
    },
    "schemas": {
      "link": {
        "type": "object",
        "properties": {
          "href": {
            "type": "string"
          },
          "templated": {
            "type": "boolean"
          },
          "type": {
            "type": "string"
          },
          "deprecation": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "profile": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "hreflang": {
            "type": "string"
          }
        },
        "required": [
          "href"
        ]
      },
      "bank-link": {
        "type": "object",
        "required": [
          "_links",
          "id",
          "accountId",
          "subaccountId",
          "state",
          "hostedLink",
          "linkExpiresAt",
          "createdAt"
        ],
        "properties": {
          "_links": {
            "type": "object",
            "description": "HAL-style links to related resources.",
            "required": [
              "self"
            ],
            "properties": {
              "self": {
                "$ref": "#/components/schemas/link"
              },
              "bankAccounts": {
                "type": "array",
                "description": "Links to the bank accounts created from this link. Only present when state is `completed` and accounts exist.",
                "items": {
                  "$ref": "#/components/schemas/link"
                }
              }
            }
          },
          "id": {
            "type": "string",
            "description": "The client-provided identifier of the bank link. Must be alphanumeric with hyphens and underscores only.",
            "minLength": 1,
            "maxLength": 256,
            "pattern": "^[a-zA-Z0-9_-]+$"
          },
          "accountId": {
            "type": "string",
            "format": "uuid",
            "description": "The unique identifier of the account that owns this bank link."
          },
          "subaccountId": {
            "type": "string",
            "format": "uuid",
            "description": "The unique identifier of the subaccount associated with this bank link."
          },
          "state": {
            "type": "string",
            "description": "Current state of the bank link.\n- `pending`: The link has been created and is awaiting user enrollment.\n- `completed`: The user has successfully connected their bank account.\n- `expired`: The link has expired without being completed.\n",
            "enum": [
              "pending",
              "completed",
              "expired"
            ]
          },
          "provider": {
            "type": "string",
            "description": "Open-banking provider this link was created on. Fixed at creation:\nevery later operation on the link uses this value. Links created\nbefore provider selection existed are `plaid`.\n",
            "enum": [
              "plaid",
              "mastercard"
            ]
          },
          "hostedLink": {
            "type": "string",
            "nullable": true,
            "description": "The hosted URL where the user can complete the bank enrollment. This link expires after 4 hours and is automatically refreshed when retrieved via GET."
          },
          "linkExpiresAt": {
            "description": "Date and time when the hosted link expires, in UTC, following ISO 8601 format.",
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "completedAt": {
            "description": "Date and time when the bank link enrollment was completed, in UTC, following ISO 8601 format. Only present when state is `completed`.",
            "type": "string",
            "format": "date-time"
          },
          "lastRejection": {
            "type": "object",
            "nullable": true,
            "description": "Present while `state` is `pending` after a completion attempt was refused because the\nconnected institution is not allowed for this link (for example, a non-Amex institution\non an Amex-restricted link). The link can still be completed by reconnecting with an\nallowed institution — a successful completion clears this field.\n",
            "properties": {
              "institutionName": {
                "type": "string",
                "nullable": true,
                "description": "Display name of the refused institution."
              },
              "at": {
                "type": "string",
                "format": "date-time",
                "description": "When the refusal happened, in UTC, following ISO 8601 format."
              }
            }
          },
          "lastMintFailure": {
            "type": "object",
            "nullable": true,
            "description": "Present once a completion attempt was aborted because card creation (the\n`bank-feed` mint) failed for one or more discovered credit accounts. The\nlink stays pending and completion is retried; a later successful\ncompletion clears this field (an expired link keeps its last failure).\n`transient` failures resolve on retry; a `permanent` one keeps aborting\nuntil investigated.\n",
            "properties": {
              "at": {
                "type": "string",
                "format": "date-time",
                "description": "When the failed completion attempt happened, in UTC, following ISO 8601 format."
              },
              "kind": {
                "type": "string",
                "enum": [
                  "permanent",
                  "transient"
                ],
                "description": "Whether the underlying failure is expected to clear on retry."
              },
              "failedAccountCount": {
                "type": "integer",
                "description": "How many discovered credit accounts failed to mint on the attempt."
              }
            }
          },
          "filters": {
            "type": "object",
            "description": "The account filtering actually applied to this link, after resolution against the\naccount's bank-linking policy. Echoes what the hosted session will offer; absent on\nlinks created before filtering existed.\n",
            "properties": {
              "accountTypes": {
                "type": "array",
                "description": "Account types selectable in the hosted session.",
                "items": {
                  "type": "string",
                  "enum": [
                    "checking",
                    "savings",
                    "credit"
                  ]
                }
              },
              "linkCustomizationName": {
                "type": "string",
                "description": "The Plaid Link customization this link asked for: the request's\n`filters.linkCustomizationName`, or else the bank-linking policy's\n`plaidLinkCustomizationName`. Absent when neither applies. When Plaid refused\n`amex_only` and the create was retried without it, this still reads `amex_only`,\nand the link's completion is still held to American Express institutions.\n"
              }
            }
          },
          "bankAccounts": {
            "type": "array",
            "description": "Summary of bank accounts created from this link. Only present when state is `completed` and accounts exist.",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid",
                  "description": "The bank account identifier."
                },
                "name": {
                  "type": "string",
                  "description": "The display name of the bank account."
                },
                "institutionName": {
                  "type": "string",
                  "nullable": true,
                  "description": "Display name of the connected institution. Present on this API\nresponse; not included on the `banklink.completed` event payload.\n"
                },
                "mask": {
                  "type": "string",
                  "nullable": true,
                  "description": "Last 4 digits of the account number. For `credit` accounts this is the card\nnumber's last 4 — the per-card identity for bank-connected (e.g. American\nExpress) enrollments. Not guaranteed per-card when the institution combines\nmultiple cards into one account.\n"
                },
                "type": {
                  "type": "string",
                  "nullable": true,
                  "description": "Normalized account type (e.g. `checking`, `savings`, `credit`)."
                },
                "cardIds": {
                  "type": "array",
                  "description": "Identifiers of already-enrolled cards linked to this account, matched\nwhen an enrolled card's last 4 equals a credit account's mask (applied\nat completion and by a scheduled sweep that re-checks each cardless\ncredit account every few hours). A link is an association to an EXISTING\ncard, not a new enrollment.\n",
                  "items": {
                    "type": "string",
                    "format": "uuid"
                  }
                },
                "cards": {
                  "type": "array",
                  "description": "Cards created from this account at completion (`bank-feed` enrollments),\neach paired with its subscription. Present only on credit accounts that\ncreated a card; a created card also appears in `cardIds`.\n",
                  "items": {
                    "type": "object",
                    "required": [
                      "id",
                      "subscriptionId",
                      "last4digits",
                      "network",
                      "enrollmentType"
                    ],
                    "properties": {
                      "id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "subscriptionId": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "last4digits": {
                        "type": "string",
                        "pattern": "^\\d{4}$"
                      },
                      "network": {
                        "type": "string",
                        "nullable": true
                      },
                      "enrollmentType": {
                        "type": "string",
                        "enum": [
                          "bank-feed"
                        ]
                      }
                    }
                  }
                },
                "noLinkReason": {
                  "type": "string",
                  "nullable": true,
                  "description": "Why this credit account has no card. Present on this API response;\nnot included on the `banklink.completed` event payload. Present ONLY\nwhile the account is still cardless — once any card links, the field\ndisappears.\n\nA credit account can legitimately finish linking with no card, and\nthis says which case it was rather than leaving an unexplained empty\n`cardIds`:\n  - `bulk_card_owns_mask`: a bulk-enrolled card is the live owner of\n    this last 4. It correctly suppresses a duplicate card, and a bulk\n    subscription cannot take an automatic bank-account link.\n  - `mask_ambiguous_accounts`: several accounts on this link share the\n    mask, so no automatic link is safe.\n  - `mask_ambiguous_cards`: several enrolled cards share the mask,\n    and card-number (BIN) evidence could not narrow them to one.\n  - `card_linked_elsewhere`: the matching card is already linked to\n    another bank account.\n  - `card_not_attachable`: the matching card has no active\n    subscription to attach to.\n  - `no_institution_id`: the provider reported no institution, so no\n    stable card identity can be derived.\n  - `mask_matches_no_plausible_card`: enrolled cards share the mask,\n    but BIN evidence ruled every one of them out for the connected\n    institution (wrong issuing bank, or debit/prepaid funding), so\n    nothing linked rather than linking a known-wrong card.\n\nThe scheduled mask sweep and a manual `PATCH cardIds` both remain\navailable; the field describes the state at completion, not a\npermanent verdict.\n",
                  "enum": [
                    "bulk_card_owns_mask",
                    "mask_ambiguous_accounts",
                    "mask_ambiguous_cards",
                    "card_linked_elsewhere",
                    "card_not_attachable",
                    "no_institution_id",
                    "mask_matches_no_plausible_card"
                  ]
                }
              }
            }
          },
          "createdAt": {
            "description": "Date and time when this resource was created, in UTC, following ISO 8601 format.",
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "conflict": {
        "type": "object",
        "properties": {
          "detail": {
            "type": "string"
          },
          "title": {
            "type": "string",
            "enum": [
              "Conflict"
            ]
          },
          "currentValue": {
            "type": "string",
            "description": "Current value for the property causing the conflict"
          },
          "requestedValue": {
            "type": "string",
            "description": "Requested value for the property causing the conflict"
          }
        },
        "required": [
          "detail"
        ]
      }
    },
    "responses": {
      "bad-request": {
        "description": "The server cannot or will not process the request due to something that is perceived to be a client error",
        "content": {
          "application/problem+json": {
            "schema": {
              "type": "object",
              "properties": {
                "detail": {
                  "type": "string"
                },
                "title": {
                  "type": "string",
                  "enum": [
                    "Bad Request"
                  ]
                },
                "errors": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "title": {
                        "type": "string"
                      },
                      "detail": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "title",
                      "detail"
                    ]
                  }
                }
              },
              "required": [
                "detail",
                "title"
              ]
            },
            "examples": {
              "Example Generic Bad Request Payload Response": {
                "value": {
                  "title": "Bad Request",
                  "detail": "Request object failed validation."
                }
              },
              "Example Generic Bad Request Parameters Response": {
                "value": {
                  "title": "Bad Request",
                  "detail": "Request parameters are invalid."
                }
              }
            }
          }
        }
      },
      "unauthorized": {
        "description": "Authentication credentials were either missing or incorrect",
        "content": {
          "application/problem+json": {
            "schema": {
              "type": "object",
              "properties": {
                "detail": {
                  "type": "string"
                },
                "title": {
                  "type": "string",
                  "enum": [
                    "Unauthorized"
                  ]
                }
              },
              "required": [
                "detail",
                "title"
              ]
            },
            "example": {
              "title": "Unauthorized",
              "detail": "Authentication credentials were either missing or incorrect."
            }
          }
        }
      },
      "forbidden": {
        "description": "Authentication credentials used do not have have permissions to perform the request",
        "content": {
          "application/problem+json": {
            "schema": {
              "type": "object",
              "properties": {
                "detail": {
                  "type": "string"
                },
                "title": {
                  "type": "string",
                  "enum": [
                    "Forbidden"
                  ]
                }
              },
              "required": [
                "detail",
                "title"
              ]
            },
            "example": {
              "title": "Forbidden",
              "detail": "You do not have permission to access the requested resource."
            }
          }
        }
      },
      "server-error": {
        "description": "The server encountered an unexpected condition that prevented it from fulfilling the request",
        "content": {
          "application/problem+json": {
            "schema": {
              "type": "object",
              "properties": {
                "detail": {
                  "type": "string"
                },
                "title": {
                  "type": "string",
                  "enum": [
                    "Internal Server Error"
                  ]
                }
              },
              "required": [
                "detail",
                "title"
              ]
            },
            "example": {
              "title": "Internal Server Error",
              "detail": "The server encountered an unexpected condition that prevented it from fulfilling the request."
            }
          }
        }
      },
      "not-found": {
        "description": "The requested resource was not found on the server",
        "content": {
          "application/problem+json": {
            "schema": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string"
                },
                "instance": {
                  "type": "string"
                },
                "detail": {
                  "type": "string"
                },
                "title": {
                  "type": "string",
                  "enum": [
                    "Not Found"
                  ]
                }
              },
              "required": [
                "detail",
                "title"
              ]
            },
            "example": {
              "title": "Not Found",
              "detail": "The requested resource was not found on the server."
            }
          }
        }
      },
      "conflict": {
        "description": "Request conflict with the current state of the target resource",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/conflict"
            },
            "examples": {
              "Minimum shape (detail only)": {
                "value": {
                  "detail": "Card verification with id=9fab1bea-bc1e-4757-bd47-479422e5983b was abandoned by the user during the authentication process. Please start a new verification."
                }
              },
              "Resource conflict with currentValue": {
                "value": {
                  "title": "Conflict",
                  "detail": "The target resource already exists.",
                  "currentValue": "396aebd2-002f-4ccf-9b4d-f961c693e6e2"
                }
              }
            }
          }
        }
      }
    },
    "examples": {
      "bank-link": {
        "description": "Example of a completed Bank Link resource",
        "value": {
          "_links": {
            "self": {
              "href": "/bank-links/enrollment_792dcb7d"
            },
            "bankAccounts": [
              {
                "href": "/bank-accounts/3a8f2c1d-5e7b-4d9a-b6c8-9f0e1d2a3b4c"
              }
            ]
          },
          "id": "enrollment_792dcb7d",
          "accountId": "8f3a1b2c-4d5e-6f7a-8b9c-0d1e2f3a4b5c",
          "subaccountId": "1fcb895e-9217-4a6f-9d10-5a7dcef86c11",
          "state": "completed",
          "hostedLink": null,
          "linkExpiresAt": null,
          "completedAt": "2025-10-03T10:55:42.000Z",
          "bankAccounts": [
            {
              "id": "3a8f2c1d-5e7b-4d9a-b6c8-9f0e1d2a3b4c",
              "name": "Credit Card",
              "mask": "4001",
              "type": "credit",
              "cardIds": [
                "5dec2c49-0aa5-4683-a317-427eb5d115f3"
              ]
            }
          ],
          "createdAt": "2025-10-03T10:25:27.069Z"
        }
      }
    }
  }
}
```