# at.happyproto.server.checkSlug

> Published by [happyproto.at](https://lexicon.garden/identity/did:plc:mo7vq4jbioxwafy5zkcc3eux)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:mo7vq4jbioxwafy5zkcc3eux/at.happyproto.server.checkSlug)
- [Documentation](https://lexicon.garden/lexicon/did:plc:mo7vq4jbioxwafy5zkcc3eux/at.happyproto.server.checkSlug/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:mo7vq4jbioxwafy5zkcc3eux/at.happyproto.server.checkSlug/examples)

## Definitions

### `at.happyproto.server.checkSlug`

**Type**: `query`

Whether a slug can be used for a new instance. Customers only. An invalid or reserved slug is answered without asking the provisioner.

#### Parameters

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `slug` | `string` | Yes |  |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `available` | `boolean` | Yes |  |
| `reason` | `string` | No | Why not, when it is not available. |

#### Errors

- **AuthRequired**: This endpoint requires an authenticated caller.
- **Forbidden**: The caller is not a HappyProto customer, or the provisioner refused them.
- **InvalidRequest**: slug is missing.
- **NotFound**: Passed through from the provisioner.
- **InvalidSlug**: Passed through from the provisioner.
- **SlugTaken**: Passed through from the provisioner.
- **NotEntitled**: Passed through from the provisioner.
- **InstanceLimit**: Passed through from the provisioner.
- **NoCapacity**: Passed through from the provisioner.
- **OperationInProgress**: Passed through from the provisioner.
- **Upstream**: The provisioner is unreachable, not configured, or answered with an error it does not explain to callers.

## Raw Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Whether a slug can be used for a new instance. Customers only. An invalid or reserved slug is answered without asking the provisioner.",
      "errors": [
        {
          "description": "This endpoint requires an authenticated caller.",
          "name": "AuthRequired"
        },
        {
          "description": "The caller is not a HappyProto customer, or the provisioner refused them.",
          "name": "Forbidden"
        },
        {
          "description": "slug is missing.",
          "name": "InvalidRequest"
        },
        {
          "description": "Passed through from the provisioner.",
          "name": "NotFound"
        },
        {
          "description": "Passed through from the provisioner.",
          "name": "InvalidSlug"
        },
        {
          "description": "Passed through from the provisioner.",
          "name": "SlugTaken"
        },
        {
          "description": "Passed through from the provisioner.",
          "name": "NotEntitled"
        },
        {
          "description": "Passed through from the provisioner.",
          "name": "InstanceLimit"
        },
        {
          "description": "Passed through from the provisioner.",
          "name": "NoCapacity"
        },
        {
          "description": "Passed through from the provisioner.",
          "name": "OperationInProgress"
        },
        {
          "description": "The provisioner is unreachable, not configured, or answered with an error it does not explain to callers.",
          "name": "Upstream"
        }
      ],
      "output": {
        "encoding": "application/json",
        "schema": {
          "properties": {
            "available": {
              "type": "boolean"
            },
            "reason": {
              "description": "Why not, when it is not available.",
              "knownValues": [
                "invalid",
                "reserved",
                "taken"
              ],
              "type": "string"
            }
          },
          "required": [
            "available"
          ],
          "type": "object"
        }
      },
      "parameters": {
        "properties": {
          "slug": {
            "type": "string"
          }
        },
        "required": [
          "slug"
        ],
        "type": "params"
      },
      "type": "query"
    }
  },
  "id": "at.happyproto.server.checkSlug",
  "lexicon": 1
}
```
