# Check a Genie email alias

> Whether an email alias is free for a Genie's email channel (<alias>@stacksync.email); checked in every region.

Source: https://docs.stacksync.com/api-reference/genies/check_genie_email_alias

`GET https://api.stacksync.com/v1/workspaces/{workspace_id}/genies/email-aliases/availability`

- Operation: `check_genie_email_alias`
- Resource: Genies
- Access: read-only

## Authentication

- `Authorization: Bearer <key>`: A workspace API key (workspace_…, created by a workspace owner under Workspace settings > Stacksync API) acts with editor rights on that workspace only; a user API key (user_…, created under Profile > Stacksync API) acts as that user in every workspace they belong to. POST, PUT and PATCH requests must send Content-Type: application/json. Every authentication failure answers 403.

## Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `workspace_id` | integer | Yes | The workspace. List the ones your key can reach with GET /v1/workspaces. |

## Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `alias` | string, 1 to 64 characters, pattern `^[^@]+$` | Yes | The part before @stacksync.email, without the @ |

## Returns

### 200 OK

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `alias` | string | Yes |  |
| `is_available` | boolean | Yes |  |
| `address` | string | Yes |  |
| `reason` | string \| null | No | Why the alias cannot be used, or with whom it is shared; null when it is free |

## Example request

```bash
curl -X GET "https://api.stacksync.com/v1/workspaces/{workspace_id}/genies/email-aliases/availability?alias=my_alias" \
  -H "Authorization: Bearer $STACKSYNC_API_KEY"
```

## Example response (200)

```json
{
  "alias": "<alias>",
  "is_available": false,
  "address": "<address>",
  "reason": "<reason>"
}
```

## Errors

| Status | Meaning | Body |
| --- | --- | --- |
| 400 | Bad Request | `{ "error": string, "msg": string, "field": string \| null }` |
| 403 | Forbidden | `{ "error": string, "msg": string, "field": string \| null }` |

## Related

- [API Reference overview](https://docs.stacksync.com/api-reference): base URLs, regions, pagination, idempotency and errors
- [Authentication](https://docs.stacksync.com/api-reference/authentication): API keys and the 403 answers
- OpenAPI document: https://docs.stacksync.com/openapi.json
- [List Genies](https://docs.stacksync.com/api-reference/genies/list_genies)
- [List Genie logs](https://docs.stacksync.com/api-reference/genies/list_genie_logs)
- [Get a Genie](https://docs.stacksync.com/api-reference/genies/get_genie)
- [Create a genie](https://docs.stacksync.com/api-reference/genies/create_genie)
- [Update a Genie](https://docs.stacksync.com/api-reference/genies/update_genie)
- [Delete a Genie](https://docs.stacksync.com/api-reference/genies/delete_genie)