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

# Authentication

> How to authenticate with the Writesonic GEO API using your API key.

All API requests require an `X-API-KEY` header with your Writesonic API key.

```bash theme={"system"}
curl --request POST \
  --url https://api.writesonic.com/v2/geo/business/prompts \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: <your-api-key>' \
  --data '{
    "project_id": "your-project-id"
  }'
```

## How to Find Your API Key

**1. Log in to Writesonic**

Go to [app.writesonic.com](https://app.writesonic.com) and sign in with your account.

**2. Open the API Dashboard**

Hover over your profile picture in the top-right corner and select **API Dashboard** from the menu.

**3. Activate the API**

Find the activation toggle and switch it **on** to enable API access.

**4. Reveal your API key**

Click the **Reveal API Key** button. Your key will be displayed — click to copy it.

> [!WARNING]
>
> Never commit your API key to public repositories (GitHub, GitLab, Bitbucket) or store it in client-side code. Use environment variables or a secrets manager.

## Base URL

All GEO API endpoints use the following base URL:

```
https://api.writesonic.com
```

## Authentication Header

| Header | Value | Required |
| - | - | - |
| `X-API-KEY` | Your Writesonic API key | Yes |
| `Content-Type` | `application/json` | Yes |

## Error Responses

| Status Code | Meaning |
| - | - |
| `401` | Missing or invalid API key |
| `403` | API key valid but insufficient permissions |
| `422` | Validation error in request body |
| `429` | Rate limit exceeded |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.