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

# BluBash API: authentication and getting started

> Everything you need to integrate your application with BluBash — authentication, available APIs, and practical tips for developers.

The BluBash API lets you connect your application directly to the platform so you can send messages through channels, manage campaign audiences, and automate customer communication workflows. All API access is authenticated with a Workspace API Key that you obtain from the admin panel.

## Available APIs

<CardGroup cols={2}>
  <Card title="Channels API" icon="message-circle" href="/developers/api/channels">
    Send text, image, audio, video, and document messages through a configured API channel. Responses are handled by your workspace AI agent.
  </Card>

  <Card title="Campaigns API" icon="megaphone" href="/developers/api/campaigns">
    Add contacts to evergreen campaigns individually or in bulk, schedule sends per contact, cancel queued messages, and inspect message status.
  </Card>
</CardGroup>

## Authentication

Every request to the BluBash API must include your **Workspace API Key** in the `X-API-Key` header.

```http theme={null}
X-API-Key: your_workspace_api_key
Content-Type: application/json
```

<Warning>
  Keep your API key secret. Never expose it in client-side code or public repositories. Treat it with the same care as a password.
</Warning>

### Obtain your API key

<Steps>
  <Step title="Open your workspace admin panel">
    Log in to BluBash and navigate to your workspace.
  </Step>

  <Step title="Go to Settings → API Keys">
    Find the API Keys section under workspace settings.
  </Step>

  <Step title="Generate or copy a key">
    Create a new key or copy an existing one to use in your requests.
  </Step>
</Steps>

## Idempotency

To prevent duplicate messages when retrying failed requests, include the optional `X-Idempotency-Key` header with a unique value per request.

```http theme={null}
X-Idempotency-Key: your_unique_idempotency_key
```

<Tip>
  Use a UUID or a hash derived from the request payload as your idempotency key so the same logical operation is never processed twice.
</Tip>

## Developer tips

* Always use the same `contactIdentifier` value for the same contact to avoid creating duplicates.
* Implement proper error handling for HTTP error responses (`400`, `401`, `404`, `500`).
* Test integrations in a development environment before pointing traffic at production.
* Respect API rate limits — configure your retry logic with exponential backoff.

## Support

If you need help, contact the BluBash support team at [suporte@blubash.io](mailto:suporte@blubash.io).
