# Connecting to the API

> Test your Aerostack API connection and verify your API key is correctly configured. The first step for any SDK or REST integration.

Aerostack provides a dedicated endpoint to verify your API connection and ensure your API key is correctly configured. This is the recommended first step when integrating with the Aerostack API.

## Connection Test Endpoint

Use this endpoint to "ping" the API and verify that you can access your project.

### Endpoint

`GET https://api.aerostack.dev/v1/public/projects/:projectSlug/connect`

### Headers

| Header | Value | Description |
| :--- | :--- | :--- |
| `X-API-Key` | `YOUR_API_KEY` | **Required**. Your project's secret API Key. |

### Example Request

```bash
curl -X GET https://api.aerostack.dev/v1/public/projects/my-project-slug/connect \
  -H "X-API-Key: ak_Live_..."
```

### Success Response

If your API key is valid and matches the project, you will receive a `200 OK` response:

```json
{
  "success": true,
  "message": "Successfully connected to project 'My Awesome Project'",
  "project": {
    "name": "My Awesome Project",
    "slug": "my-project-slug",
    "id": "proj_123456789"
  }
}
```

### Error Responses

- **401 Unauthorized**: API Key is missing or invalid.
- **403 Forbidden**: API Key is valid but does not belong to the specified project.
- **404 Not Found**: The project slug is incorrect.

## Next Steps

Once you have successfully connected:

1.  **Browse Components**: Use `/v1/public/projects/:slug/components` to see your schema.
2.  **Fetch Content**: Use `/v1/public/projects/:slug/collections/:collection_slug/items` to get your data.
