Create a short URL Technical Preview

POST /api/short_url

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.

application/json

Body Required

  • 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.

    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

    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.

Responses

  • 200 application/json

    Indicates a successful call.

    Hide response attributes Show response attributes object
    • id string

      The identifier for the short URL.

    • locator object
      Hide locator attributes Show locator attributes 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.

POST /api/short_url
curl \
 --request POST http://localhost:5622/api/short_url \
 --header "Authorization: $API_KEY" \
 --header "Content-Type: application/json" \
 --data '{"humanReadableSlug":true,"locatorId":"string","params":{},"slug":"string"}'
Request examples
{
  "humanReadableSlug": true,
  "locatorId": "string",
  "params": {},
  "slug": "string"
}
Response examples (200)
{
  "accessCount": 42,
  "accessDate": "string",
  "createDate": "string",
  "id": "string",
  "locator": {
    "id": "string",
    "state": {},
    "version": "string"
  },
  "slug": "string"
}