---
title: "Choose which WhatsApp chats the key may read"
method: PUT
path: "/api/v1/api-keys/{apiKeyId}/chat-access"
tags: ["API keys"]
---

# Choose which WhatsApp chats the key may read

`PUT /api/v1/api-keys/{apiKeyId}/chat-access`

## Request

- Base URL: `https://otprun.com`
- URL: `https://otprun.com/api/v1/api-keys/{apiKeyId}/chat-access`
- Auth: HTTP bearer

## Path parameters

- `apiKeyId` integer, required

## Request body

- AccessInputBody
  - `chat_access` 'all' | 'own', required

## Response `200`

OK

- KeyBody
  - `chat_access` 'all' | 'own', required: all: the key reads every WhatsApp chat of the workspace; own: only chats it wrote to itself
  - `created_at` string, date-time, required
  - `id` integer, required
  - `ip_allowlist` string[], nullable, required
  - `last_used_at` string, date-time, nullable, required
  - `name` string, required
  - `prefix` string, required
  - `project_id` integer, required
  - `revoked_at` string, date-time, nullable, required
  - `scopes` string[], nullable, required

## Other responses

- `403`: Forbidden
- `404`: Not Found
- `422`: Unprocessable Entity
- `500`: Internal Server Error

---

[API](https://skmtc.dev/otprun/apis/otp-run-api.md) · [All operations](https://skmtc.dev/otprun/apis/otp-run-api/llms.txt) · [OpenAPI document](https://skmtc.dev/otprun/apis/otp-run-api/revisions/43d40d5f4050?raw)
