---
type: api
title: Create a links library item
description: **Spaces method and path for this operation:**
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana-serverless/operation/operation-post-links
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana-serverless/operation/operation-post-links
products:
  - Kibana
---

# Create a links library item

Availability:

- Server: `https://{kibana_url}`

## Paths

- `POST` `/api/links`
- `POST` `/s/{space_id}/api/links`

- [Api key auth](/elastic/docs-builder/docs/4371/api/doc/kibana-serverless/authentication#apikeyauth)

## Description

Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.

Creates a new links library item and returns its ID, full state, and metadata.

## Request Body

`application/json`

- `description` (string) — optional
- `layout` (enum) — optional
  Whether to display the links in a horizontal or vertical layout.
  Values: `horizontal`, `vertical`
- `links` ([] union oneOf · max: 100) — required
  The list of links to display.
  - **Kibana_HTTP_APIs_kbn-link-panel-type-dashboardLink**
    Link type. Set to dashboardLink for a link to another dashboard.
    - `destination` (string) — required
      Linked dashboard saved object ID.
    - `label` (string) — optional
      The label of the link displayed in the UI.
    - `options` (object · default: {
  "open_in_new_tab": false,
  "use_filters": true,
  "use_time_range": true
}) — optional
      - `open_in_new_tab` (boolean · default: false) — optional
        When enabled, the dashboard opens in a new browser tab.
      - `use_filters` (boolean · default: true) — optional
        When enabled, filters are passed to the opening dashboard.
      - `use_time_range` (boolean · default: true) — optional
        When enabled, time range is passed to the opening dashboard.
    - `type` (enum) — required
      Values: `dashboardLink`
  - **Kibana_HTTP_APIs_kbn-link-type-externalLink**
    Link type. Set to externalLink for a URL outside Kibana.
    - `destination` (string) — required
      The external URL to link to.
    - `label` (string) — optional
      The label of the link displayed in the UI.
    - `options` (object · default: {
  "encode_url": true,
  "open_in_new_tab": true
}) — optional
      - `encode_url` (boolean · default: true) — optional
        Whether to escape the URL with percent encoding
      - `open_in_new_tab` (boolean · default: true) — optional
        Whether to open this link in a new tab when clicked.
    - `type` (enum) — required
      Values: `externalLink`
- `tags` ([] string · max: 1000 · default: []) — optional
  Tag IDs associated with this library item.
- `title` (string) — required

## Responses

#### `201`

created

`application/json`

- `data` (object)
  - `description` (string)
  - `layout` (enum)
    Whether to display the links in a horizontal or vertical layout.
    Values: `horizontal`, `vertical`
  - `links` ([] union oneOf · max: 100)
    The list of links to display.
    Same options as `links`
  - `tags` ([] string · max: 1000 · default: [])
    Tag IDs associated with this library item.
  - `title` (string)
- `id` (string)
  The unique ID of the links library item, as returned by the create or search endpoints.
- `meta` ({})
  - `created_at` (string)
    Timestamp when the object was created (ISO 8601).
  - `created_by` (string)
    User profile ID of the user who created the object.
  - `managed` (boolean)
    When `true`, the object is managed by Kibana and cannot be edited by users.
  - `owner` (string)
    Identifier of the plugin or team that owns this object.
  - `updated_at` (string)
    Timestamp when the object was last updated (ISO 8601).
  - `updated_by` (string)
    User profile ID of the user who last updated the object.
  - `version` (string)
    Internal version identifier for optimistic concurrency control.
#### `400`

invalid request

#### `403`

forbidden

## Code Examples

#### Console

```console
POST kbn:/api/links
{
  "summary": "Create a links library item",
  "value": {
    "title": "Important Resources",
    "description": "A collection of important links",
    "links": [
      {
        "label": "Overview",
        "type": "dashboardLink",
        "destination": "dashboard-abc-123"
      },
      {
        "label": "Elastic Documentation",
        "type": "externalLink",
        "destination": "https://www.elastic.co/docs"
      }
    ],
    "layout": "horizontal"
  }
}
```

#### curl

```curl
curl \
  -X POST "${KIBANA_URL}/api/links" \
  -H "Authorization: ApiKey ${API_KEY}" \
  -H "kbn-xsrf: true" \
  -H "Content-Type: application/json" \
  -d '{
  "title": "Important Resources",
  "description": "A collection of important links",
  "links": [
    {
      "label": "Overview",
      "type": "dashboardLink",
      "destination": "dashboard-abc-123"
    },
    {
      "label": "Elastic Documentation",
      "type": "externalLink",
      "destination": "https://www.elastic.co/docs"
    }
  ],
  "layout": "horizontal"
}'
```

## Response Examples

#### Create links library item response

Creates a new links library item and returns its ID, full state, and metadata.

```json
{
  "data": {
    "description": "A collection of important links",
    "layout": "horizontal",
    "links": [
      {
        "destination": "dashboard-abc-123",
        "label": "Overview",
        "options": {
          "open_in_new_tab": false,
          "use_filters": true,
          "use_time_range": true
        },
        "type": "dashboardLink"
      },
      {
        "destination": "https://www.elastic.co/docs",
        "label": "Elastic Documentation",
        "options": {
          "encode_url": true,
          "open_in_new_tab": true
        },
        "type": "externalLink"
      }
    ],
    "title": "Important Resources"
  },
  "id": "0ee9d0ea-06a0-4a30-bf4e-be4d3ca85bf3",
  "meta": {
    "created_at": "2026-06-03T23:33:39.979Z",
    "created_by": "u_EWATCHX9oIEsmcXj8aA1FkcaY3DE-XEpsiGTjrR2PmM_0",
    "managed": false,
    "updated_at": "2026-06-03T23:33:39.979Z",
    "updated_by": "u_EWATCHX9oIEsmcXj8aA1FkcaY3DE-XEpsiGTjrR2PmM_0",
    "version": "WzEwNywxXQ=="
  }
}
```

