# Check a slug

`GET https://app.clik.so/api/links/slug-check`

> **In short:** Tells you whether a short code is free on a domain, so you can check before you create a link.

## You need

* **API key permission:** `read`
* **Workspace role:** viewer or higher
* **Plan:** any plan, including Free

## Example

```bash
curl "https://app.clik.so/api/links/slug-check?slug=summer-sale&domain=clik.is" \
  -H "Authorization: Bearer $CLIKSO_API_KEY"
```

Response 200:

```json
{
  "status": 200,
  "success": true,
  "message": "Success",
  "data": {
    "available": true,
    "slug": "summer-sale"
  }
}
```

## Parameters

| Name     | In    | Type   | Required | Description                                       |
| -------- | ----- | ------ | -------- | ------------------------------------------------- |
| `slug`   | query | string | yes      | The short code to check.                          |
| `domain` | query | string | no       | The domain to check it on. Defaults to `clik.is`. |

## Common errors

| Status | Code               | When                                            |
| ------ | ------------------ | ----------------------------------------------- |
| 401    | `UNAUTHORIZED`     | The API key is missing, malformed or unknown.   |
| 422    | `VALIDATION_ERROR` | The `slug` query parameter is missing.          |
| 429    | `RATE_LIMITED`     | The key went over its per-minute request limit. |

## Good to know

* `available: true` is a snapshot, not a reservation. Someone else can still take the code before you create the link, so handle `409 CONFLICT` on create anyway.
* A code create would refuse comes back as `available: false` with a `reason`: `invalid_format` (the code breaks the format rules — 3 to 30 letters, digits or hyphens, and `/` only as in `acme/launch`), `upgrade_required` (a nested code with `/` on a plan without them — Free; since 1.64.0) or `reserved` (an official-sounding name such as `pricing` on `clik.is`, or a nested code that starts with one). `message` says what to do, in plain English. It is still a `200`.
* The checks run in the order create runs them: format first, then the plan, then reserved names, then whether someone uses it.
* A code someone already uses comes back as just `available: false`, with no `reason`.
* `domain` defaults to `clik.is`.

---

Source: https://clik.so/docs/api/links/check-slug
