Anchor to section titled 'undefined'

companyContactAssignRoles
mutation

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

Assigns roles on a company contact.


Anchor to companyContactId
companyContactId
required

The contact whose roles are being assigned.

The new roles to assign.


Was this section helpful?

A list of newly created assignments of company contacts to a company location.

The list of errors that occurred from executing the mutation.


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