# API

BotTalk lets you add, delete, update and fetch articles using RESTful API.

You can also fetch statistics for your audio projects via Reports API.&#x20;

## Authorization

Sign your API Requests by including the following header:

`Authorization: Bearer <apikey>`

You can retrieve your API Key one the project configuration page.&#x20;

Project -> Configure this project -> Content Source

Two types of API keys are available: Write and Read-Only keys. You can re-generate API keys at will.

<figure><img src="https://2378192786-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FirnDC5K5ndnjPJHyDBre%2Fuploads%2FrggDWeb8eGgHcJReIa4v%2Fimage.png?alt=media&#x26;token=0e5519b3-e7ff-4fbb-a6bf-f22eadc95a16" alt=""><figcaption></figcaption></figure>

## Error Handling

If requests fails, you will receive the error response with a detailed description of the issue at hand:

```json
{
  "result": "error",
  "message": "Title is not set or is too short"
}
```

## Webhooks

{% hint style="info" %}
**Good to know:** Webhooks is a premium feature only available on Enterprise plans. Please get in touch with [BotTalk Support](https://bottalk.io/contact) to enable webhooks in your projects.&#x20;
{% endhint %}

Webhooks allow you to subscribe to notifications on article status changes.

Every time [article status](https://docs.bottalk.io/docs/integration/api-reference/articles#article-status) changes, our server will send a POST request to your webhook endpoint with the following body:

```json
{
    "id": "cc35e0996a2e8e449d21d6b646678e7e",
    "status": "ready",
    "title": "Kreisstadt wird bis 2030 weiterwachsen",
    "webhook_id": 42
}
```

`webhook_id` variable is meant to be autoincremented. It can never be the same. Also, it can never decrease.

{% hint style="warning" %}
We won’t check for the response code of your webhook, and we won’t resend this call if your endpoint doesn’t respond.
{% endhint %}
