> ## Documentation Index
> Fetch the complete documentation index at: https://apidocs.cacolombia.com/llms.txt
> Use this file to discover all available pages before exploring further.

# PATCH/PUT /v1/banks/:bankId — Update Bank Record

> Update a bank's name, owner, or icon via PATCH, or apply a capital transaction via PUT. Updating capital or using PUT requires the ADMINISTRATOR permission.

Two HTTP methods let you modify an existing bank, each suited to a different kind of change:

* **`PATCH`** — Partially updates one or more of the bank's fields: `name`, `ownerId`, `capital`, or its icon image. You only need to include the fields you want to change. The bank owner can update `name`, `ownerId`, and the icon; changing `capital` via `PATCH` additionally requires the `ADMINISTRATOR` permission. Accepts `multipart/form-data` so you can upload an icon file alongside the other fields.
* **`PUT`** — Performs an administrative capital transaction by adding or subtracting a specific `amount` from the bank's current capital. Requires the `ADMINISTRATOR` permission.

<Note>
  `PATCH` accepts `multipart/form-data` when you need to upload a new icon. Send the other fields inside a JSON-encoded `data` field, and attach the icon as a file field named `icon`. If you are not updating the icon you can send a plain `application/json` body instead.
</Note>

<Warning>
  Updating `capital` through `PATCH`, or using `PUT` at all, requires the `ADMINISTRATOR` permission. The bank owner can change the name and icon without that permission.
</Warning>

## Endpoint

```text theme={null}
PATCH https://api.cacolombia.com/v1/banks/:bankId
PUT   https://api.cacolombia.com/v1/banks/:bankId
```

## Path Parameters

<ParamField path="bankId" type="string" required>
  The Snowflake ID of the bank you want to update.
</ParamField>

## Request Body — PATCH

<ParamField body="name" type="string">
  The new display name for the bank. Omit to leave the name unchanged.
</ParamField>

<ParamField body="ownerId" type="string">
  The `characterId` of the character to transfer bank ownership to. Omit to leave the owner unchanged.
</ParamField>

<ParamField body="capital" type="number">
  The new absolute capital value for the bank. Only applied when the requesting user holds the `ADMINISTRATOR` permission. Omit to leave capital unchanged.
</ParamField>

<ParamField body="icon" type="file">
  A PNG image file to use as the bank's icon. Send as a `multipart/form-data` file field named `icon`. The server hashes the image and stores it — use the returned `iconHash` with the [images endpoint](/api-reference/images) to retrieve it.
</ParamField>

## Request Body — PUT

<ParamField body="amount" type="number" required>
  The amount to add to (or subtract from) the bank's current capital. Use a positive value to increase capital and a negative value to decrease it.
</ParamField>

## Response

Both methods return `200 OK` with the updated bank object on success:

<ResponseField name="bankId" type="string">
  The unique Snowflake ID for this bank.
</ResponseField>

<ResponseField name="ownerId" type="string">
  The `characterId` of the character who owns the bank.
</ResponseField>

<ResponseField name="name" type="string">
  The display name of the bank.
</ResponseField>

<ResponseField name="iconHash" type="string | null">
  The hash of the bank's icon. Returns `null` if no icon has been uploaded.
</ResponseField>

<ResponseField name="capital" type="number">
  The bank's capital balance after the update has been applied.
</ResponseField>

<ResponseField name="createdAt" type="string">
  ISO 8601 timestamp of when the bank was created.
</ResponseField>

<ResponseField name="updatedAt" type="string">
  ISO 8601 timestamp of when the bank was last modified (reflects this update).
</ResponseField>

## Example Requests

```bash PATCH — Rename the bank theme={null}
curl -X PATCH "https://api.cacolombia.com/v1/banks/112233445566778800" \
  -H "Authorization: Bearer <your_token>" \
  -H "Content-Type: application/json" \
  -d '{"name": "Banco Central de Colombia"}'
```

```bash PUT — Apply capital transaction theme={null}
curl -X PUT "https://api.cacolombia.com/v1/banks/112233445566778800" \
  -H "Authorization: Bearer <your_token>" \
  -H "Content-Type: application/json" \
  -d '{"amount": 500000}'
```

## Example Response

```json theme={null}
{
  "bankId": "112233445566778800",
  "ownerId": "998877665544332211",
  "name": "Banco Central de Colombia",
  "iconHash": null,
  "capital": 1500000,
  "createdAt": "2024-06-01T08:00:00.000Z",
  "updatedAt": "2024-06-06T11:45:00.000Z"
}
```

## Error Responses

| Status | Description                                                                                                                                     |
| ------ | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| `400`  | The request body is empty, contains no recognized fields, or contains values of the wrong type.                                                 |
| `401`  | You are not authenticated. Provide a valid authorization token with your request.                                                               |
| `403`  | You are not the bank owner and do not hold the `ADMINISTRATOR` permission (`PATCH`), or you do not hold the `ADMINISTRATOR` permission (`PUT`). |
| `404`  | No bank was found for the given `bankId`.                                                                                                       |

<Tip>
  Rate limiting applies to both `PATCH` and `PUT`. You can call either method at most 5 times per minute. Exceeding this limit returns HTTP `429`.
</Tip>
