---
title: "companyAssignCustomerAsContact"
description: "Specify users become company contacts"
doc_type: graphql
doc_category: adminGraphQL
doc_version: v20270301
source_url:
  html: 'https://developer.shopline.com/docs/admin-graph-ql-api/customers/mutations/company-assign-customer-as-contact'
  md: 'https://developer.shopline.com/docs/admin-graph-ql-api/customers/mutations/company-assign-customer-as-contact.md'
---
# companyAssignCustomerAsContact

Specify users become company contacts

- **Required Scopes:** `write_customers`
- **API Version:** v20270301
- **API Type:** Admin
- **API Protocol:** GraphQL
- **Operation Type:** Mutation

## Required Permissions

* `write_customers`

An access token is required to call this API. Refer to [Authorization](https://developer.shopline.com/docs/apps/api-instructions-for-use/graph-ql-admin-api/overview.md) for more information about how to obtain the token.

## Arguments

* `companyId`

  [ID!](https://developer.shopline.com/docs/admin-graph-ql-api/common/scalars/id.md)

  Company id

* `customerId`

  [ID!](https://developer.shopline.com/docs/admin-graph-ql-api/common/scalars/id.md)

  Customer id

## Returns

* `userErrors`

  [[BusinessCustomerUserError!]!](https://developer.shopline.com/docs/admin-graph-ql-api/customers/objects/business-customer-user-error.md)

  Error message

* `companyContact`

  [CompanyContact](https://developer.shopline.com/docs/admin-graph-ql-api/b-2-b/objects/company-contact.md)

  Company contact

## Examples

### Assign users as company contact

Specify an existing user as the company contact person.

**Request:**

```json
{
  "companyId": "gid://shopline/Company/6254924101557166237",
  "customerId": "gid://shopline/Customer/4217281771"
}

```

**Response:**

```json
{
  "data": {
    "data": {
      "companyAssignCustomerAsContact": {
        "companyContact": {
          "company": {
            "id": "gid://shopline/Company/6254924101557166237",
            "name": "test2"
          },
          "createdAt": "2023-11-07T10:13:38.117Z",
          "customer": {
            "addresses": [],
            "email": "********@example.com",
            "firstName": "S*****",
            "id": "gid://shopline/Customer/4217281771",
            "lastName": "T*****",
            "phone": null
          },
          "id": "gid://shopline/CompanyContact/4217281771",
          "isMainContact": false,
          "updatedAt": "2023-11-07T10:13:38.610Z"
        },
        "userErrors": []
      }
    }
  }
}
```

## Error Handling

For detailed information about common codes, see [Status and error codes](https://developer.shopline.com/docs/apps/api-instructions-for-use/graph-ql-admin-api/overview.md#status-and-error-codes).

