---
title: "Get a code's smart rules"
method: GET
path: "/api/v1/codes/{id}/smart-rules"
tags: ["smart-links"]
---

# Get a code's smart rules

`GET /api/v1/codes/{id}/smart-rules`

## Request

- Base URL: `https://app.qrtap.kg`
- URL: `https://app.qrtap.kg/api/v1/codes/{id}/smart-rules`
- Auth: HTTP bearer

Returns the code's current conditional redirect rules; an empty array means the code always uses its primary destination.

## Path parameters

- `id` string, uuid, required

## Response `200`

Current rule set.

- SmartRulesResponse
  - `code_id` string, uuid, required
  - `version` 1, required: Rule-set schema version (currently always 1).
  - `rules` SmartRule[], required
    - `if` union, required: Evaluated against coarse, already-classified request signals only — never a raw IP, user-agent or Accept-Language header.
      - object
        - `kind` 'device', required
        - `in` string[], required
      - object
        - `kind` 'lang', required
        - `in` string[], required: Primary language subtags, e.g. ["ru","ky"].
      - object
        - `kind` 'hours', required
        - `tz` string, required: IANA timezone, e.g. Asia/Bishkek.
        - `from` string, required
        - `to` string, required: Exclusive. A window where from > to crosses midnight.
        - `days` integer[]: ISO weekdays, 1 = Monday … 7 = Sunday. Omit for every day.
    - `to` string, uri, required: Destination for this rule (http/https).

## Other responses

- `400`: The id path segment is not a UUID.
- `401`: Missing, invalid or revoked API key.
- `404`: No such object in your organization.
- `429`: Limit exceeded — the request had no effect. `error` is `rate_limited` with `scope: "minute"` (a burst brake: wait `retry_after` seconds and continue) or `quota_exceeded` with `scope: "day"` (the workspace's daily quota, counted in UTC; it returns at `reset_at`, the next UTC midnight, and only a higher plan raises it before then).

---

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