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

# API Reference

> Complete reference for the SeerStack REST API

The SeerStack API allows you to send events, identify users, and track behavior in your applications. All API requests require authentication using a Bearer token.

## Base URL

All API requests should be made to:

```
https://api.seerstack.com
```

## Authentication

Authenticate your requests by including your API key as a Bearer token in the `Authorization` header.

```bash theme={null}
Authorization: Bearer sk_live_your_api_key
```

You can find your API key in the [SeerStack Dashboard](https://app.seerstack.com) under **Settings > Developer**.

> [!WARNING]
>
> Keep your API key secure. Never expose it in client-side code or commit it to version control.

## SDKs

We provide official SDKs for TypeScript and Ruby that handle authentication and provide a better developer experience.

> [card] [TypeScript SDK](https://www.npmjs.com/package/seerstack)
>
> ```bash theme={null}
> npm install seerstack
> ```

> [card] [Ruby SDK](https://rubygems.org/gems/seerstack)
>
> ```bash theme={null}
> gem install seerstack
> ```

## Quick Examples

> [tab] TypeScript
>
> ```typescript theme={null}
> import Seerstack from 'seerstack';
>
> const client = new Seerstack({
>   apiKey: process.env['SEERSTACK_API_KEY'],
> });
>
> // Send an event
> await client.events.capture({
>   name: 'user.signup',
>   user_id: 'user_123',
>   data: { plan: 'pro' }
> });
>
> // Identify a user
> await client.users.identify({
>   user_id: 'user_123',
>   email: 'user@example.com',
>   name: 'Jane Doe'
> });
> ```

> [tab] Ruby
>
> ```ruby theme={null}
> require "seerstack"
>
> seerstack = Seerstack::Client.new(
>   api_key: ENV["SEERSTACK_API_KEY"]
> )
>
> # Send an event
> seerstack.events.capture(
>   name: "user.signup",
>   user_id: "user_123",
>   data: { plan: "pro" }
> )
>
> # Identify a user
> seerstack.users.identify(
>   user_id: "user_123",
>   email: "user@example.com",
>   name: "Jane Doe"
> )
> ```

> [tab] cURL
>
> ```bash theme={null}
> # Send an event
> curl -X POST https://api.seerstack.com/capture \
>   -H "Authorization: Bearer $SEERSTACK_API_KEY" \
>   -H "Content-Type: application/json" \
>   -d '{"name": "user.signup", "user_id": "user_123"}'
>
> # Identify a user
> curl -X POST https://api.seerstack.com/identify \
>   -H "Authorization: Bearer $SEERSTACK_API_KEY" \
>   -H "Content-Type: application/json" \
>   -d '{"user_id": "user_123", "email": "user@example.com"}'
> ```

## Response Format

All successful responses return a JSON object with a `success` field:

```json theme={null}
{
  "success": true
}
```

Error responses include an `error` field with a human-readable message:

```json theme={null}
{
  "error": "Missing or invalid API key"
}
```

## Rate Limits

The API allows up to 1,000 requests per minute per API key.


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