{
  "swagger": "2.0",
  "info": {
    "title": "Zetaleap URL Shortener",
    "description": "Generate custom branded short links with click tracking inside Power Automate campaigns, SMS notifications, Teams approvals, and customer portals.",
    "version": "1.0.0",
    "contact": {
      "name": "Zetaleap Support Team",
      "url": "https://zetaleap.com/#contact",
      "email": "support_team@zetaleap.com"
    }
  },
  "x-ms-connector-metadata": [
    {
      "propertyName": "Website",
      "propertyValue": "https://zetaleap.com"
    },
    {
      "propertyName": "Privacy policy",
      "propertyValue": "https://zetaleap.com/privacy"
    },
    {
      "propertyName": "Categories",
      "propertyValue": "Marketing;Productivity"
    }
  ],
  "host": "test.zetaleap.com",
  "basePath": "/",
  "schemes": [
    "https"
  ],
  "consumes": [
    "application/json"
  ],
  "produces": [
    "application/json"
  ],
  "securityDefinitions": {
    "api_key": {
      "type": "apiKey",
      "in": "header",
      "name": "Authorization",
      "description": "Enter your Zetaleap Personal Access Token prefixed with Bearer (example: Bearer zl_your_api_token). Generate tokens free at https://zetaleap.com/profile."
    }
  },
  "security": [
    {
      "api_key": []
    }
  ],
  "paths": {
    "/api/shorten": {
      "post": {
        "tags": [
          "URL Shortener"
        ],
        "operationId": "CreateShortUrl",
        "summary": "Create a short link with click tracking",
        "description": "Shortens a long destination URL with an optional custom alias and campaign title.",
        "x-ms-visibility": "important",
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "in": "body",
            "name": "body",
            "required": true,
            "x-ms-summary": "Short Link Request",
            "schema": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "x-ms-summary": "Destination Long URL",
                  "description": "Full destination URL starting with https:// or http://."
                },
                "custom_code": {
                  "type": "string",
                  "x-ms-summary": "Custom Alias (Optional)",
                  "description": "Optional custom slug (3 to 32 alphanumeric/hyphen characters)."
                },
                "title": {
                  "type": "string",
                  "x-ms-summary": "Link Title (Optional)",
                  "description": "Optional friendly campaign or document label."
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Created short link",
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean",
                  "x-ms-summary": "Success"
                },
                "code": {
                  "type": "string",
                  "x-ms-summary": "Short Code"
                },
                "short_url": {
                  "type": "string",
                  "x-ms-summary": "Full Short URL"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "URL Shortener"
        ],
        "operationId": "ListShortUrls",
        "summary": "List created short links and click counts",
        "description": "Retrieves paginated short links and live click metrics for the authenticated account.",
        "x-ms-visibility": "advanced",
        "produces": [
          "application/json"
        ],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "type": "integer",
            "format": "int32",
            "default": 1,
            "required": false,
            "x-ms-summary": "Page Number"
          },
          {
            "name": "limit",
            "in": "query",
            "type": "integer",
            "format": "int32",
            "default": 20,
            "required": false,
            "x-ms-summary": "Items Per Page"
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated short links list",
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean",
                  "x-ms-summary": "Success"
                },
                "total": {
                  "type": "integer",
                  "format": "int32",
                  "x-ms-summary": "Total Links"
                }
              }
            }
          }
        }
      }
    }
  }
}