Shlink Domains API

Operations to manage domains used on short URLs

Operations 2

GET /rest/v{version}/domains List configured domains #
PATCH /rest/v{version}/domains/redirects Sets domain "not found" redirects #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/shlink:shlink-domains-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

shlink-domains-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Shlink Domains API
  version: '3.0'
  description: 'Operations tagged Domains across 3 of this provider''s published API definitions: shlink-openapi-v5.1.4.json, shlink-openapi-v5.1.0.json, shlink-openapi.json. Each path carries the servers of the definition it was published in.'
servers:
- url: '{scheme}://{host}'
  variables:
    scheme:
      enum:
      - https
      - http
      default: https
    host:
      default: ''
tags:
- name: Domains
  description: Operations to manage domains used on short URLs
paths:
  /rest/v{version}/domains:
    get:
      tags:
      - Domains
      summary: List configured domains
      description: 'Returns the list of all domains that have been either used for some short URL, or have explicitly configured redirects.

        It also includes the domain redirects, plus the default redirects that will be used for any non-explicitly-configured one.'
      operationId: listDomains
      parameters:
      - name: version
        in: path
        description: The API version to be consumed
        required: true
        schema:
          enum:
          - '3'
          - '2'
          - '1'
          type: string
      responses:
        '200':
          description: The list of domains
          content:
            application/json:
              schema:
                required:
                - domains
                type: object
                properties:
                  domains:
                    required:
                    - data
                    type: object
                    properties:
                      data:
                        type: array
                        items:
                          required:
                          - domain
                          - isDefault
                          - redirects
                          type: object
                          properties:
                            domain:
                              type: string
                            isDefault:
                              type: boolean
                            redirects:
                              type: object
                              properties:
                                baseUrlRedirect:
                                  type:
                                  - string
                                  - 'null'
                                  description: URL to redirect to when a user hits the domain's base URL
                                regular404Redirect:
                                  type:
                                  - string
                                  - 'null'
                                  description: URL to redirect to when a user hits a not found URL other than an invalid short URL
                                invalidShortUrlRedirect:
                                  type:
                                  - string
                                  - 'null'
                                  description: URL to redirect to when a user hits an invalid short URL
                      defaultRedirects:
                        type: object
                        properties:
                          baseUrlRedirect:
                            type:
                            - string
                            - 'null'
                            description: URL to redirect to when a user hits the domain's base URL
                          regular404Redirect:
                            type:
                            - string
                            - 'null'
                            description: URL to redirect to when a user hits a not found URL other than an invalid short URL
                          invalidShortUrlRedirect:
                            type:
                            - string
                            - 'null'
                            description: URL to redirect to when a user hits an invalid short URL
              example:
                domains:
                  data:
                  - domain: example.com
                    isDefault: true
                    redirects:
                      baseUrlRedirect: https://example.com/my-landing-page
                      regular404Redirect: null
                      invalidShortUrlRedirect: https://example.com/invalid-url
                  - domain: aaa.com
                    isDefault: false
                    redirects:
                      baseUrlRedirect: null
                      regular404Redirect: null
                      invalidShortUrlRedirect: null
                  - domain: bbb.com
                    isDefault: false
                    redirects:
                      baseUrlRedirect: null
                      regular404Redirect: null
                      invalidShortUrlRedirect: https://example.com/invalid-url
                  defaultRedirects:
                    baseUrlRedirect: https://somewhere.com
                    regular404Redirect: null
                    invalidShortUrlRedirect: null
        default:
          description: Unexpected error.
          content:
            application/problem+json:
              schema:
                required:
                - type
                - title
                - detail
                - status
                type: object
                properties:
                  type:
                    type: string
                    description: A machine unique code
                  title:
                    type: string
                    description: A unique title
                  detail:
                    type: string
                    description: A human-friendly error description
                  status:
                    type: number
                    description: HTTP response status code
      security:
      - ApiKey: []
    servers:
    - url: '{scheme}://{host}'
      variables:
        scheme:
          enum:
          - https
          - http
          default: https
        host:
          default: ''
  /rest/v{version}/domains/redirects:
    patch:
      tags:
      - Domains
      summary: Sets domain "not found" redirects
      description: Sets the URLs that you want a visitor to get redirected to for "not found" URLs for a specific domain
      operationId: setDomainRedirects
      parameters:
      - name: version
        in: path
        description: The API version to be consumed
        required: true
        schema:
          enum:
          - '3'
          - '2'
          - '1'
          type: string
      requestBody:
        description: Request body.
        content:
          application/json:
            schema:
              type: object
              allOf:
              - required:
                - domain
                properties:
                  domain:
                    type: string
                    description: The domain's authority for which you want to set redirects
              - type: object
                properties:
                  baseUrlRedirect:
                    type:
                    - string
                    - 'null'
                    description: URL to redirect to when a user hits the domain's base URL
                  regular404Redirect:
                    type:
                    - string
                    - 'null'
                    description: URL to redirect to when a user hits a not found URL other than an invalid short URL
                  invalidShortUrlRedirect:
                    type:
                    - string
                    - 'null'
                    description: URL to redirect to when a user hits an invalid short URL
        required: true
      responses:
        '200':
          description: The domain's redirects after the update, when existing redirects have been merged with provided ones.
          content:
            application/json:
              schema:
                allOf:
                - required:
                  - baseUrlRedirect
                  - regular404Redirect
                  - invalidShortUrlRedirect
                - type: object
                  properties:
                    baseUrlRedirect:
                      type:
                      - string
                      - 'null'
                      description: URL to redirect to when a user hits the domain's base URL
                    regular404Redirect:
                      type:
                      - string
                      - 'null'
                      description: URL to redirect to when a user hits a not found URL other than an invalid short URL
                    invalidShortUrlRedirect:
                      type:
                      - string
                      - 'null'
                      description: URL to redirect to when a user hits an invalid short URL
              example:
                baseUrlRedirect: https://example.com/my-landing-page
                regular404Redirect: null
                invalidShortUrlRedirect: https://example.com/invalid-url
        '400':
          description: Provided data is invalid.
          content:
            application/problem+json:
              schema:
                type: object
                allOf:
                - required:
                  - type
                  - title
                  - detail
                  - status
                  type: object
                  properties:
                    type:
                      type: string
                      description: A machine unique code
                    title:
                      type: string
                      description: A unique title
                    detail:
                      type: string
                      description: A human-friendly error description
                    status:
                      type: number
                      description: HTTP response status code
                - required:
                  - invalidElements
                  type: object
                  properties:
                    invalidElements:
                      type: array
                      items:
                        enum:
                        - domain
                        - baseUrlRedirect
                        - regular404Redirect
                        - invalidShortUrlRedirect
                        type: string
              examples:
                API v3 and newer:
                  value:
                    title: Invalid data
                    type: https://shlink.io/api/error/invalid-data
                    detail: Provided data is not valid
                    status: 400
                    invalidElements:
                    - domain
                    - invalidShortUrlRedirect
                Previous to API v3:
                  value:
                    title: Invalid data
                    type: INVALID_ARGUMENT
                    detail: Provided data is not valid
                    status: 400
                    invalidElements:
                    - domain
                    - invalidShortUrlRedirect
        default:
          description: Unexpected error.
          content:
            application/problem+json:
              schema:
                required:
                - type
                - title
                - detail
                - status
                type: object
                properties:
                  type:
                    type: string
                    description: A machine unique code
                  title:
                    type: string
                    description: A unique title
                  detail:
                    type: string
                    description: A human-friendly error description
                  status:
                    type: number
                    description: HTTP response status code
      security:
      - ApiKey: []
    servers:
    - url: '{scheme}://{host}'
      variables:
        scheme:
          enum:
          - https
          - http
          default: https
        host:
          default: ''
components:
  securitySchemes:
    ApiKey:
      type: apiKey
      description: A valid shlink API key
      name: X-Api-Key
      in: header
externalDocs:
  description: Find more info on how to start using this API here
  url: https://shlink.io/documentation/api-docs
x-refined-from:
- shlink-openapi-v5.1.4.json
- shlink-openapi-v5.1.0.json
- shlink-openapi.json