---
title: "Update Data Sharing Consent"
method: PUT
path: "/api/user/data-sharing-consent"
---

# Update Data Sharing Consent

`PUT /api/user/data-sharing-consent`

Toggle the current user's data sharing consent.

Stamps ``data_sharing_consent_at`` with the current UTC time on every
call, regardless of whether the value changed. This makes the column
a "last toggled at" timestamp rather than a "first opted in at" one,
which is the cheaper guarantee to keep correct: a one-shot accidental
double-PUT can't drift the timestamp.

## Request body

- DataSharingConsentRequest — Body for ``PUT /api/user/data-sharing-consent``. Single boolean. The endpoint always stamps ``data_sharing_consent_at`` with ``now()`` regardless of whether ``consent`` is ``True`` or ``False``, so consent toggle history can be reconstructed even when no separate audit table exists.
  - `consent` boolean, required

## Response `200`

Successful Response

- DataSharingConsentResponse — Returned by the consent setter and getter. ``data_sharing_consent_at`` is the timestamp of the last toggle, not "first opted in." If a user opts in, then opts out, this column holds the opt-out time.
  - `data_sharing_consent` boolean, required
  - `data_sharing_consent_at` string, nullable, required

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/mozilla-ai/apis/clawbolt.md) · [All operations](https://skmtc.net/mozilla-ai/apis/clawbolt/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/mozilla-ai/clawbolt/versions/327e305858ac/schema)
