# Consent

URL: /business/nouns/consent · Id: `noun:consent`

> A Consent is a person’s grant for one Purpose, with its basis, region, notice, evidence, and expiry.

A Consent is a person’s grant for one [Purpose](/business/nouns/purpose), with its basis, region, notice, evidence, and expiry.

## Properties
| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `basis` | `string` | Yes | The lawful basis, such as consent or contract. Never randomized. |
| `region` | `string` | No | The jurisdiction whose rules apply. Never randomized. |
| `withdrawnAt` | `datetime` | No | When the person withdrew it. Never randomized. |

## Object
```json
{
  "$id": "https://api.sb/petpantry.shop/consents/consent_1",
  "$type": "Consent",
  "basis": "Example basis",
  "region": "Example region",
  "withdrawnAt": "2026-10-22T12:00:00Z"
}
```

## Relationships
- <a id="rel-covers"></a>A Consent **covers** one [Purpose](/business/nouns/purpose): the [Purpose](/business/nouns/purpose) the Consent permits processing for, and nothing beyond it. `covers`, inverse [`consents`](/business/nouns/purpose#rel-consents).
- <a id="rel-given-by"></a>A Consent **is given by** one [Contact](/business/nouns/contact): a [Contact](/business/nouns/contact) grants Consents, each for one [Purpose](/business/nouns/purpose), with its basis and expiry. `givenBy`, inverse [`gives`](/business/nouns/contact#rel-gives).

## Verbs
| Verb | Description | Subject | Event | Class |
| --- | --- | --- | --- | --- |
| [Consent.withdraw](/business/nouns/consent/withdraw) | Withdraw ends a Consent at once: processing for its Purpose stops, and the record is kept. | [Privacy Officer](/agents/legal/privacy-officer) | [`Consent.withdrawn`](/business/events/Consent.withdrawn) | Two-way: `try`, `send`, `do` |
| <a id="create"></a>[Consent.create](/business/nouns/consent/create) | Creates a Consent. Inherited from [Noun](/business/nouns/noun). | None. | `Consent.created` | Two-way: `try`, `send`, `do` |
| <a id="get"></a>[Consent.get](/business/nouns/consent/get) | Returns one Consent by id. Inherited from [Noun](/business/nouns/noun). | None. | None. | Read: `try`, `do` |
| <a id="list"></a>[Consent.list](/business/nouns/consent/list) | Returns Consents, newest first, one page at a time. Inherited from [Noun](/business/nouns/noun). | None. | None. | Read: `try`, `do` |
| <a id="update"></a>[Consent.update](/business/nouns/consent/update) | Changes the given properties of a Consent. Inherited from [Noun](/business/nouns/noun). | None. | `Consent.updated` | Two-way: `try`, `send`, `do` |

## Permissions
Which Access level may call each Verb. One-way Verbs wait their delay window.

| Operation | `owner` | `admin` | `member` | `viewer` |
| --- | --- | --- | --- | --- |
| `Consent.create` | Yes | Yes | Yes | No |
| `Consent.get` | Yes | Yes | Yes | Yes |
| `Consent.list` | Yes | Yes | Yes | Yes |
| `Consent.update` | Yes | Yes | Yes | No |
| `Consent.withdraw` | Yes | Yes | Yes | No |

## Call it

**Ask**

```text
Withdraw the latest consent.
```

**API**

```bash
curl -X POST https://api.sb/tutorloop.com/consents/consent_1/withdraw \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY"
```

```json
{
  "api": "https://api.sb/tutorloop.com",
  "consent": {
    "$id": "https://api.sb/tutorloop.com/consents/consent_1",
    "$type": "Consent",
    "basis": "Example basis"
  },
  "action": {
    "$id": "https://api.sb/tutorloop.com/actions/action_1",
    "operation": "Consent.withdraw",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/tutorloop.com/actions/action_1"
  }
}
```

**SDK**

```ts
import { $ } from 'startup-builder'

const consent = await $.Consent.withdraw({ consent: 'consent_1' })
```

**CLI**

```bash
npx startup-builder do Consent.withdraw --json '{"consent":"consent_1"}'
```

**MCP**

```json
{
  "name": "do",
  "arguments": {
    "code": "return await $.Consent.withdraw({ consent: 'consent_1' })"
  }
}
```

## Example
A visitor ticks a box for product updates on a pricing [Page](/business/nouns/page). The Consent records the marketing [Purpose](/business/nouns/purpose), the notice shown, the time, and a two-year expiry.