Accounts — Create & Update
Create new accounts and update existing ones with partial updates, products, and dynamic fields.
Create Account
POST
/apidev/v1/accountsPermissionAPICLI_ACCOUNTS_WRITE
Rate Limit10 req/min
Request Body
| Field | Type | Required | Max | Description |
|---|---|---|---|---|
name | string | Yes | 200 | Account display name. |
external_code | string | No | 120 | External system identifier. |
status | string | No | 10 | Account status. |
business_name | string | No | 200 | Legal business name. |
tax_id | string | No | 60 | Tax identification number. |
document | string | No | 60 | Document number. |
document_type | number | No | — | Document type identifier. |
phone | string | No | 60 | Phone number. |
mobile | string | No | 60 | Mobile phone. |
email | string | No | 200 | Email address. |
image_url | string | No | 500 | Image URL. |
notes | string | No | 1000 | Free-text notes. |
street | string | No | 200 | Street name. |
door_number | string | No | 20 | Door number. |
apartment | string | No | 20 | Apartment or suite. |
corner | string | No | 200 | Cross street. |
zip_code | string | No | 20 | Postal code. |
latitude | number | No | — | Latitude coordinate. |
longitude | number | No | — | Longitude coordinate. |
country_id | string | No | 30 | Country ID. |
department_id | string | No | 30 | Department ID. |
client_id | string | No | 30 | Associated client ID. |
qr_code | string | No | 30 | QR code value. |
start_date | string | No | 30 | Start date (ISO 8601). |
end_date | string | No | 30 | End date (ISO 8601). |
birth_date | string | No | 30 | Birth date (ISO 8601). |
Code Examples
- cURL
- JavaScript
- Python
curl -s -X POST "https://$TENANT/apidev/v1/accounts" \
-H "Authorization: Bearer $TOKEN" \
-H "X-API-Key: $APIKEY" \
-H "tenant: $TENANT" \
-H "Content-Type: application/json" \
-d '{
"name": "Acme Corp",
"business_name": "Acme Corporation S.A.",
"tax_id": "214100001019",
"email": "contact@acme.com",
"phone": "+59821234567",
"street": "Av. Rivera",
"door_number": "1234",
"country_id": "1",
"department_id": "10",
"client_id": "982710394857200005",
"start_date": "2026-01-15"
}'
const res = await fetch(
`https://${TENANT}/apidev/v1/accounts`,
{
method: 'POST',
headers: {
'Authorization': `Bearer ${token}`,
'X-API-Key': apiKey,
'tenant': TENANT,
'Content-Type': 'application/json',
},
body: JSON.stringify({
name: 'Acme Corp',
business_name: 'Acme Corporation S.A.',
tax_id: '214100001019',
email: 'contact@acme.com',
phone: '+59821234567',
street: 'Av. Rivera',
door_number: '1234',
country_id: '1',
department_id: '10',
client_id: '982710394857200005',
start_date: '2026-01-15',
}),
}
);
const { data } = await res.json();
console.log(`Created account: ${data.id}`);
import requests
response = requests.post(
f"https://{TENANT}/apidev/v1/accounts",
headers={"Authorization": f"Bearer {token}", "X-API-Key": api_key, "tenant": TENANT},
json={
"name": "Acme Corp",
"business_name": "Acme Corporation S.A.",
"tax_id": "214100001019",
"email": "contact@acme.com",
"phone": "+59821234567",
"street": "Av. Rivera",
"door_number": "1234",
"country_id": "1",
"department_id": "10",
"client_id": "982710394857200005",
"start_date": "2026-01-15",
},
)
result = response.json()
print(f"Created account: {result['data']['id']}")
Example Response
{
"success": true,
"data": {
"id": "982710394857201664"
}
}
Update Account
Update an existing account. Only included fields are modified; omitted fields remain unchanged. Send null to clear a nullable field.
See Partial Updates for the general pattern.
PUT
/apidev/v1/accounts/{id}PermissionAPICLI_ACCOUNTS_WRITE
Rate Limit10 req/min
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Account unique identifier. |
Request Body
All fields from Create Account are accepted (none required). Additionally supports:
products array — Manage product associations:
| Action | Required Fields | Description |
|---|---|---|
add | provider_id, product_type_id | Add a new product. Optional: coverage_id, start_date, end_date, status. |
update | product_id + fields to change | Update existing product. |
remove | product_id | Remove a product. |
dynamic_fields array — Set or clear custom fields:
| Field | Type | Required | Description |
|---|---|---|---|
field_id | string | Yes | Dynamic field identifier. |
name | string | No | Field name. |
type | string | No | Field type. |
order | number | No | Display order. |
value | any | No | New value (or null to clear). |
Code Examples
- cURL
- JavaScript
- Python
curl -s -X PUT "https://$TENANT/apidev/v1/accounts/982710394857201664" \
-H "Authorization: Bearer $TOKEN" \
-H "X-API-Key: $APIKEY" \
-H "tenant: $TENANT" \
-H "Content-Type: application/json" \
-d '{
"email": "new-contact@acme.com",
"notes": "Upgraded to premium tier",
"products": [
{
"action": "add",
"provider_id": "982710394857200030",
"product_type_id": "8",
"coverage_id": "12",
"start_date": "2026-04-01",
"status": "A"
},
{
"action": "remove",
"product_id": "982710394857201700"
}
],
"dynamic_fields": [
{ "field_id": "10", "value": "Premium" },
{ "field_id": "11", "value": null }
]
}'
const res = await fetch(
`https://${TENANT}/apidev/v1/accounts/982710394857201664`,
{
method: 'PUT',
headers: {
'Authorization': `Bearer ${token}`,
'X-API-Key': apiKey,
'tenant': TENANT,
'Content-Type': 'application/json',
},
body: JSON.stringify({
email: 'new-contact@acme.com',
notes: 'Upgraded to premium tier',
products: [
{ action: 'add', provider_id: '982710394857200030', product_type_id: '8', coverage_id: '12', start_date: '2026-04-01', status: 'A' },
{ action: 'remove', product_id: '982710394857201700' },
],
dynamic_fields: [
{ field_id: '10', value: 'Premium' },
{ field_id: '11', value: null },
],
}),
}
);
const { data } = await res.json();
console.log(`Updated fields: ${data.updated_fields.join(', ')}`);
import requests
response = requests.put(
f"https://{TENANT}/apidev/v1/accounts/982710394857201664",
headers={"Authorization": f"Bearer {token}", "X-API-Key": api_key, "tenant": TENANT},
json={
"email": "new-contact@acme.com",
"notes": "Upgraded to premium tier",
"products": [
{"action": "add", "provider_id": "982710394857200030", "product_type_id": "8", "coverage_id": "12", "start_date": "2026-04-01", "status": "A"},
{"action": "remove", "product_id": "982710394857201700"},
],
"dynamic_fields": [
{"field_id": "10", "value": "Premium"},
{"field_id": "11", "value": None},
],
},
)
result = response.json()
print(f"Updated: {result['data']['updated_fields']}")
Example Response
{
"success": true,
"data": {
"id": "982710394857201664",
"updated_fields": ["email", "notes", "products", "dynamic_fields"]
},
"meta": {}
}
Errors
| Code | HTTP | Description |
|---|---|---|
BAD_REQUEST | 400 | Missing required headers. |
VALIDATION_ERROR | 400 | Invalid parameters. |
UNAUTHORIZED | 401 | Invalid or expired JWT / API Key. |
FORBIDDEN | 403 | User lacks required permission. |
NOT_FOUND | 404 | Resource not found (update endpoint). |
RATE_LIMITED | 429 | Exceeded 10 req/min. |
INTERNAL_ERROR | 500 | Unexpected server error. |