# Ketch

> Read a Ketch property's purposes and jurisdictions, check what a person has consented to, and record their consent choices from your own forms and systems.

App · 3 actions. Web page: https://docs.lodol.com/docs/integrations/ketch

## Actions

### Get consent

Look up what a person has agreed to, purpose by purpose. A person Ketch has not heard from is not an error: 'has_consent_record' is false and the lists are empty.

**Inputs**

- Email address (`email`, text, required): The email address Ketch knows the person by.
- Jurisdiction (`jurisdiction`, text): The privacy regime the choices are for, such as gdpr or US_California. Leave empty for the property's default.

**Outputs**

- `allowed_purposes` (list): Codes of the purposes the person allows.
- `denied_purposes` (list): Codes of the purposes the person denies.
- `email` (text): The person's email address, lower-cased.
- `has_consent_record` (true/false): False when Ketch holds no choice from this person.
- `jurisdiction` (text): The jurisdiction the choices apply under.
- `purposes` (list): Each purpose the person has chosen for, and the choice.

**Example output**

```json
{
  "allowed_purposes": [
    "analytics"
  ],
  "denied_purposes": [
    "targeted_advertising"
  ],
  "email": "jane@example.com",
  "has_consent_record": true,
  "jurisdiction": "gdpr",
  "purposes": [
    {
      "allowed": true,
      "code": "analytics"
    },
    {
      "allowed": false,
      "code": "targeted_advertising"
    }
  ]
}
```

### Get property settings

Read what the connected Ketch property offers: its environments, jurisdictions, languages and the purposes people can consent to, with each one's legal basis.

**Inputs**: None.

**Outputs**

- `default_jurisdiction` (text): The jurisdiction used when none is chosen.
- `environment_code` (text): The environment this connection uses.
- `environments` (list): Every environment the property has.
- `jurisdictions` (list): Every jurisdiction the property applies.
- `languages` (list): The languages its banner is offered in.
- `organization_code` (text): The organization's code.
- `platform` (text): WEB, or the app platform.
- `property_code` (text): The property's code.
- `property_name` (text): The property's name.
- `purpose_count` (number): How many purposes the property has.
- `purposes` (list): The purposes people can consent to.

**Example output**

```json
{
  "default_jurisdiction": "default",
  "environment_code": "production",
  "environments": [
    "production"
  ],
  "jurisdictions": [
    "default",
    "gdpr",
    "US_California"
  ],
  "languages": [
    "en"
  ],
  "organization_code": "acme",
  "platform": "WEB",
  "property_code": "website",
  "property_name": "Website",
  "purpose_count": 1,
  "purposes": [
    {
      "code": "analytics",
      "description": "Cookies that measure how the website is used.",
      "legal_basis": "consent_optin",
      "name": "Data Analytics",
      "requires_opt_in": true
    }
  ]
}
```

### Record consent

Record a person's consent choices in Ketch: purposes they allow and purposes they deny. Ketch keeps consent as a history, so a choice is changed by recording the opposite one. Only record what the person told you themselves.

**Inputs**

- Email address (`email`, text, required): The email address Ketch knows the person by.
- Jurisdiction (`jurisdiction`, text): The privacy regime the choices are for, such as gdpr or US_California. Leave empty for the property's default.
- Purposes allowed (`allowed_purposes`, list): The purposes the person agrees to.
- Purposes denied (`denied_purposes`, list): The purposes the person declines.

**Outputs**

- `allowed_purposes` (list): Codes of the purposes the person allows.
- `denied_purposes` (list): Codes of the purposes the person denies.
- `email` (text): The person's email address, lower-cased.
- `has_consent_record` (true/false): False when Ketch holds no choice from this person.
- `jurisdiction` (text): The jurisdiction the choices apply under.
- `purposes` (list): Each purpose the person has chosen for, and the choice.
- `recorded` (true/false): True once Ketch has stored the choices.

**Example output**

```json
{
  "allowed_purposes": [
    "analytics"
  ],
  "denied_purposes": [
    "targeted_advertising"
  ],
  "email": "jane@example.com",
  "has_consent_record": true,
  "jurisdiction": "gdpr",
  "purposes": [
    {
      "allowed": true,
      "code": "analytics"
    },
    {
      "allowed": false,
      "code": "targeted_advertising"
    }
  ],
  "recorded": true
}
```
