> ## Documentation Index
> Fetch the complete documentation index at: https://omni.fireflo.au/llms.txt
> Use this file to discover all available pages before exploring further.

# POST /v1/contacts/{contact_id}/consent

> Mark a contact never to be contacted, until a time or for good, or lift it.

Marks a contact never to be contacted — until a time, or for good — or lifts it. While it stands, nothing is sent to them on any channel: messages to them fail with `not_permitted`, and so do replies and calls.

<Note>Needs the `contacts:write` scope.</Note>

## Path parameters

| Field | Type | Required | Notes |
| :- | :- | :- | :- |
| `contact_id` | string | Yes | The contact's id. |

## Body

| Field | Type | Required | Notes |
| :- | :- | :- | :- |
| `do_not_contact` | boolean | Yes | True to stop contacting them, false to lift it. |
| `reason` | string | No | Why, up to 200 characters. Kept with the change. |
| `until` | string | No | With `do_not_contact` true: an ISO time with its offset when it ends, like `2026-12-31T00:00:00+05:30`. Leave it out (or null) for good. |

## Request

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.fireflo.au/v1/contacts/3f6b2a1e-8c4d-4e2a-9b7f-5d1c0e8a9f42/consent \
    -H "Authorization: Bearer $OMNI_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "do_not_contact": true,
      "reason": "Asked on the phone",
      "until": "2026-12-31T00:00:00+05:30"
    }'
  ```

  ```python Python theme={null}
  import os

  import requests

  response = requests.post(
      "https://api.fireflo.au/v1/contacts/3f6b2a1e-8c4d-4e2a-9b7f-5d1c0e8a9f42/consent",
      headers={"Authorization": f"Bearer {os.environ['OMNI_API_KEY']}"},
      json={
          "do_not_contact": True,
          "reason": "Asked on the phone",
          "until": "2026-12-31T00:00:00+05:30",
      },
  )
  print(response.status_code, response.json())
  ```

  ```javascript Node theme={null}
  const response = await fetch("https://api.fireflo.au/v1/contacts/3f6b2a1e-8c4d-4e2a-9b7f-5d1c0e8a9f42/consent", {
    method: "POST",
    headers: {
      Authorization: `Bearer ${process.env.OMNI_API_KEY}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "do_not_contact": true,
      "reason": "Asked on the phone",
      "until": "2026-12-31T00:00:00+05:30"
    }),
  });
  console.log(response.status, await response.json());
  ```
</CodeGroup>

## Response

`200 OK` — the contact, with its consent as it now stands.

```json theme={null}
{
  "id": "3f6b2a1e-8c4d-4e2a-9b7f-5d1c0e8a9f42",
  "name": "Asha Rao",
  "phone": "+919876543210",
  "identifiers": [
    {
      "kind": "phone",
      "value": "+919876543210",
      "primary": true
    },
    {
      "kind": "phone",
      "value": "+919812345678",
      "primary": false
    },
    {
      "kind": "email",
      "value": "asha@acme.in",
      "primary": false
    }
  ],
  "fields": {
    "city": "Pune",
    "loyalty_tier": "gold"
  },
  "tags": [
    "newsletter",
    "vip"
  ],
  "consent": {
    "do_not_contact": true,
    "reason": "Asked on the phone",
    "until": "2026-12-30T18:30:00Z",
    "opted_out_at": null
  },
  "timezone": "Asia/Kolkata",
  "quiet_hours": {
    "start": "21:00:00",
    "end": "08:00:00"
  },
  "created": "2026-08-14T05:21:09.338Z",
  "updated": "2026-10-05T09:14:22.413Z"
}
```

## Errors

Every refusal is `{"error": {"code", "message", "field"}}`; `field` is there when one input is at fault.

| Status | Error code | When |
| :- | :- | :- |
| 404 | `not_found` | No contact has that id on this account. |
| 400 | `invalid_request` | `do_not_contact` isn't true or false, or `until` isn't an ISO time with its offset (`field` names it). |
| 400 | `invalid_json` | The body isn't valid JSON. |
| 403 | `scope_missing` | The key doesn't have the `contacts:write` scope. |

Any request can also be refused for its key, its account or its rate (`key_required`, `invalid_key`, `account_suspended`, `plan_excludes_api`, `address_not_allowed`, `rate_limited`); see [the overview](/api-reference/overview).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.