Why do metaobjects/create require filters?

I’m trying to subscribe to metaobjects/create using the config file like below.

[[webhooks.subscriptions]]
topics = [ “metaobjects/create”, “metaobjects/delete”, “metaobjects/update” ]
uri = “arn:aws:events:us-east-1::event-source/aws.partner/shopify.com/-/
filter = “id:*”

However, I get the error “Version can not be created. The webhook topic (metaobjects/create) requires a valid filter.”

Providing no filter, a blank filter, and other filters all fail.

Providing a filter for published metaobjects also fail.

filter = “capabilities.publishable.status:active”

Any clues how I can subscribe to metaobjects and their localizations?

@keiraarts the metaobject topics historically used subtopics which were migrated to filters. To subscribe to a metaobjects topic you will need to provide a filter in the format type:your_metaboject_type. This is required as we validate that you have permission to subscribe to the metaobject type.

Hey Dave!

I spent more time digging into this issue.

I could not subscribe to a webhook topic to a metaobject BEFORE the metaobject was created. This caused a lot of errors on shopify.app.toml because I was trying to subscribe to a webhook topic for my merchants before all of them had the same metaobject definition created.

Changed my order of operations worked: I registered the metaobjects across all merchants, then subscribed to the webhook topic, and it worked!

1 Like

Hey @Dave-Shopify!

With no changes, I’m now getting the error "“Access denied based on webhook subscription topic” even though I full access scopes to read_metaobjects in my scopes.

Updated metaobject: {
userErrors: ,
webhookSubscription: {
id: “gid://shopify/WebhookSubscription/",
topic: “METAOBJECTS_UPDATE”,
endpoint: {
arn: "arn:aws:events:us-east-1::event-source/aws.partner/shopify.com/

}
}
}
webhookWithErrors {
isRequired: false,
topic: “TRANSLATABLE_CONTENT_UPDATE”,
input: {
includeFields: ,
filter: “”
},
httpsAddress: “****”,
minimumApiVersion: “unstable”
}
Failed to update metaobject: [
{
field: [ “webhookSubscription” ],
message: “Access denied based on webhook subscription topic”
}
]

Am I now allowed to subscribe to unstable webhooks?

Your error message references the topic TRANSLATABLE_CONTENT_UPDATE. You need the read_translations access scope to subscribe to this topic.