---
type: api
title: Create a short URL
description: Kibana URLs may be long and cumbersome, short URLs are much easier to remember and share.
url: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/operation/operation-post-url
resource: https://www.elastic.co/elastic/docs-builder/docs/4371/api/doc/kibana/operation/operation-post-url
products:
  - Kibana
---

# Create a short URL

Availability:

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

## Paths

- `POST` `/api/short_url`

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

## Description

Kibana URLs may be long and cumbersome, short URLs are much easier to remember and share.
Short URLs are created by specifying the locator ID and locator parameters. When a short URL is resolved, the locator ID and locator parameters are used to redirect user to the right Kibana page.

## Request Body

`application/json`

- `humanReadableSlug` (boolean) — optional
  When the `slug` parameter is omitted, the API will generate a random human-readable slug if `humanReadableSlug` is set to true.
- `locatorId` (string) — required
  The identifier for the locator.
- `params` (object) — required
  An object which contains all necessary parameters for the given locator to resolve to a Kibana location.
> warn
> When you create a short URL, locator params are not validated, which allows you to pass arbitrary and ill-formed data into the API that can break Kibana. Make sure any data that you send to the API is properly formed.
- `slug` (string) — optional
  A custom short URL slug. The slug is the part of the short URL that identifies it. You can provide a custom slug which consists of latin alphabet letters, numbers, and `-._` characters. The slug must be at least 3 characters long, but no longer than 255 characters.

## Response

Indicates a successful call.

`application/json`

- `accessCount` (integer)
  Number of times the short URL has been resolved.
- `accessDate` (integer)
  Unix epoch (milliseconds) of the last time the short URL was resolved. Set to the creation time when the URL has never been accessed.
- `createDate` (integer)
  Unix epoch (milliseconds) when the short URL was created.
- `id` (string)
  The identifier for the short URL.
- `locator` (object)
  - `id` (string)
    The identifier for the locator.
  - `state` (object)
    The locator parameters.
  - `version` (string)
    The version of Kibana when the short URL was created.
- `slug` (string)
  A random human-readable slug is automatically generated if the `humanReadableSlug` parameter is set to `true`. If it is set to `false`, a random short string is generated.
## Code Examples

#### Console

```console
POST /api/short_url
{
  "locatorId": "DASHBOARD_APP_LOCATOR",
  "params": {
    "dashboardId": "edf84fe0-e1a0-11e7-b6d5-4dc382ef7f5b",
    "timeRange": {
      "from": "now-7d",
      "to": "now"
    }
  },
  "slug": "my-dashboard"
}
```

#### curl

```curl
curl -X POST "https://{kibana_url}/api/short_url" \
  -H "Content-Type: application/json" \
  -d '{
  "locatorId": "DASHBOARD_APP_LOCATOR",
  "params": {
    "dashboardId": "edf84fe0-e1a0-11e7-b6d5-4dc382ef7f5b",
    "timeRange": {
      "from": "now-7d",
      "to": "now"
    }
  },
  "slug": "my-dashboard"
}'
```

## Response Examples

#### Short URL created

The created short URL record.

```json
{
  "accessCount": 0,
  "accessDate": 1767225600000,
  "createDate": 1767225600000,
  "id": "c54b04f5d4b3aa3c",
  "locator": {
    "id": "DASHBOARD_APP_LOCATOR",
    "state": {
      "dashboardId": "edf84fe0-e1a0-11e7-b6d5-4dc382ef7f5b",
      "timeRange": {
        "from": "now-7d",
        "to": "now"
      }
    },
    "version": "9.4.0"
  },
  "slug": "my-dashboard"
}
```

