How do I manage custom fields with the Amelia API
Use the custom fields endpoints to create and manage additional booking form fields for services and events. You can also control field order, availability, and usage across services and events.
You can review all endpoints and examples in the Amelia API Postman collection.
How do I add a custom field with the Amelia API?
Use this endpoint to create a new custom field and optionally assign it to specific services or events.
- Method: POST
- Path:
/fields
Base path
{{your_site_URL}}/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1
Authorization
- All Amelia endpoints use API key authorization via a request header named Amelia.
Required properties
- type (
string); possible values:text,text-area,select,checkbox,radio,content,file,datepicker,address
Optional properties
- label (
string); field label - options (
array); options forselectandradiotypes - position (
integer); display order, default1 - required (
boolean); mark field as required, defaultfalse - services (
array); service IDs where the field is used - events (
array); event IDs where the field is used - useAsLocation (
boolean); use field as calendar location, available only foraddressfields
Example
Request
curl --location 'https://example-site.com/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/fields' \
--header 'Content-Type: application/json' \
--header 'Amelia: YOUR_API_KEY' \
--data '{
"label": "Select custom field",
"options": [],
"position": 3,
"required": false,
"services": [
{ "id": 1 }
],
"events": [
{ "id": 120 }
],
"type": "select",
"useAsLocation": false
}'
Response
{
"message": "Successfully added new custom field.",
"data": {
"customField": {
"id": 15,
"label": "Select custom field",
"type": "select",
"required": false,
"position": 3,
"options": [],
"allServices": false,
"allEvents": false,
"useAsLocation": false
}
}
}
How do I update a custom field with the Amelia API?
Use this endpoint to update an existing custom field. Send only the properties you want to change.
- Method: POST
- Path:
/fields/{{field_id}}
Base path
{{your_site_URL}}/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1
Authorization
- All Amelia endpoints use API key authorization via a request header named Amelia.
Optional properties
- type (
string); custom field type - label (
string); field label - options (
array); options forselectandradiofields - position (
integer); display order - required (
boolean); mark field as required - services (
array); assigned service IDs - events (
array); assigned event IDs - useAsLocation (
boolean); use as calendar location for address fields - translations (
string); JSON encoded label translations - allServices (
boolean); apply to all services - allEvents (
boolean); apply to all events
Example
Request
curl --location 'https://example-site.com/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/fields/11' \
--header 'Content-Type: application/json' \
--header 'Amelia: YOUR_API_KEY' \
--data '{
"label": "Select custom field",
"type": "select",
"required": false,
"position": 3,
"options": [
{
"label": "Select Option",
"position": 1,
"new": true
}
],
"services": [
{ "id": 1 }
],
"events": [],
"allServices": false,
"allEvents": false,
"useAsLocation": false
}'
Response
{
"message": "Custom field successfully updated.",
"data": {
"customField": {
"id": 11,
"label": "Select custom field",
"type": "select",
"required": false,
"position": 3,
"allServices": false,
"allEvents": false
}
}
}
How do I update custom field positions with the Amelia API?
Use this endpoint to update the display order of custom fields.
- Method: POST
- Path:
/fields/positions
Base path
{{your_site_URL}}/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1
Authorization
- All Amelia endpoints use API key authorization via a request header named Amelia.
Required properties
- customFields (
array); list of field IDs with their new positions
Example
Request
curl --location 'https://example-site.com/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/fields/positions' \
--header 'Content-Type: application/json' \
--header 'Amelia: YOUR_API_KEY' \
--data '{
"customFields": [
{ "id": 1, "position": 1 },
{ "id": 3, "position": 2 },
{ "id": 2, "position": 3 }
]
}'
Response
{
"message": "Successfully updated custom fields positions.",
"data": null
}
How do I retrieve custom fields with the Amelia API?
Use this endpoint to retrieve all custom fields.
- Method: GET
- Path:
/fields
Base path
{{your_site_URL}}/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1
Authorization
- All Amelia endpoints use API key authorization via a request header named Amelia.
Example
Request
curl --location 'https://example-site.com/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/fields' \
--header 'Amelia: YOUR_API_KEY'
Response
{
"message": "Successfully retrieved custom fields.",
"data": {
"customFields": [
{
"id": 1,
"label": "text",
"type": "text",
"required": false,
"position": 1,
"allServices": true,
"allEvents": true
}
]
}
}
How do I delete a custom field with the Amelia API?
Use this endpoint to delete a custom field.
- Method: POST
- Path:
/fields/delete/{{field_id}}
Base path
{{your_site_URL}}/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1
Authorization
- All Amelia endpoints use API key authorization via a request header named Amelia.
Example
Request
curl --location --request POST 'https://example-site.com/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/fields/delete/3' \
--header 'Amelia: YOUR_API_KEY'
Response
{
"message": "Successfully deleted custom field.",
"data": null
}