---
title: "Make a diagram public or private"
method: PUT
path: "/v1/diagrams/{id}/sharing"
tags: ["Diagrams"]
---

# Make a diagram public or private

`PUT /v1/diagrams/{id}/sharing`

## Request

- Base URL: `https://api.zindex.ai`
- URL: `https://api.zindex.ai/v1/diagrams/{id}/sharing`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-API-Key`

public makes the diagram readable by anyone at https://zindex.ai/d/{id}: its scene, title, description and every version's image. private stops those links at once; share links keep working until revoked. Copies people already saved stay with them.

## Path parameters

- `id` string, required

## Request body

- object
  - `visibility` 'public' | 'private', required

## Response `200`

{ id, visibility, url?, madePublicAt? }; url is the diagram's version link, https://zindex.ai/d/{id}, and madePublicAt when the diagram was first published. Making it private stops its links by ID at once; its share links keep working until revoked.

## Other responses

- `400`: INVALID_REQUEST: the body isn't JSON, or visibility isn't public or private
- `401`: Missing or invalid API key. Response includes a `code` field that distinguishes the failure mode so clients (dashboard, MCP server) can render actionable copy: `AUTH_REQUIRED` (no key or session was sent), `API_KEY_INVALID` (key not found), `API_KEY_REVOKED` (key was revoked, or its person is no longer in its workspace), `API_KEY_EXPIRED` (key passed its expires_at), and for the site's session cookie `SESSION_EXPIRED` (past its 24 hours), `SESSION_REVOKED` (the account's sessions were ended, for example by a password reset) and `SESSION_INVALID` (not a session this server signed).
- `403`: EMAIL_NOT_VERIFIED: verify the account's email first; READ_ONLY: a read key or a viewer; SHARING_DISABLED: the workspace's owners turned off public sharing, so it can't be published (making it private still works). The visibility didn't change
- `404`: NOT_FOUND
- `429`: RATE_LIMITED: over the request rate limit (see Rate Limiting). Wait retryAfter seconds (also the Retry-After header), then try again.

---

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