Create contact
Add a client, a supplier or both to Contactos.
POST https://cotlet.dev/api/v1/alegra/contacts
write Confirm
Creates a contact the way + Nuevo Contacto does and returns its contact_id. It sends nothing to the person. Call list_contacts first: Alegra does not stop two contacts with the same name, and a duplicate has to be deleted by hand in Contactos. By default you confirm each call; you can switch that off for this tool.
Parameters
| Name | Type | Description |
|---|---|---|
| name string required | string | Full name or company name. |
| identification string | string | Tax or identification number. |
| kind enum | enum | client, supplier or both. Default: client. |
| email string | string | Address invoices are emailed to. |
| mobile string | string | Mobile number. |
| city string | string | City. |
| address string | string | Street address. |
Request
curl -X POST https://cotlet.dev/api/v1/alegra/contacts \
-H "Authorization: Bearer $COTLET_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"Jane Doe"}' result = client.call("alegra", "create_contact", {"name":"Jane Doe"}) const result = await cotlet.call('alegra', 'create_contact', {"name":"Jane Doe"}); cotlet call alegra create_contact --data '{"name":"Jane Doe"}' Example response
{
"contact_id": "41",
"name": "Harbor Cafe",
"identification": "900765432",
"kind": "client",
"email": "billing@harborcafe.example",
"created": true
}