Add a field to a list
POST
/api/v1/lists/{uid}/add-field
Parameters
uid
string
required
path
The list's uid.
Request body application/x-www-form-urlencoded
type
string
required
One of:
text, number, datetime.
label
string
required
tag
string
required
Letters, digits, dashes and underscores. The name of the field in subscriber requests.
default_value
string
Responses
200
The field was added.
401
The token is missing or wrong (
Unauthenticated.), or its user may not act on
this object (Unauthorized). Without the Accept: application/json header, a
missing or wrong token answers with a redirect to the sign-in page instead.
403
A field is missing or wrong (each field that failed, with its messages), the tag is
taken (
{"status": 0, "message": …}), or the token's user may not change the list.
404
No list has this uid.
Add a field to a list
1
2
3
4
5
6
7
curl -X POST 'https://your-domain/api/v1/lists/6adaabbf98847/add-field' \
-H "Accept: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
--data-urlencode 'type=text' \
--data-urlencode 'label=Company' \
--data-urlencode 'tag=COMPANY' \
--data-urlencode 'default_value='
1
2
3
4
5
6
$client = new Acelle\Client('https://your-domain/api/v1', 'YOUR_API_TOKEN');
$client->list()->addCustomField('6adaabbf98847', [
'type' => 'text',
'label' => 'Company',
'tag' => 'COMPANY',
]);
Response
{
"status": 1,
"message": "List's field was created",
"field": {
"uid": "6adaabc2e15a9",
"type": "text",
"tag": "COMPANY",
"label": "Company",
"default_value": null,
"required": false,
"visible": true
}
}