--- title: Changes to metafield definition error codes - Shopify developer changelog description: >- Shopify’s developer changelog documents all changes to Shopify’s platform. Find the latest news and learn about new platform opportunities. source_url: html: 'https://shopify.dev/changelog/changes-to-metafield-definition-error-codes' md: 'https://shopify.dev/changelog/changes-to-metafield-definition-error-codes.md' metadata: effectiveApiVersion: 2022-04 affectedApi: [] primaryTag: displayName: API handle: api secondaryTag: displayName: Update handle: update indicatesActionRequired: false createdAt: '2022-03-18T12:28:49-04:00' postedAt: '2022-03-21T00:00:00-04:00' updatedAt: '2024-12-13T17:24:33-05:00' effectiveAt: '2022-03-21T00:00:00-04:00' --- March 21, 2022 Tags: * API * 2022-04 # Changes to metafield definition error codes As of GraphQL Admin API version 2022-04, an error returns when a metafield definition is created with invalid characters in either the `key` or the `namespace` fields. The `key` and `namespace` fields can contain only alphanumeric characters, hyphens, and underscores. [Learn more about the `MetafieldDefinition` object](https://shopify.dev/api/admin-graphql/current/objects/MetafieldDefinition).