Skip to content

Endpoints

API functions are currently rate-limited to 1 call every 2 seconds. If you exceed this, the function will return HTTP 429 (Too Many Requests).

To upload one or more media file(s) for a custom field to ACF media storage:

POST https://app.accentuate.io/api/{api_key}/media
{
"media": {
"scope": "product|variant|custom_collection|smart_collection|page|blog|article|order|customer|shop",
"scope_id": 1234567890,
"metafield": "accentuate.main_image",
"src": [
"http://example.com/some_image.jpg",
"http://example.com/some_other_image.jpg"
]
}
}

The list of src URLs needs to be full HTTP/HTTPS URLs and publicly available.

HTTP 200 is returned with this payload for a valid request:

{
"media": {
"src": [
{ "url": "http://example.com/some_image.jpg", "status": "uploaded" },
{ "url": "http://example.com/some_other_image.jpg", "status": "failed", "message": "404 not found" }
],
"url": [
"https://cdn.accentuate.io/12345678/12345678/some_image-v12345678.jpg",
""
]
}
}

The response contains an array of src elements with a status for each source URL. The status is either “uploaded” or “failed”. If an upload fails, the corresponding URL element will be an empty string.

For custom fields defined as the new “Media v2” type, the return value in URL is a JSON structure with this media type’s properties filled out. Please use this structure in its entirety when updating or creating the Metafield referencing the media. See related articles below on how Media v2 fields are structured.

To delete all media(s) for a given Metafield, use the POST method with an empty src array:

POST https://app.accentuate.io/api/{api_key}/media
{
"media": {
"scope": "product|variant|custom_collection|smart_collection|page|blog|article|order|customer|shop",
"scope_id": 1234567890,
"metafield": "accentuate.main_image",
"src": []
}
}

HTTP 200 is returned with this payload for a valid request:

{
"media": {
"src": [],
"url": []
}
}

If you have any custom fields defined with “Automatic tagging” enabled and have updated the underlying Metafield values outside of ACF, you can trigger the tagging logic by using this endpoint and have ACF align the tags with the new value.

POST https://app.accentuate.io/api/{api_key}/autotag
{
"scope": "product|variant|article|order|customer",
"scope_id": 1234567890,
"metafield": "accentuate.condition"
}

The Metafield property is optional and if omitted, the tagging logic will be triggered for all the fields for the scope, that is enabled for automatic tagging.

HTTP 200 is returned for a valid request together with the following data, showing which field(s) were considered for tagging together with the final set of tags for the object in question (here a tag of “Condition|New” was added):

{
"scope": "product",
"scope_id": 5287477383,
"metafields": [
"accentuate.condition"
],
"tags": [
"Condition|New",
"Accessories",
"Essential",
"Tools and Maintenance"
]
}

If you have any custom fields of type “Selection” and need to update the predefined selection values after the fact, you can use this endpoint to do exactly that.

PUT https://app.accentuate.io/api/{api_key}/select/values
{
"scope": "product|variant|collection|page|blog|article|order|customer|shop",
"metafield": "accentuate.selection_field",
"values": ["option1", "option2", "..."]
}

The value property can be either an array or a pipe-separated string of all the individual values needed for the selection field.

HTTP 200 is returned for a valid request, otherwise, a 4xx or 5xx error is returned.

ACF internally works with a server-side cache to speed up operations when reading both Metafields and various Shopify objects.

This means that when you update your Metafields via Shopify’s API, ACF won’t see it right away and you risk overwriting your newly changed Metafields’ content if someone is working in the ACF editor with a stale cache.

To fix that, you need to tell ACF to refresh its internal cache following any updates you have performed:

DELETE https://app.accentuate.io/api/{api_key}/cache

HTTP 200 is returned for a valid request, otherwise, a 4xx or 5xx error is returned.