---
title: "Create a public link for a dashboard"
method: POST
path: "/api/{org_id}/dashboards/{dashboard_id}/public_links"
tags: ["Public Dashboards"]
---

# Create a public link for a dashboard

`POST /api/{org_id}/dashboards/{dashboard_id}/public_links`

## Request

- Base URL: `https://api.openobserve.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.openobserve.ai/api/{org_id}/dashboards/{dashboard_id}/public_links`
- Auth: API key in header `Authorization`
- TypeScript: <https://skmtc.dev/openobserve/apis/openobserve-api-http/docs/api/:org_id/dashboards/:dashboard_id/public_links/post.ts> (a function with typed inputs; its response is checked against the schema)

## Path parameters

- `org_id` string, required
- `dashboard_id` string, required

## Request body

- PublicDashboardConfig: Admin body to create or update a link; variables stay frozen at the author's values.
  - `expires_at` integer, nullable
  - `frozen_variables` object
  - `name` string: Label that tells a dashboard's links apart; empty is allowed.
  - `refresh_secs` integer
  - `time_range` TimeRangePolicy, required: The ranges a link offers; with more than one, viewers can switch between them.
    - `default` union, required: One window a link offers: rolling and refreshed on read, or fixed and built once.
      - object
        - `secs` integer, required
        - `type` 'relative', required
      - object: UTC micros.
        - `end` integer, required
        - `start` integer, required
        - `type` 'absolute', required
    - `ranges` PublicDashboardTimeRange[], required
      - union: One window a link offers: rolling and refreshed on read, or fixed and built once.
        - object
          - `secs` integer, required
          - `type` 'relative', required
        - object: UTC micros.
          - `end` integer, required
          - `start` integer, required
          - `type` 'absolute', required
  - `visibility` 'draft' | 'public': Draft configures the share without exposing it; Public serves it and is the default.

## Response `200`

Success

- PublicLinkView: A link as the admin API returns it; the slug is a bearer secret for authenticated routes only.
  - `access_count` integer, required
  - `created_at` integer, required
  - `dashboard_id` string, required
  - `dashboard_title` string, nullable
  - `enabled` boolean, required
  - `expires_at` integer, nullable
  - `folder_id` string, nullable
  - `folder_name` string, nullable
  - `frozen_variables` object, required
  - `id` string, required
  - `last_accessed_at` integer, nullable
  - `name` string, required
  - `published_by` string, required
  - `publisher_left` boolean, required: The publisher is no longer an org member; the link may still be enabled while cleanup lags.
  - `refresh_secs` integer, required
  - `slug` string, nullable: Null when the caller cannot read the link's dashboard.
  - `status` 'live' | 'paused' | 'not_viewed' | 'needs_attention' | 'expired' | 'dashboard_deleted' | 'disabled', required: A link's state as the admin UI shows it; `NeedsAttention` comes from the batch status call.
  - `time_range` TimeRangePolicy, required: The ranges a link offers; with more than one, viewers can switch between them.
    - `default` union, required: One window a link offers: rolling and refreshed on read, or fixed and built once.
      - object
        - `secs` integer, required
        - `type` 'relative', required
      - object: UTC micros.
        - `end` integer, required
        - `start` integer, required
        - `type` 'absolute', required
    - `ranges` PublicDashboardTimeRange[], required
      - union: One window a link offers: rolling and refreshed on read, or fixed and built once.
        - object
          - `secs` integer, required
          - `type` 'relative', required
        - object: UTC micros.
          - `end` integer, required
          - `start` integer, required
          - `type` 'absolute', required
  - `updated_at` integer, required
  - `updated_by` string, nullable

---

[API](https://skmtc.dev/openobserve/apis/openobserve-api-http.md) - [All operations](https://skmtc.dev/openobserve/apis/openobserve-api-http/llms.txt) - [OpenAPI document](https://skmtc.dev/openobserve/apis/openobserve-api-http/revisions/0529b8a10252?raw)
