Update Account Metadata
Update the name, domain, and metadata attributes for a specific account. This endpoint performs a partial merge -- only the fields you include are changed. Existing metadata keys not present in the request are preserved.
PATCH /accounts/{id}/metadata
Request
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Account ID (path parameter) |
Request Body
All fields are optional, but the request body must include at least one of name, domain, or metadata.
| Field | Type | Required | Description |
|---|---|---|---|
name | string | No | Update the account's company name |
domain | string | No | Update the account's primary email domain |
metadata | object | No | Key-value pairs to merge into the account's metadata |
Example
curl -X PATCH "https://api.kenbun.io/accounts/acct_abc123/metadata" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"name": "Acme Corporation",
"domain": "acme.com",
"metadata": {
"industry": "Technology",
"employees": 2500,
"linkedin_url": "https://linkedin.com/company/acme"
}
}'
Response
204 No Content
A successful update returns no response body.
Common Errors
| Status | Meaning | Solution |
|---|---|---|
| 400 | Bad Request | Account ID not provided, or request body could not be parsed |
| 401 | Unauthorized | Check authentication credentials |
| 404 | Not Found | Account does not exist or is not accessible in this OU |
| 413 | Payload Too Large | Reduce the number or size of metadata values in the request |
| 500 | Server Error | Contact support if the issue persists |
Notes
- Metadata updates are a partial merge -- existing keys not included in the request are preserved unchanged.
- Setting a metadata key to
nullremoves it from the account's metadata. - Changes to
nameanddomaintake effect immediately across all leads associated with this account. - This endpoint is scoped to the active Organizational Unit.
Related Endpoints
- GET /accounts - List all accounts
- GET /accounts/by-domain - Look up account by domain or name
- GET /accounts/{id} - View full account details