---
updatedAt: 2026-09-02T13:22:56.000Z
---

# Create contacts with consent statuses

You can specify contacts' consent statuses when adding them to your audience. Use the [Create contacts](https://developer.goacoustic.com/acoustic-connect/reference/add-a-contact) mutation with additional fields.

There are two approaches to registering consent for contacts:

* by adding the contacts to respective **consent groups**
* by subscribing them to **channels**.

These approaches are mutually exclusive. You cannot use both for the same contact.

Rules:

* To create a contact, you must submit at least one **addressable attribute** for them (the one that has a channel defined).
* To create a contact with the opt-in status, you must provide the addressable value for each channel that has the contact's consent. For example, to set consent for the Email channel, you must submit the contact's email address. For more information about consent statuses, see [Consent](https://developer.goacoustic.com/acoustic-connect/reference/consent).

# Approach A: add contacts with consent group membership

The following example demonstrates how to add new contacts to your audience and register them in several consent groups. Note that we set the `OPT_IN` status for the first consent group. In the second consent group, we limit preference to a particular channel within the consent group (`EMAIL`).

```graphql Mutation
mutation {
  createContacts(
    contactsInput: [
      {
        attributes: [
          { name: "First Name", value: "Alice" }
          { name: "Last Name", value: "Brown" }
          { name: "Contact Key", value: "DDE_98716455" }
          { name: "Email Address", value: "alice_b@example.com" }
        ]
        consent: {
          consentGroups: [
            { consentGroupId: "97660d76-02d8-5fd6-xxxx-000000000000", status: OPT_IN }
            {
              consentGroupId: "97660d76-02d8-5fd6-xxxx-000000000000"
              channels: { channel: EMAIL, status: OPT_IN_UNVERIFIED }
            }
          ]
        }
      }
    ]
  ) {
    items {
      contactKey
    }
  }
}
```
```json Response
{
  "data": {
    "createContacts": {
      "items": [
        {
          "contactKey": "DDE_98716455"
        }
      ]
    }
  }
}
```

If you don't have the ID's of consent groups in your audience, use this query.

```graphql Query
query {
  dataSets {
    nodes {
      consentGroups {
        name
        id
      }
    }
  }
}
```
```json Response
{
  "data": {
    "dataSets": {
      "nodes": [
        {
          "consentGroups": [
            {
              "id": "97660d76-02d8-5fd6-0000-11111111aaa11a",
              "name": "Newsletters"
            },
            {
              "id": "97660d76-02d8-5fd6-0000-11111111aaa11a",
              "name": "Promotions"
            },
            {
              "id": "97660d76-02d8-5fd6-0000-11111111aaa11a",
              "name": "Information"
            },
            {
              "id": "97660d76-02d8-5fd6-0000-11111111aaa11a",
              "name": "Custom"
            }
          ]
        }
      ]
    }
  }
}
```

# Approach B: submit consent preferences per channel

In this example, we will add a contact and subscribe them to email and text communications.

```graphql Mutation
mutation {
  createContacts(
    contactsInput: [
      {
        attributes: [
          { name: "First Name", value: "Tim" }
          { name: "Last Name", value: "Smith" }
          { name: "Email Address", value: "tim@example.com" }
          { name: "Contact Key", value: "DDJ_98716421" }
          { name: "Phone Number", value: "+581746657000" }
          
        ]
        consent: {
          channels: [
            { channel: EMAIL, status: OPT_IN_UNVERIFIED }
            { channel: SMS, status: OPT_IN }
          ]
        }
      }
    ]
  ) {
    items {
      contactKey
    }
  }
}
```
```json Response
{
  "data": {
    "createContacts": {
      "items": [
        {
          "contactKey": "DDJ_98716421"
        }
      ]
    }
  }
}
```

# Arguments

Arguments supported by the `createContacts` mutation

| Argument        | Input field  | Values | Required? | Definition           |
| :-------------- | :----------- | :----- | :-------- | :------------------- |
| `contactsInput` | `attributes` | Array  | Required  | See the input fields |
|                 | `consent`    | Array  | Optional  | See the input fields |

Fields nested into the `attributes` field

[block:parameters]
{
  "data": {
    "h-0": "Field",
    "h-1": "Values",
    "h-2": "Required?",
    "h-3": "Definition",
    "0-0": "`name`",
    "0-1": "String (case-sensitive)  \n  \n:warning: To check the names of available attributes, use the [Get all contact attributes](https://developer.goacoustic.com/acoustic-connect/reference/get-a-list-of-attributes) query.",
    "0-2": "Required",
    "0-3": "The name of the attribute to populate for the contact",
    "1-0": "`value`",
    "1-1": "Depends on the type of attribute ",
    "1-2": "Required",
    "1-3": "The value of the attribute "
  },
  "cols": 4,
  "rows": 2,
  "align": [
    "left",
    "left",
    "left",
    "left"
  ]
}
[/block]

There are 2 fields nested into the `consent` field: `channels` and `consentGroups`. They are **mutually exclusive** and cannot be submitted together for the same contact.

[block:parameters]
{
  "data": {
    "h-0": "Field",
    "h-1": "Nested field - level 1",
    "h-2": "Nested field - level 2",
    "h-3": "Values",
    "h-4": "Definition",
    "0-0": "`channels`",
    "0-1": "`channel`",
    "0-2": "",
    "0-3": "Either of the following values:  \n  \n- `EMAIL`\n- `SMS`\n- `WHATSAPP`",
    "0-4": "The type of communication channel",
    "1-0": "",
    "1-1": "`status`",
    "1-2": "",
    "1-3": "One of the following values:  \n  \n- `OPT_IN`\n- `OPT_OUT`\n- `OPT_IN_UNVERIFIED`",
    "1-4": "Indicates if the contact has agreed to receive communication through the channel.",
    "2-0": "`consentGroups`",
    "2-1": "`channels`",
    "2-2": "`channel`",
    "2-3": "Either of the following values:  \n  \n- `EMAIL`\n- `SMS`\n- `WHATSAPP`",
    "2-4": "The type of communication channel",
    "3-0": "",
    "3-1": "",
    "3-2": "`status`",
    "3-3": "One of the following values:  \n  \n- `OPT_IN`\n- `OPT_OUT`\n- `OPT_IN_UNVERIFIED`",
    "3-4": "Indicates if the contact has agreed to receive communication through the channel.",
    "4-0": "",
    "4-1": "`consentGroupId`",
    "4-2": "",
    "4-3": "String",
    "4-4": "The ID of the subscription group to add the contact to",
    "5-0": "",
    "5-1": "`status`",
    "5-2": "",
    "5-3": "One of the following values:  \n  \n- `OPT_IN`\n- `OPT_OUT`\n- `OPT_IN_UNVERIFIED`",
    "5-4": "The contact's status within the subscription group (applies to all of its channels)"
  },
  "cols": 5,
  "rows": 6,
  "align": [
    "left",
    "left",
    "left",
    "left",
    "left"
  ]
}
[/block]

# Fields

Fields returned by the `createContacts` mutation

| Field   | Nested field | Required? | Definition                                         |
| :------ | :----------- | :-------- | :------------------------------------------------- |
| `items` | `contactKey` | Required  | The unique ID you have assigned to the new contact |