---
title: "Sets a key's probe contribution opt-in flag: the per-key consent gate on `POST /v1/probe`. A key contributes aggregate road-segment statistics only while this is `true`; it is `false` for every key by default. Idempotent."
method: PUT
path: "/admin/keys/{id}/opt-in"
tags: ["admin"]
---

# Sets a key's probe contribution opt-in flag: the per-key consent gate on \`POST /v1/probe\`. A key contributes aggregate road-segment statistics only while this is \`true\`; it is \`false\` for every key by default. Idempotent.

`PUT /admin/keys/{id}/opt-in`

## Request

- Base URL: `https://api.mapmap.ai`
- URL: `https://api.mapmap.ai/admin/keys/{id}/opt-in`
- Auth: HTTP bearer

## Path parameters

- `id` string, required

## Request body

- ProbeOptInRequest: Body for `PUT /admin/keys/{id}/opt-in`.
  - `opted_in` boolean, required: `true` to opt the key in to aggregate probe contribution, `false` to opt it back out. Off by default for every key.

## Response `200`

Flag set

- ProbeOptInResponse: Response for `PUT /admin/keys/{id}/opt-in`.
  - `key_id` string, required: Key whose flag was set.
  - `probe_opt_in` boolean, required: The flag's value after the change.

## Other responses

- `401`: Missing or wrong admin token
- `404`: Unknown key id

---

[API](https://skmtc.dev/mapmap/apis/sn-gateway.md) · [All operations](https://skmtc.dev/mapmap/apis/sn-gateway/llms.txt) · [OpenAPI document](https://skmtc.dev/mapmap/apis/sn-gateway/revisions/2293be8b4c38?raw)
