---
title: "Get a link's routing"
method: GET
path: "/urls/{code}/routing"
tags: ["Routing Rules"]
---

# Get a link's routing

`GET /urls/{code}/routing`

## Request

- Base URL: `https://gajo.io/api/v1`
- URL: `https://gajo.io/api/v1/urls/{code}/routing`
- Auth: API key in header `x-api-key`

**Requires a Pro plan.** Returns the link's per-URL routing rules (ordered by priority) and, if present, its active template binding. At redirect time a binding takes precedence over per-URL rules.

## Response `200`

Routing rules and binding.

- RoutingOverviewResult: Envelope shared by every response.
  - `success` true, required: `true` when the request succeeded.
  - `message` string, nullable: Human-readable status or error message. Often `null` on reads.
  - `data` object, required: Operation-specific payload; `null` or absent when there is nothing to return.
    - `shortCode` string, required
    - `rules` RoutingRule[], required: Per-URL rules, ordered by priority.
      - `id` integer, required: Rule ID, used by `PUT`/`DELETE /urls/{code}/routing/{ruleId}`.
      - `ruleType` 'Device' | 'AbTest', required: `Device` routes by device class; `AbTest` splits traffic by percentage.
      - `priority` integer, required: Position within the batch the rule was created in (0-based).
      - `active` boolean, required
      - `deviceType` 'Mobile' | 'Tablet' | 'Desktop', required: Device class for per-URL `Device` rules.
      - `targetUrl` string, required: Destination for matching clicks.
      - `variantName` string, nullable, required: Set on `AbTest` rules.
      - `splitPercentage` integer, nullable, required: Set on `AbTest` rules.
      - `createdDate` string, date-time, required
    - `binding` Binding, required: A link's template binding. When `bound` is `false`, only `shortCode` and `bound` are returned.
      - `shortCode` string
      - `bound` boolean, required
      - `routingType` 'Device' | 'AbTest': `Device` routes by device class; `AbTest` splits traffic by percentage.
      - `templateName` string, nullable: Name of the bound route or A/B template, or `null` if it was deleted (the link then uses its original destination).
      - `routeTemplateId` integer, nullable: Numeric ID of the bound route template (`null` for A/B bindings). Deprecated: use `templateName`.
      - `abTemplateId` integer, nullable: Numeric ID of the bound A/B template (`null` for Device bindings). Deprecated: use `templateName`.
      - `createdDate` string, date-time
      - `endpoints` Endpoint[]
        - `slotKey` string, required: Device slot (Device bindings) or variant name (A/B bindings).
        - `targetType` 'Url' | 'RouteTemplate', required: `Url` (default) sends the slot to `targetUrl`. `RouteTemplate` is reserved for chaining an A/B variant to a route template; this is not fully supported yet, so use `Url` targets.
        - `targetUrl` string, nullable, required
        - `fallbackUrl` string, nullable, required: Web fallback when `targetUrl` is an app deep link and the app is not installed.
        - `routeTemplateName` string, nullable, required: Name of the chained route template when `targetType` is `RouteTemplate` (`null` otherwise, or if it was deleted).
        - `routeTemplateId` integer, nullable, required: Numeric ID of the chained route template when `targetType` is `RouteTemplate`. Deprecated: use `routeTemplateName`.
        - `endpointName` string, nullable, required: Optional label.

## Other responses

- `401`: The `x-api-key` header is missing, or the key is unknown or revoked.
- `403`: Your plan is not Pro (the message names the Pro feature).
- `404`: No link with this code exists on your account.
- `429`: Per-minute rate limit exceeded. Wait `Retry-After` seconds.
- `500`: Unexpected server error.

---

[API](https://skmtc.dev/gajo/apis/gajo-api.md) · [All operations](https://skmtc.dev/gajo/apis/gajo-api/llms.txt) · [OpenAPI document](https://skmtc.dev/gajo/apis/gajo-api/revisions/de6fe920cc26?raw)
