Anchor to section titled 'undefined'

companyContactAssignRole
mutation

Requires write_customers access scope or write_companies access scope. Also: The API client must be installed on a Shopify Plus store.

Assigns a role to a contact for a location.


Anchor to companyContactId
companyContactId
required

The ID of the contact to assign a role to.

Anchor to companyContactRoleId
companyContactRoleId
required

The ID of the role to assign to a contact.

Anchor to companyLocationId
companyLocationId
required

The ID of the location to assign a role to a contact.


Was this section helpful?

The company contact role assignment.

The list of errors that occurred from executing the mutation.


Was this section helpful?
Hide code
Mutation reference
Copy
mutation companyContactAssignRole($companyContactId: ID!, $companyContactRoleId: ID!, $companyLocationId: ID!) {
  companyContactAssignRole(companyContactId: $companyContactId, companyContactRoleId: $companyContactRoleId, companyLocationId: $companyLocationId) {
    companyContactRoleAssignment {
      # CompanyContactRoleAssignment fields
    }
    userErrors {
      field
      message
    }
  }
}
Hide code
Input
Copy
{
  "companyContactId": "gid://shopify/<objectName>/10079785100",
  "companyContactRoleId": "gid://shopify/<objectName>/10079785100",
  "companyLocationId": "gid://shopify/<objectName>/10079785100"
}