How do I manage resources with the Amelia API
Use the resources endpoints to create and manage bookable resources, define quantities, control visibility, set sharing rules, and link resources to services or locations.
You can review all endpoints and examples in the Amelia API Postman collection.
How do I add a resource with the Amelia API?
Use this endpoint to create a new resource, set its quantity, and optionally link it to services or locations for availability calculations.
- Method: POST
- Path:
/resources
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
- name (
string); resource name for internal usage - quantity (
integer); resource quantity
Other properties
- shared (
string); shared type, possible values:service,location,null - status (
string); possible values:visible,hidden, defaultvisible - entities (
array); entities tied to the resource, all entities by default - countAdditionalPeople (
boolean); whether the resource is counted per person or per appointment
Example
Request
curl --location 'https://example-site.com/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/resources' \
--header 'Content-Type: application/json' \
--header 'Amelia: YOUR_API_KEY' \
--data '{
"name": "Massage room",
"quantity": 2,
"shared": null,
"status": "visible",
"entities": [
{
"entityId": 1,
"entityType": "service"
}
]
}'
Response
{
"message": "Successfully added new resource.",
"data": {
"resource": {
"id": 7,
"name": "Massage room",
"quantity": 2,
"shared": false,
"status": "visible",
"entities": [
{
"entityId": 1,
"entityType": "service"
}
],
"countAdditionalPeople": null
}
}
}
How do I update a resource with the Amelia API?
Use this endpoint to update resource details by sending only the properties you want to change.
- Method: POST
- Path:
/resources/{{resource_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
- name (
string); resource name for internal usage - quantity (
integer); resource quantity - shared (
string); shared type, possible values:service,location,null - status (
string); possible values:visible,hidden, defaultvisible - entities (
array); entities tied to the resource - countAdditionalPeople (
boolean); counted per person or per appointment
Example
Request
curl --location 'https://example-site.com/wp-admin/admin-ajax.php?action=wpamelia_api&call=/api/v1/resources/6' \
--header 'Content-Type: application/json' \
--header 'Amelia: YOUR_API_KEY' \
--data '{
"name": "Massage room large",
"quantity": 3,
"shared": null,
"status": "visible",
"entities": [
{
"entityId": 2,
"entityType": "service"
}
]
}'
Response
{
"message": "Successfully updated resource.",
"data": {
"resource": {
"id": 6,
"name": "Massage room large",
"quantity": 3,
"shared": false,
"status": "visible",
"entities": [
{
"entityId": 2,
"entityType": "service"
}
],
"countAdditionalPeople": null
}
}
}
How do I retrieve resources with the Amelia API?
Use this endpoint to retrieve a list of resources and the entities they are linked to.
- Method: GET
- Path:
/resources
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/resources' \
--header 'Amelia: YOUR_API_KEY'
Response
{
"message": "Successfully retrieved resources.",
"data": {
"resources": [
{
"id": 4,
"name": "Treatment bed",
"quantity": 1,
"shared": "location",
"status": "hidden",
"entities": {
"14": {
"id": 14,
"resourceId": 4,
"entityId": 1,
"entityType": "service"
}
},
"countAdditionalPeople": null
},
{
"id": 6,
"name": "Massage room large",
"quantity": 3,
"shared": false,
"status": "visible",
"entities": {
"25": {
"id": 25,
"resourceId": 6,
"entityId": 2,
"entityType": "service"
}
},
"countAdditionalPeople": null
}
]
}
}
How do I delete a resource with the Amelia API?
Use this endpoint to delete a resource.
- Method: POST
- Path:
/resources/delete/{{resource_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/resources/delete/6' \
--header 'Amelia: YOUR_API_KEY'
Response
{
"message": "Successfully deleted resource.",
"data": []
}