Limited time discount Book Smarter This Christmas
Up to 50%Off

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.

Info Note
API endpoints are available only in Elite license plans. Using the API requires coding skills and is not covered by standard plugin support.

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 for select and radio types
  • position (integer); display order, default 1
  • required (boolean); mark field as required, default false
  • 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 for address fields

Example

				
					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
}'
				
			
				
					{
  "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 for select and radio fields
  • 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

				
					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
}'

				
			
				
					{
  "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

				
					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 }
  ]
}'
				
			
				
					{
  "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

				
					curl --location 'https://example-site.com/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/fields' \
--header 'Amelia: YOUR_API_KEY'
				
			
				
					{
  "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

				
					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'
				
			
				
					{
  "message": "Successfully deleted custom field.",
  "data": null
}