---
title: UserError - Shop Partners API
description: Represents an error in the input of a mutation.
api_version: unstable latest
source_url:
  html: https://shopify.dev/docs/api/shop-partners/latest/objects/UserError
  md: https://shopify.dev/docs/api/shop-partners/latest/objects/UserError.md
---

# User​Error

object

Represents an error in the input of a mutation.

## Fields

* field

  [\[String!\]!](https://shopify.dev/docs/api/shop-partners/latest/scalars/String)

  non-null

  Path to input field which caused the error.

* message

  [String!](https://shopify.dev/docs/api/shop-partners/latest/scalars/String)

  non-null

  The error message.

***

## Map

No referencing types

***

## Mutations

* [fetch​Custom​Data​Token​For​User](https://shopify.dev/docs/api/shop-partners/latest/mutations/fetchCustomDataTokenForUser)

  mutation

  Fetch an OAuth Access and Refresh Token pair for the Shop Users API to read or write metafields after user's presence interaction ends.

  If a user has used Sign in with Shop with your App client, you may retreive tokens to read / write your own metafields on a user.

  * email

    [String!](https://shopify.dev/docs/api/shop-partners/latest/scalars/String)

    required

    ### Arguments

    The email of the buyer for whom you need an Access token.

  * through

    [String](https://shopify.dev/docs/api/shop-partners/latest/scalars/String)

    Private to Shopify Internal clients. Allows a storefront to be passed in by its myshopify domain.

  ***

* [media​Create](https://shopify.dev/docs/api/shop-partners/latest/mutations/mediaCreate)

  mutation

  Create a new shop video with related products.

  * input

    [Media​Create​Input!](https://shopify.dev/docs/api/shop-partners/latest/input-objects/MediaCreateInput)

    required

    ### Arguments

  ***

* [media​Delete](https://shopify.dev/docs/api/shop-partners/latest/mutations/mediaDelete)

  mutation

  Delete a shop video (soft delete).

  * id

    [ID!](https://shopify.dev/docs/api/shop-partners/latest/scalars/ID)

    required

    ### Arguments

    The video ID in GID format (e.g., gid://shopapp/ShopVideo/ea9088eb-9a19-45b8-9d2c-5ca2b8ae13d1).

  ***

* [media​Update](https://shopify.dev/docs/api/shop-partners/latest/mutations/mediaUpdate)

  mutation

  Update an existing shop video.

  * input

    [Media​Update​Input!](https://shopify.dev/docs/api/shop-partners/latest/input-objects/MediaUpdateInput)

    required

    ### Arguments

  ***

* [metafield​Access​Grant](https://shopify.dev/docs/api/shop-partners/latest/mutations/metafieldAccessGrant)

  mutation

  Share a Metafield Primitive with a Client or Namespace. Requires the 'share\_metafield' client scope and requires that the Client making the request has Admin permission on the Resource.

  * access

    [Custom​Data​Access​Input!](https://shopify.dev/docs/api/shop-partners/latest/input-objects/CustomDataAccessInput)

    required

    ### Arguments

    Update the default permission of the resource and/or provide a list of targets to give access to the resource.

  * identifier

    [Custom​Data​Key​Pair​Input!](https://shopify.dev/docs/api/shop-partners/latest/input-objects/CustomDataKeyPairInput)

    required

    Key and namespace pair that together form the path to the resource. Key is required, Namespace defaults to the Client's implicit, reserved namespace if not provided.

  * key

    [String](https://shopify.dev/docs/api/shop-partners/latest/scalars/String)

    Use 'key' to provide a new key for the target when sharing, if desired. Only changes the key for the newly shared resource within the grantee's reserved namespace, not the grantor's.

  ***

* [metafield​Access​Revoke](https://shopify.dev/docs/api/shop-partners/latest/mutations/metafieldAccessRevoke)

  mutation

  Revoke shared access between a Metafield Primitive and a Client or Namespace for Primitives of which your Client is an Admin.

  * identifier

    [Custom​Data​Key​Pair​Input!](https://shopify.dev/docs/api/shop-partners/latest/input-objects/CustomDataKeyPairInput)

    required

    ### Arguments

    Key and namespace pair that together form the path to the resource. Key is required, Namespace defaults to the Client's implicit, reserved namespace if not provided.

  * targets

    [\[Target​Input!\]!](https://shopify.dev/docs/api/shop-partners/latest/input-objects/TargetInput)

    required

    A list of targets for whom to revoke access from the given resource.

  ***

* [metafield​Definition​Create](https://shopify.dev/docs/api/shop-partners/latest/mutations/metafieldDefinitionCreate)

  mutation

  Create a new MetafieldDefinition.

  * definition

    [Metafield​Definition​Create​Input!](https://shopify.dev/docs/api/shop-partners/latest/input-objects/MetafieldDefinitionCreateInput)

    required

    ### Arguments

  ***

* [metafield​Definition​Delete](https://shopify.dev/docs/api/shop-partners/latest/mutations/metafieldDefinitionDelete)

  mutation

  Remove a MetafieldDefinition and cascade delete all associated Metafields.

  * identifier

    [Custom​Data​Key​Pair​Input!](https://shopify.dev/docs/api/shop-partners/latest/input-objects/CustomDataKeyPairInput)

    required

    ### Arguments

    This argument accepts an object that consists of a `key` and an optional `namespace`. The `key` is a mandatory attribute that represents a specific element within a namespace. The `namespace` attribute, if provided, should be a period-delimited string representing the hierarchical path to the desired definition. This is applicable in cases where the desired definition is nested within namespaces. In the absence of a provided `namespace`, the system will default to the client's implicit, reserved namespace.

  ***

* [metafield​Definition​Update](https://shopify.dev/docs/api/shop-partners/latest/mutations/metafieldDefinitionUpdate)

  mutation

  Update a MetafieldDefinition by changing its key, name, description, capabilities, or access.

  * definition

    [Metafield​Definition​Update​Input!](https://shopify.dev/docs/api/shop-partners/latest/input-objects/MetafieldDefinitionUpdateInput)

    required

    ### Arguments

  ***

* [metafield​Namespace​Create](https://shopify.dev/docs/api/shop-partners/latest/mutations/metafieldNamespaceCreate)

  mutation

  Create a new MetafieldNamespace.

  Every client has their own implicit, reserved namespace; however, Namespaces allow sharing groups of Metafield Primitives and Access Grants together. Creating new Namespaces requires the client to have additional scope and is not available to all clients.

  * namespace

    [Metafield​Namespace​Create​Input!](https://shopify.dev/docs/api/shop-partners/latest/input-objects/MetafieldNamespaceCreateInput)

    required

    ### Arguments

  ***

* [metafield​Namespace​Delete](https://shopify.dev/docs/api/shop-partners/latest/mutations/metafieldNamespaceDelete)

  mutation

  Destroy a Namespace and remove any shared Access. MetafieldDefinitions shared to the Namespace will not be deleted, but their association with the namespace will be removed.

  * identifier

    [Custom​Data​Key​Pair​Input!](https://shopify.dev/docs/api/shop-partners/latest/input-objects/CustomDataKeyPairInput)

    required

    ### Arguments

    This argument accepts an object that consists of a `key` and an optional `namespace`. The `key` is a mandatory attribute that represents a specific element within a namespace. The `namespace` attribute, if provided, should be a period-delimited string representing the hierarchical path to the desired namespace. This is applicable in cases where the desired namespace is nested within other namespaces. In the absence of a provided `namespace`, the system will default to the client's implicit, reserved namespace.

  ***

* [metafield​Namespace​Update](https://shopify.dev/docs/api/shop-partners/latest/mutations/metafieldNamespaceUpdate)

  mutation

  Update a MetafieldNamespace by changing its key, name, description, capabilities, or access.

  * namespace

    [Metafield​Namespace​Update​Input!](https://shopify.dev/docs/api/shop-partners/latest/input-objects/MetafieldNamespaceUpdateInput)

    required

    ### Arguments

  ***

* [standard​Metafield​Definition​Enable](https://shopify.dev/docs/api/shop-partners/latest/mutations/standardMetafieldDefinitionEnable)

  mutation

  TK - Not implemented.

  * key

    [String!](https://shopify.dev/docs/api/shop-partners/latest/scalars/String)

    required

    ### Arguments

  * namespace

    [String!](https://shopify.dev/docs/api/shop-partners/latest/scalars/String)

    required

  ***

***

## UserError Mutations

### Mutated by

* [fetch​Custom​Data​Token​For​User](https://shopify.dev/docs/api/shop-partners/latest/mutations/fetchCustomDataTokenForUser)
* [media​Create](https://shopify.dev/docs/api/shop-partners/latest/mutations/mediaCreate)
* [media​Delete](https://shopify.dev/docs/api/shop-partners/latest/mutations/mediaDelete)
* [media​Update](https://shopify.dev/docs/api/shop-partners/latest/mutations/mediaUpdate)
* [metafield​Access​Grant](https://shopify.dev/docs/api/shop-partners/latest/mutations/metafieldAccessGrant)
* [metafield​Access​Revoke](https://shopify.dev/docs/api/shop-partners/latest/mutations/metafieldAccessRevoke)
* [metafield​Definition​Create](https://shopify.dev/docs/api/shop-partners/latest/mutations/metafieldDefinitionCreate)
* [metafield​Definition​Delete](https://shopify.dev/docs/api/shop-partners/latest/mutations/metafieldDefinitionDelete)
* [metafield​Definition​Update](https://shopify.dev/docs/api/shop-partners/latest/mutations/metafieldDefinitionUpdate)
* [metafield​Namespace​Create](https://shopify.dev/docs/api/shop-partners/latest/mutations/metafieldNamespaceCreate)
* [metafield​Namespace​Delete](https://shopify.dev/docs/api/shop-partners/latest/mutations/metafieldNamespaceDelete)
* [metafield​Namespace​Update](https://shopify.dev/docs/api/shop-partners/latest/mutations/metafieldNamespaceUpdate)
* [standard​Metafield​Definition​Enable](https://shopify.dev/docs/api/shop-partners/latest/mutations/standardMetafieldDefinitionEnable)