Reassign Metafields Owner

Metafields can be reassigned to a new owner by updating the ownerClientId field using the Reassign Metafield Owner GraphQL mutation.

While the v3 REST API supports creating, updating, and deleting metafields, to reassign a metafield’s owner you must use the GraphQL API.

The client ID is displayed only once when you create a store-level API account. If it’s lost or forgotten, you’ll need to create a new store-level API account. See the API Accounts Documentation for details.

Ensure the metafield id uses the correct format: bc/store/metafield/{id}

GraphQL Mutation

Example mutation: Reassign Metafields Owner
1POST https://api.bigcommerce.com/stores/{{STORE_HASH}}/graphql
2X-Auth-Token: {{ACCESS_TOKEN}}
3Content-Type: application/json
4Accept: application/json
5
6mutation Metafield($input: ReassignMetafieldsOwnerInput!) {
7 metafield {
8 reassignMetafieldsOwner(input: $input) {
9 metafieldIds
10 }
11 }
12}
GraphQL variables
1{
2 "input": {
3 "newClientId": "xyz1234",
4 "metafieldIds": ["bc/store/metafield/8"]
5 }
6}