# PATCH /api/v1/counterparty-defaults/{default_id}

> Update a counterparty default

- **Tag:** counterparty-defaults
- **Operation ID:** `update_counterparty_default_api_v1_counterparty_defaults__default_id__patch`

## Description

Update fields on an existing counterparty default.

## Authentication

Bearer token in `Authorization` header.
Required header: `x-business-id: <business uuid>`.

## Parameters

- `default_id` (path, string, required)

## Request body

Schema: `CounterpartyDefaultUpdate`

- `default_ledger_id` (string)
- `memo` (string)
- `mark_personal` (boolean)

## Responses

### 200 — Successful Response

Schema: `CounterpartyDefaultResponse`

- `id` (string · required)
- `business_id` (string · required)
- `registry_id` (string · required)
- `counterparty_name` (string · required)
- `default_ledger_id` (string · required)
- `default_ledger_name` (string)
- `memo` (string · required)
- `mark_personal` (boolean · required)
- `created_at` (string · date-time · required)
- `updated_at` (string · date-time · required)

### 422 — Validation Error

Schema: `HTTPValidationError`

- `detail` (array · ValidationError) → `ValidationError`
  - `loc` (array · string | integer · required)
  - `msg` (string · required)
  - `type` (string · required)
  - `input` (object)
  - `ctx` (object)

## Code samples

### cURL

```bash
curl -X PATCH 'https://api.ondayzero.com/api/v1/counterparty-defaults/{default_id}' \
  -H 'Authorization: Bearer dz_your_token' \
  -H 'x-business-id: YOUR_BUSINESS_ID' \
  -H 'Content-Type: application/json' \
  -d '{
  "default_ledger_id": "string",
  "memo": "string",
  "mark_personal": false
}'
```

### JavaScript

```javascript
const response = await fetch('https://api.ondayzero.com/api/v1/counterparty-defaults/{default_id}', {
  method: 'PATCH',
  headers: {
    Authorization: 'Bearer dz_your_token',
    'x-business-id': 'YOUR_BUSINESS_ID',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
  "default_ledger_id": "string",
  "memo": "string",
  "mark_personal": false
}),
});
const data = await response.json();
```

### Python

```python
import httpx

headers = {
    "Authorization": "Bearer dz_your_token",
    "x-business-id": "YOUR_BUSINESS_ID",
}

payload = {
  "default_ledger_id": "string",
  "memo": "string",
  "mark_personal": false
}

response = httpx.patch("https://api.ondayzero.com/api/v1/counterparty-defaults/{default_id}", headers=headers, json=payload)
data = response.json()
```

## See also

- HTML version: https://www.ondayzero.com/docs/reference/counterparty-defaults/update-counterparty-default
- OpenAPI slice: https://www.ondayzero.com/docs/reference/counterparty-defaults/update-counterparty-default/openapi.json
- Other endpoints in **counterparty-defaults**: https://www.ondayzero.com/docs/reference/counterparty-defaults
