# Define what shoppers can consent to

Name each thing customers can allow or refuse — marketing email, data use — as a consent purpose, so every consent recorded points at a defined purpose.

Compliance · a play in 1 step.

## The steps

1. Name the purpose — one thing customers can allow or refuse. — [createConsentPurpose](/reference/consent-purpose/createConsentPurpose/)

## The calls

Every operation this use case runs, in the order it first appears, with the request and the response its reference page shows.

### createConsentPurpose

[createConsentPurpose](/reference/consent-purpose/createConsentPurpose/) — mutation · Create a new consent purpose — one named thing customers can allow or refuse (marketing email, data use) at your organization.

**Example request**

```graphql
mutation ExampleCreateConsentPurpose($input: NewConsentPurposeInput!) {
  createConsentPurpose(input: $input) {
    id
    sysId
    type
    caption
    status
    parentId
    rootId
    createdAt
    updatedAt
    revisionNum
    revision
    code
    consentModel
    templateKey
    templateVersion
    everReferenced
  }
}
```

Variables:

```json
{
  "input": {
    "caption": "Blue jeans",
    "code": "BJ-001",
    "consentModel": "<consent model>"
  }
}
```

Send it with the envelope naming the version: `"extensions": {"at": {"version": {"name":"genesis","number":0}}}`.

**Example response**

```json
{
  "data": {
    "createConsentPurpose": {
      "id": "01900000-0000-7000-8000-37386ae00000",
      "sysId": "PP-EXMP-0000-000F",
      "type": "ConsentPurpose",
      "caption": "Blue jeans",
      "status": "active",
      "parentId": "01900000-0000-7000-8000-065235280000",
      "rootId": "01900000-0000-7000-8000-a093dd800000",
      "createdAt": "2027-01-31T00:00:00.000Z",
      "updatedAt": "2027-01-31T00:00:00.000Z",
      "revisionNum": 1,
      "revision": "01900000-0000-7000-8000-b7960e180000",
      "code": "BJ-001",
      "consentModel": "<consent model>",
      "templateKey": "<template key>",
      "templateVersion": 1,
      "everReferenced": true
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}
```
