> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.feryrides.co.in/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.feryrides.co.in/_mcp/server.

# Authentication

> Authenticate requests to Fery APIs

# Authentication

All requests to Fery APIs require an API key.

## Request header

```http
x-api-key: <API_KEY>
```

> **Warning**
>
> Call Fery APIs from your backend only. Do not embed the API key in client applications.

## Example

```bash
curl --request POST \
  --url https://uat.feryrides.co.in/dmrc/ride/fare-estimate \
  --header 'x-api-key: <API_KEY>' \
  --header 'Content-Type: application/json' \
  --data '{
    "pickupLocation": { "lat": 28.459119, "lng": 77.072912 },
    "dropLocation": { "lat": 28.475482, "lng": 77.088265 }
  }'
```

## Invalid API key

```json
{
  "statusCode": 401,
  "success": false,
  "message": "Unauthorized",
  "errors": {}
}
```

## Webhook authentication

When Fery sends events to your `webhookURL`, each request includes:

```http
secretkey: <WEBHOOK_SECRET>
```

Validate this header before processing the payload. The webhook secret is different from `x-api-key` and is shared by Fery separately.