---
title: "Share a memory block with a user."
method: PUT
path: "/memory_blocks/{memory_block_id}/permissions/{username}"
tags: ["Memory Blocks"]
---

# Share a memory block with a user.

`PUT /memory_blocks/{memory_block_id}/permissions/{username}`

## Request

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

Shares a memory block with a user, granting read and/or edit permissions.

## Path parameters

- `memory_block_id` string, required
- `username` string, required

## Request body

- ShareMemoryBlockRequest
  - `permissions` string[]: Individual permission levels for the memory block.

## 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)
