---
updatedAt: 2026-09-04T14:29:12.000Z
---

# Create contacts

To create new contacts in your audience,  use the `createContacts` mutation.

You must submit at least one **addressable attribute** for each new contact (email or phone number).

* For the emails, you need a contact attribute identified as the `EMAIL` channel.
* For the phone numbers, you need a contact attribute identified as the `SMS` channel.

We recommend additionally identifying contacts using contact keys (unique IDs). A contact key can be assigned only once. If you submit a key that already exists in the audience, the mutation returns an error for that contact instead of updating it.

```graphql Mutation
mutation createMultipleContacts {
  createContacts(
    contactsInput: [
      { attributes: [
          { name: "First Name", value: "Frank" }
          { name: "Email Address", value: "frank@example.com" }
      ] }
    ]
  ) {
    items {
      contactKey
      message
      identifyingField {
        value
      }
    }
  }
}
```

```graphql Mutation
mutation createMultipleContacts {
  createContacts(
    contactsInput: [
      {
        attributes: [
          { name: "First Name", value: "Frank" }
          { name: "Contact key", value: "TAO_93216421" }
          { name: "Email Address", value: "frank@example.com" }
          { name: "Existing Customer", value: true }
        ]
      }
      {
        attributes: [
          { name: "First Name", value: "Taio" }
          { name: "Contact key", value: "MAW_93676421" }
          { name: "Phone Number", value: "+5845047557000" }
          { name: "Email Address", value: "taio@example.com" }
        ]
      }
      {
        attributes: [
          { name: "First Name", value: "Anna" }
          { name: "Contact key", value: "MAW_93216476" }
          { name: "Email Address", value: "anna@example.com" }
          { name: "Existing Customer", value: false }
        ]
      }
    ]
  ) {
    items {
      contactKey
      message
      identifyingField {
        value
      }
    }
  }
}
```
```json Response
{
  "data": {
    "createContacts": {
      "items": [
        {
          "contactKey": "TAO_93216421",
          "message": "Contact was created.",
          "identifyingField": {
            "value": "frank@example.com"
          }
        },
        {
          "contactKey": "MAW_93676421",
          "message": "Contact was created.",
          "identifyingField": {
            "value": "taio@example.com"
          }
        },
        {
          "contactKey": "MAW_93216476",
          "message": "Contact was created.",
          "identifyingField": {
            "value": "anna@example.com"
          }
        }
      ]
    }
  }
}
```

# Running the mutation

If you haven't used our API before, see [Using the Connect API](https://developer.goacoustic.com/acoustic-connect/reference/base-url) for instructions. It explains how to authenticate your calls and suggests some tools for testing.

# Mutation structure

## Arguments

The `createContacts` mutation contains the `contactsInput` argument at the top level. It's an array of objects. Each contact requires its own object.

Here are the input fields supported by objects within the `contactsInput` array.

<Table align={["left","left","left","left","left"]}>
  <thead>
    <tr>
      <th>
        Field
      </th>

      <th>
        Nested field
      </th>

      <th>
        Values
      </th>

      <th>
        Required?
      </th>

      <th>
        Definition
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `attributes`
      </td>

      <td>
        `name`
      </td>

      <td>
        String (case-sensitive)
      </td>

      <td>
        Required
      </td>

      <td>
        The name of the attribute to populate for the contact.

        :warning: Check the names of available attributes using the **Get all attributes** query.
      </td>
    </tr>

    <tr>
      <td>

      </td>

      <td>
        `value`
      </td>

      <td>
        Depends on the type of attribute
      </td>

      <td>
        Optional
      </td>

      <td>
        The value of the contact attribute
      </td>
    </tr>

    <tr>
      <td>
        `consent`
      </td>

      <td>

      </td>

      <td>
        Array
      </td>

      <td>
        Optional
      </td>

      <td>
        To create contacts with consent statuses, see [Create a contact with consent](https://developer.goacoustic.com/acoustic-connect/reference/create-a-contact-with-consent).
      </td>
    </tr>
  </tbody>
</Table>

| Parameter       | GraphQL type             | Description                                       |
| :-------------- | :----------------------- | :------------------------------------------------ |
| `value`         | `JSON`                   | Accepts string, number, boolean, array, or object |
| `contactsInput` | `[ContactCreateInput!]!` | One entry per contact to create                   |
| `consent`       | `ConsentInput`           | Optional consent preferences for this contact     |

<Callout icon="📘" theme="info">
  ### The JSON scalar

  The `value` field accepts any JSON value — string, number, boolean, array, or object. Declare variables as `JSON!`, not `String!`:
</Callout>

```graphql
query FindContact($emailValue: JSON!) {
  contacts(filter: [{ field: "Email Address", eq: $emailValue }]) {
    items { contactKey }
  }
}
```

Declaring `String!` causes the error: *Variable "$emailValue" of type "String!" used in position expecting type "JSON".* The value itself does not change — a JSON string is already valid JSON.

## Fields

Fields returned by the `createContacts` mutation

<Table align={["left","left","left","left"]}>
  <thead>
    <tr>
      <th>
        Field
      </th>

      <th>
        Nested field
      </th>

      <th>
        Required?
      </th>

      <th>
        Definition
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `items`
      </td>

      <td>
        `contactKey`
      </td>

      <td>
        Required
      </td>

      <td>
        The list of contact keys identifying the new contacts.

        :warning: If you don't provide a key for a contact, the mutation will return the `null` value for this contact.
      </td>
    </tr>

    <tr>
      <td>

      </td>

      <td>
        `message`
      </td>

      <td>
        Required
      </td>

      <td>
        The outcome for this contact. Returns `Contact was created.` for a new contact, or `Contact was updated.` when a matching contact already existed.
      </td>
    </tr>

    <tr>
      <td>

      </td>

      <td>
        `identifyingField`
      </td>

      <td>
        Required
      </td>

      <td>
        The addressable attribute used to identify this contact. Contains `value`, the attribute value, and `attributeData`, the attribute definition.
      </td>
    </tr>
  </tbody>
</Table>

# Possible error messages

This operation can return several error codes. For the full list, with definitions and the operations each code applies to, see <Anchor target="_blank" href="https://developer.goacoustic.com/acoustic-connect/reference/error-codes">Error codes</Anchor>.