Create a contact field
using System.Net.Http.Headers;var client = new HttpClient();var request = new HttpRequestMessage{ Method = HttpMethod.Post, RequestUri = new Uri("https://api.azimea.com/v1/contact-attributes"), Headers = { { "Authorization", "Bearer <token>" }, }, Content = new StringContent("{ \"key\": \"plan\", \"label\": \"Plan\", \"type\": \"Text\", \"description\": \"The subscription plan the person is on.\" }") { Headers = { ContentType = new MediaTypeHeaderValue("application/json") } }};using (var response = await client.SendAsync(request)){ response.EnsureSuccessStatusCode(); var body = await response.Content.ReadAsStringAsync(); Console.WriteLine(body);}const url = 'https://api.azimea.com/v1/contact-attributes';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"key":"plan","label":"Plan","type":"Text","description":"The subscription plan the person is on."}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.azimea.com/v1/contact-attributes \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "key": "plan", "label": "Plan", "type": "Text", "description": "The subscription plan the person is on." }'Defines a custom attribute before any contact carries it, so its type is fixed: a value is then stored as that type everywhere, and a rule like greater than 5000 means one thing in every segment. The key is lowercase letters, digits and underscores, starting with a letter, up to 40 characters (audience.attribute_key_invalid); a built-in field’s name is refused (audience.attribute_reserved), an existing key gives 409 audience.attribute_exists, and a company has at most 100 fields (audience.attribute_limit_reached). The label defaults to the key made readable. Needs contacts:write.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
Required. Lowercase letters, digits and _, starting with a letter, at most 40 characters. A built-in field’s name is refused, and so is a key that already exists.
Example
planThe name shown in the dashboard. Made from the key when left out.
Example
PlanRequired. How values are stored and compared. It cannot be changed afterwards.
Example
TextA note for your team about what the field holds.
Example
The subscription plan the person is on.Example
{ "key": "plan", "label": "Plan", "type": "Text", "description": "The subscription plan the person is on."}Responses
Section titled “Responses”The field as defined
object
true when the call worked, false when errors say why it did not.
The answer itself; null when the call failed.
object
The field’s key: lowercase letters, digits and _, starting with a letter, at most 40 characters. It never changes.
The name shown in the dashboard.
How values are stored and compared in segments. Fixed once the field exists.
A note for your team about what the field holds; null when none was written.
Where the field was made: the dashboard (Ui), the API (Api) or a file import (Csv).
When the field was created.
When the field was archived; null while it is active. An archived field is hidden from pickers and keeps every stored value.
An internal result number. Rely on the HTTP status code instead.
What went wrong, one entry per problem; empty when the call worked.
object
A stable code such as audience.contact_not_found. Branch on this, never on message. Every code is listed in the error codes catalog.
An English sentence for your logs. Do not show it to end users: it can change.
The numbers the message mentions (a minimum, a maximum), when there are any.
object
The same problems grouped by the request field they belong to; null when none is tied to a field.
object
object
A stable code such as audience.contact_not_found. Branch on this, never on message. Every code is listed in the error codes catalog.
An English sentence for your logs. Do not show it to end users: it can change.
The numbers the message mentions (a minimum, a maximum), when there are any.
object
Example
{ "isSuccess": true, "value": { "key": "plan", "label": "Plan", "type": "Text", "description": "The subscription plan the person is on.", "createdFrom": "Api", "createdAt": "2026-10-05T09:30:00+00:00", "archivedAt": null }, "status": 0, "errors": [], "fieldErrors": null}Validation failed: see errors[].code and fieldErrors
object
true when the call worked, false when errors say why it did not.
The answer itself; null when the call failed.
An internal result number. Rely on the HTTP status code instead.
What went wrong, one entry per problem; empty when the call worked.
object
A stable code such as audience.contact_not_found. Branch on this, never on message. Every code is listed in the error codes catalog.
An English sentence for your logs. Do not show it to end users: it can change.
The numbers the message mentions (a minimum, a maximum), when there are any.
object
The same problems grouped by the request field they belong to; null when none is tied to a field.
object
object
A stable code such as audience.contact_not_found. Branch on this, never on message. Every code is listed in the error codes catalog.
An English sentence for your logs. Do not show it to end users: it can change.
The numbers the message mentions (a minimum, a maximum), when there are any.
object
Example
{ "isSuccess": false, "value": null, "status": 5, "errors": [ { "code": "validation.required", "message": "Fill in this field.", "params": null } ], "fieldErrors": { "email": [ { "code": "validation.required", "message": "Fill in this field.", "params": null } ] }}Missing or invalid API key
The key lacks the contacts:write permission
Too many requests for this key