---
title: "Set memory block public or private."
method: PUT
path: "/memory_blocks/{memory_block_id}/privacy"
tags: ["Memory Blocks"]
---

# Set memory block public or private.

`PUT /memory_blocks/{memory_block_id}/privacy`

## Request

- Base URL: `https://h2ogpte.genai.h2o.ai/api/v1`
- URL: `https://h2ogpte.genai.h2o.ai/api/v1/memory_blocks/{memory_block_id}/privacy`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/h2o/apis/h2ogpte-rest-api/docs/memory_blocks/:memory_block_id/privacy/put.ts> (a function with typed inputs; its response is checked against the schema)

Toggle whether a memory block is publicly accessible.

## Path parameters

- `memory_block_id` string, required

## Request body

- MemoryBlockPrivacyRequest
  - `is_public` boolean, required: Whether the memory block should be public.
  - `permissions` string[]: Public permission levels to grant when is_public is true (e.g. 'h2ogpte/memory_block/edit'). Read access is always granted to a public memory block. Ignored when is_public is false. When omitted, edit access is granted by default; pass an explicit empty array to make the block public read-only.

## Response `204`

Successful operation

## Other responses

- `400`: Bad request
- `401`: Unauthorized - Invalid or missing API key
- `403`: Forbidden
- `404`: Not found
- `409`: Conflict
- `default`: Unexpected error

---

[API](https://skmtc.dev/h2o/apis/h2ogpte-rest-api.md) - [All operations](https://skmtc.dev/h2o/apis/h2ogpte-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/h2o/apis/h2ogpte-rest-api/revisions/a82a117320f4?raw)
