> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bit2connect.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Check Code Availability

> Verify if a custom short code is available before creating a link

## Overview

Check if a custom short code is available for use in your project. This endpoint helps you verify code availability before creating a new dynamic link, preventing conflicts and ensuring your preferred codes are available.

## Endpoint

<CodeGroup>
  ```bash Public API theme={null}
  GET https://api.bit2connect.com/1.0/links/check/{code}
  ```

  ```bash Headers Required theme={null}
  X-API-KEY: b2co_your_api_key_here
  ```
</CodeGroup>

## Path Parameters

For detailed information about path parameters, see the [Check Code Availability API Reference](/api-reference/links/check-code).

## Example Request

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET "https://api.bit2connect.com/1.0/links/check/summer-sale-2024" \
    -H "X-API-KEY: b2co_your_api_key_here"
  ```

  ```javascript JavaScript theme={null}
  const code = "summer-sale-2024";
  const response = await fetch(
    `https://api.bit2connect.com/1.0/links/check/${code}`,
    {
      headers: {
        "X-API-KEY": "b2co_your_api_key_here",
      },
    }
  );

  const data = await response.json();
  console.log(`Code "${code}" available:`, data.data.available);
  ```

  ```python Python theme={null}
  import requests

  code = "summer-sale-2024"
  url = f"https://api.bit2connect.com/1.0/links/check/{code}"
  headers = {
      "X-API-KEY": "b2co_your_api_key_here"
  }

  response = requests.get(url, headers=headers)
  data = response.json()

  if data['data']['available']:
      print(f"✅ Code '{code}' is available!")
  else:
      print(f"❌ Code '{code}' is not available")
  ```
</CodeGroup>

## Response

### Available Code Response

```json theme={null}
{
  "success": true,
  "data": {
    "code": "summer-sale-2024",
    "available": true
  },
  "timestamp": "2024-01-15T10:30:00Z"
}
```

### Unavailable Code Response

```json theme={null}
{
  "success": true,
  "data": {
    "code": "summer-sale",
    "available": false,
    "message": "Code is already in use in this project"
  },
  "timestamp": "2024-01-15T10:30:00Z"
}
```

### Error Response

```json theme={null}
{
  "success": false,
  "error": {
    "code": "INVALID_CODE_FORMAT",
    "message": "Code must be 3-50 characters and contain only alphanumeric characters, hyphens, and underscores"
  }
}
```

For detailed response fields, error codes, code requirements, and workflow integration examples, see the [Check Code Availability API Reference](/api-reference/links/check-code).

## Next Steps

<CardGroup cols={2}>
  <Card title="Create Link" icon="plus" href="/guides/create-link">
    Create a new dynamic link with your verified code
  </Card>

  <Card title="List Links" icon="list" href="/guides/list-links">
    View all your existing dynamic links
  </Card>

  <Card title="Get Link Details" icon="eye" href="/guides/get-link">
    Check details of existing links
  </Card>

  <Card title="Update Link Status" icon="toggle-on" href="/guides/update-link-status">
    Manage your link statuses
  </Card>
</CardGroup>
