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

# API and webhooks

The API section in PullRule gives developers the tools to **integrate, automate**, and **extend** the functionality of
PullRule using secure programmatic access.

This guide explains how to use **API keys** for authenticated access and **Webhooks** for real-time event notifications.

## API keys

API keys allow you to **authenticate and authorise** requests made to PullRule's endpoints.

### How to create an API key

1. Go to the **Settings** page in PullRule.
2. Navigate to the **API** section.
3. Click on **New API Key**.
4. Follow the prompts to name your key and set permissions.

<Note>Treat API keys like passwords. Keep them secret and rotate regularly.</Note>

## Webhooks

**Webhooks** allow PullRule to **notify your systems** in real-time when specific events occur, such as when a new pull
request is created or updated.

### How to set up a webhook

1. Go to the **Settings** page in PullRule.
2. Navigate to the **API** section.
3. Click on **New Webhook** button.
4. Enter the **URL** where you want to receive notifications.
5. Select the **events** you want to subscribe to, such as `pull_request.scored` or `pull_request.synced`.
6. Save the webhook configuration.
