---
title: "Give or withdraw a consent"
method: POST
path: "/api/consent"
tags: ["Account"]
---

# Give or withdraw a consent

`POST /api/consent`

## Request

- Base URL: `https://getmyluna.app`
- URL: `https://getmyluna.app/api/consent`
- Auth: one of:
  - HTTP bearer
  - API key in cookie `luna_session`

`{kind: health|ai, agree: true|false}`. Agreeing records the current wording version and time; `false` withdraws it (for `ai`, Ask Luna stops sending anything to the AI provider).

## Request body

- ConsentUpdate
  - `kind` 'health' | 'ai', required
  - `agree` boolean, required: `true` gives consent (current wording version); `false` withdraws it.

## Response `200`

Success

- ConsentStatus
  - `health` ConsentEntry, required
    - `granted` boolean, required
    - `granted_at` string, nullable: UTC ISO time of the active grant.
    - `version` string, required: Wording version currently shown.
    - `text` string, required: The exact consent wording.
  - `ai` ConsentEntry, required
    - `granted` boolean, required
    - `granted_at` string, nullable: UTC ISO time of the active grant.
    - `version` string, required: Wording version currently shown.
    - `text` string, required: The exact consent wording.
  - `privacy_url` string

## Other responses

- `400`: Bad Request
- `401`: Missing or invalid credentials
- `403`: `insufficient_scope`: the bearer token lacks the `write` scope

---

[API](https://skmtc.dev/getmyluna/apis/luna-api.md) · [All operations](https://skmtc.dev/getmyluna/apis/luna-api/llms.txt) · [OpenAPI document](https://skmtc.dev/getmyluna/apis/luna-api/revisions/ef7b359c9648?raw)
