# Team API & Webhooks
Teams unlock the **REST API** and **webhook integrations**. Create API keys to access contacts programmatically and set up webhooks to receive real-time notifications when data changes.
> [!quote] Connect Everything
> Use the API and webhooks to ==integrate RelayBook with your existing tools==.
## API Keys
API keys authenticate requests to the RelayBook REST API. Each key is scoped to your team's books.
### Creating an API Key
1. Open the **Team Dashboard** and go to **API & Webhooks**
2. Click **Create API Key**
3. Give it a descriptive name (e.g. "CRM Sync", "Website Form")
4. Copy the key immediately — it's only shown once
> [!note] Key format
> API keys start with `rlb_` followed by a unique string. Store them securely — they grant full access to your team's contacts.
### Using the API
Authenticate by passing your API key as a Bearer token:
```
Authorization: Bearer rlb_your_key_here
X-Book-ID: your-book-id
```
The API supports full CRUD operations on contacts, books, and labels. See the [[Introduction|API Reference]] for complete endpoint documentation.
### Available Endpoints
| Method | Endpoint | Description |
|--------|----------|-------------|
| `GET` | `/api/v1/contacts` | [[Contacts\|List contacts]] (paginated) |
| `GET` | `/api/v1/contacts/:id` | [[Contacts\|Get a single contact]] |
| `POST` | `/api/v1/contacts` | [[Contacts\|Create a contact]] |
| `PATCH` | `/api/v1/contacts/:id` | [[Contacts\|Update a contact]] |
| `DELETE` | `/api/v1/contacts/:id` | [[Contacts\|Delete a contact]] |
| `GET` | `/api/v1/books` | [[Books & Labels\|List books]] |
| `GET` | `/api/v1/books/:id` | [[Books & Labels\|Get a book]] |
| `GET` | `/api/v1/books/:id/labels` | [[Books & Labels\|List labels for a book]] |
| `POST` | `/api/v1/contacts/:id/labels` | [[Books & Labels\|Add label to contact]] |
| `DELETE` | `/api/v1/contacts/:id/labels/:lid` | [[Books & Labels\|Remove label from contact]] |
### Rate Limiting
The API allows **100 requests per minute** per API key. Rate limit headers are included in every response. See [[Introduction|Rate Limiting]] for details.
### Revoking a Key
Click **Revoke** next to any API key. The key stops working immediately. This cannot be undone — create a new key if needed.
## Webhooks
Webhooks send HTTP POST requests to your server when events happen in RelayBook. See the full [[Webhooks|Webhook Reference]] for payload formats, signature verification, and retry logic.
### Creating a Webhook
1. Go to **API & Webhooks** in the Team Dashboard
2. Click **Create Webhook**
3. Enter the **URL** to receive events
4. Select the **events** you want to listen for
5. Copy the **signing secret** — it's only shown once
### Available Events
| Event | Trigger |
|-------|---------|
| `contact.created` | A contact is added to a team book |
| `contact.updated` | A contact's details are changed |
| `contact.deleted` | A contact is removed |
| `member.joined` | A new member joins the team |
| `member.removed` | A member is removed from the team |
| `book.created` | A book is assigned to the team |
| `book.deleted` | A book is removed from the team |
### Verifying Webhooks
Each webhook request includes an `X-Relay-Signature` header containing an HMAC-SHA256 signature. Verify this against your signing secret to confirm the request came from RelayBook. See [[Webhooks|Verifying Signatures]] for code examples in Node.js, Python, and Go.
### Delivery & Retries
Failed deliveries are automatically retried up to 3 times with exponential backoff (10s, 60s, 5min). Only network errors and 5xx responses trigger retries — 4xx errors are not retried. See [[Webhooks|Delivery & Retries]] for the full retry schedule.
### Delivery Logs
View recent deliveries for each webhook, including:
- HTTP status code
- Response time
- Success or failure
> [!tip] Debugging
> Use the delivery logs to troubleshoot failed webhooks. Check the response status and ensure your endpoint is returning a 2xx response.
## Developer Reference
For complete API documentation with request/response examples, error codes, and code samples:
- **[[Introduction|API Reference]]** — Authentication, rate limiting, error handling
- **[[Contacts|Contacts API]]** — Create, read, update, delete contacts
- **[[Books & Labels|Books & Labels API]]** — List books, manage labels
- **[[Webhooks|Webhooks Reference]]** — Events, payloads, signatures, retries
- **[[Examples & Use Cases]]** — Integration scenarios (CRM sync, Slack, Zapier, and more)
> [!success] The Key Idea
> API keys and webhooks let you build integrations on top of RelayBook. Read and write contacts programmatically, and get notified in real-time when data changes. RelayBook becomes the ==central hub== that relays contact data between your systems.
---
**Next:** Learn about finding and merging [[Duplicate Contacts]].