Create custom contact field
curl --request POST \
--url https://api.withallo.com/v2/api/crm/attributes \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"label": "Lead Source",
"type": "TEXT"
}
'import requests
url = "https://api.withallo.com/v2/api/crm/attributes"
payload = {
"label": "Lead Source",
"type": "TEXT"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({label: 'Lead Source', type: 'TEXT'})
};
fetch('https://api.withallo.com/v2/api/crm/attributes', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.withallo.com/v2/api/crm/attributes",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'label' => 'Lead Source',
'type' => 'TEXT'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.withallo.com/v2/api/crm/attributes"
payload := strings.NewReader("{\n \"label\": \"Lead Source\",\n \"type\": \"TEXT\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.withallo.com/v2/api/crm/attributes")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"label\": \"Lead Source\",\n \"type\": \"TEXT\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.withallo.com/v2/api/crm/attributes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"label\": \"Lead Source\",\n \"type\": \"TEXT\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"key": "lead_source",
"label": "Lead Source",
"type": "TEXT",
"already_existed": false
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"retry_after_seconds": 123
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"retry_after_seconds": 123
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"retry_after_seconds": 123
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"retry_after_seconds": 123
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"retry_after_seconds": 123
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"retry_after_seconds": 123
}
}Custom fields
Create custom field
Creates a custom field on your team’s people. The key is derived from the label. Creating the same label with the same type again returns the existing field with already_existed set to true.
POST
/
v2
/
api
/
crm
/
attributes
Create custom contact field
curl --request POST \
--url https://api.withallo.com/v2/api/crm/attributes \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"label": "Lead Source",
"type": "TEXT"
}
'import requests
url = "https://api.withallo.com/v2/api/crm/attributes"
payload = {
"label": "Lead Source",
"type": "TEXT"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({label: 'Lead Source', type: 'TEXT'})
};
fetch('https://api.withallo.com/v2/api/crm/attributes', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.withallo.com/v2/api/crm/attributes",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'label' => 'Lead Source',
'type' => 'TEXT'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.withallo.com/v2/api/crm/attributes"
payload := strings.NewReader("{\n \"label\": \"Lead Source\",\n \"type\": \"TEXT\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.withallo.com/v2/api/crm/attributes")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"label\": \"Lead Source\",\n \"type\": \"TEXT\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.withallo.com/v2/api/crm/attributes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"label\": \"Lead Source\",\n \"type\": \"TEXT\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"key": "lead_source",
"label": "Lead Source",
"type": "TEXT",
"already_existed": false
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"retry_after_seconds": 123
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"retry_after_seconds": 123
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"retry_after_seconds": 123
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"retry_after_seconds": 123
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"retry_after_seconds": 123
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"retry_after_seconds": 123
}
}Required scope:
CRM_WRITEBody fields
| Field | Type | Required | Description |
|---|---|---|---|
label | string | yes | Display name, 1 to 255 characters, with at least one letter or digit |
type | string | yes | TEXT, NUMBER, DATE or BOOLEAN |
DROPDOWN fields are synced from your CRM integrations and cannot be created here.
Key derivation
Thekey is derived from the label: lowercase, accents removed, runs of non-alphanumeric characters replaced by _, truncated to 64 characters. Lead Source becomes lead_source.
A label that resolves to a built-in field key is rejected with ATTRIBUTE_KEY_RESERVED. The reserved keys are name, phone_numbers, company, job_title, emails, last_activity, website, created_at and updated_at.
Creating the same field twice
The call is safe to repeat. If a field with the same key and type already exists, the endpoint returns201 with already_existed set to true and the label it was first created with. Nothing is created.
{
"data": {
"key": "lead_source",
"label": "Lead Source",
"type": "TEXT",
"already_existed": true
}
}
409 ATTRIBUTE_KEY_CONFLICT.
Limits
A team can hold up to 150TEXT, 50 NUMBER, 30 DATE and 30 BOOLEAN custom fields. Once a type is full, creating another field of that type returns 409 ATTRIBUTE_SLOTS_EXHAUSTED.
Errors
| Status | Code | When |
|---|---|---|
400 | ATTRIBUTE_LABEL_INVALID | label is blank, longer than 255 characters, or has no letter or digit |
400 | ATTRIBUTE_KEY_RESERVED | The label resolves to a built-in field key |
400 | INVALID_REQUEST_BODY | type is missing or is not one of TEXT, NUMBER, DATE, BOOLEAN |
403 | API_KEY_INSUFFICIENT_SCOPE | The key does not hold CRM_WRITE |
404 | TEAM_NOT_FOUND | The workspace is not on the new contact model |
409 | ATTRIBUTE_KEY_CONFLICT | A field with this key already exists with another type |
409 | ATTRIBUTE_SLOTS_EXHAUSTED | No free slot is left for this type |
Authorizations
Body
application/json
Request body for creating a custom contact field
Display name of the field. The key is derived from it: lowercase, accents removed, runs of non-alphanumeric characters replaced by _, truncated to 64 characters. Must contain at least one letter or digit and must not resolve to a built-in field key such as name, company or website.
Required string length:
1 - 255Example:
"Lead Source"
Value type of the field
Available options:
TEXT, NUMBER, DATE, BOOLEAN Example:
"TEXT"
Response
The custom field that was created, or the existing one
Show child attributes
Show child attributes
Was this page helpful?