> For the complete documentation index, see [llms.txt](https://help.openletterconnect.com/olc-help-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.openletterconnect.com/olc-help-docs/developer-resources/api-docs.md).

# API Docs

{% embed url="<https://api-docs.openletterconnect.com/>" %}

### How to Generate API Keys & Webhooks

{% embed url="<https://www.loom.com/share/54e8fb0a0d514ecc88609ee4bc130f4c>" %}

## Part 1: Create an API Key

An API key allows an external application or integration to authenticate with Open Letter Connect.

#### Step 1: Open API Keys

1. Click your initials on the top right corner and then click **Integrations.**
2. Click **API Keys**.

You will be taken to the **API Keys** page, where existing API keys are displayed.

<figure><img src="https://3163187684-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSP96nBmkaaFJC8FJquKi%2Fuploads%2FFdfwUraKkrRJoVMrL49A%2Fimage.png?alt=media&amp;token=a19d37dc-8d8c-4f6f-954a-2c075c51baa3" alt=""><figcaption></figcaption></figure>

#### Step 2: Click **+ Create**

On the API Keys page, look at the **top-right corner**.

Click the orange **+ Create** button.

A **Create API Key** window will appear

<figure><img src="https://3163187684-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSP96nBmkaaFJC8FJquKi%2Fuploads%2FjhbEAdItfrpusLzNBE61%2Fimage.png?alt=media&amp;token=8f6ae6a6-fcf6-4238-9c31-0e0d5e6bcd8c" alt=""><figcaption></figcaption></figure>

#### Step 3: Enter the API Key Name

In the **Name** field, enter a name that describes what the API key will be used for.

For example:

> `Zapier Integration`

A descriptive name makes it easier to identify the purpose of the key later.\ <br>

<figure><img src="https://3163187684-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSP96nBmkaaFJC8FJquKi%2Fuploads%2F0uona95fnm8EGxQVpZlh%2Fimage.png?alt=media&amp;token=54428041-9327-4174-b45f-69f90047e4fe" alt=""><figcaption></figcaption></figure>

***

#### Step 4: Select the Source

Click the **Source** dropdown.

Select the appropriate source for your integration.

**Source is required.**

***

#### Step 5: Set an Expiry Date — Optional

The **Expiry Date** field is optional.

Click the **Expiry Date** dropdown if you want the API key to expire on a specific date.

If you don't need an expiration date, leave the field blank.

***

#### Step 6: Save the API Key

After completing the required fields:

1. Review the **Name**.
2. Confirm the **Source**.
3. Confirm the **Expiry Date**, if applicable.
4. Click the **Save** button.\ <br>

   <figure><img src="https://3163187684-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSP96nBmkaaFJC8FJquKi%2Fuploads%2FwfnJkIfvkgdzAQy0AcDO%2Fimage.png?alt=media&amp;token=83e968c9-5e24-4713-9bf3-c7282d84c826" alt=""><figcaption></figcaption></figure>

<h4 align="center">You can now easily copy and paste your API keys.</h4>

<figure><img src="https://3163187684-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSP96nBmkaaFJC8FJquKi%2Fuploads%2FzkZVip7LDGFm6EJUW8ln%2Fimage.png?alt=media&amp;token=600ea622-8739-4199-85d6-0796fd8d6356" alt=""><figcaption></figcaption></figure>

> **Security reminder:** Treat API keys as confidential credentials. Store them securely and do not share them in public code, screenshots, or messages.

***

## Part 2: Create a Webhook

Webhooks allow Open Letter Connect to automatically send information to another system when selected events occur.

***

#### Step 1: Open Webhooks

1. Click your initials on the top right corner and then click **Integrations.**
2. Click **Webhooks**.

You will be taken to the Webhooks management page.

<figure><img src="https://3163187684-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSP96nBmkaaFJC8FJquKi%2Fuploads%2FFdfwUraKkrRJoVMrL49A%2Fimage.png?alt=media&amp;token=a19d37dc-8d8c-4f6f-954a-2c075c51baa3" alt=""><figcaption></figcaption></figure>

***

#### Step 2: Click **Create**

On the Webhooks page, click the **Create** button.

OLC will take you to the **Create Webhook** page.

<figure><img src="https://3163187684-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSP96nBmkaaFJC8FJquKi%2Fuploads%2FtTfvoWwnXYpkYGlHthFh%2Fimage.png?alt=media&amp;token=882fb6e6-8cb7-4f60-9948-b1f6f2161c21" alt=""><figcaption></figcaption></figure>

***

#### Step 3: Enter the Webhook URL

At the top of the page, you'll see:

**URL\***

Enter the URL of the endpoint where you want Open Letter Connect to send webhook notifications.

For example:

> `https://yourcompany.com/api/webhooks/olc`

The URL should point to a system that is configured to receive webhook requests.

**This field is required.**

<figure><img src="https://3163187684-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSP96nBmkaaFJC8FJquKi%2Fuploads%2FozXEOymISvMiCsJmCzzz%2Fimage.png?alt=media&amp;token=9883a5a1-cb20-4022-8e31-7bda11d84451" alt=""><figcaption></figcaption></figure>

***

#### Step 4: Add a Description

In the **Description\*** field, enter a short description explaining what the webhook is used for.

For example:

> `Production order notifications`

or

> `Send OLC order updates to CRM`

**This field is required.**

A clear description makes it easier to identify the webhook later.

***

#### Step 5: Add Custom Headers — Optional

The **Custom Headers** field can be used if your receiving system requires additional HTTP headers.

For example, your endpoint may require an authentication header.

Enter the required header information in this field.

If your endpoint doesn't require custom headers, you can leave this blank.

***

#### Step 6: Add a Slack Failure Notification — Optional

On the right side of the screen you'll see:

**Slack Incoming Webhook URL (For Failure Notifications)**

If you want webhook failure notifications sent to Slack:

1. Enter your Slack Incoming Webhook URL.
2. OLC can use this URL to send failure notifications.

If you don't need Slack notifications, leave this field blank.

***

#### Step 7: Select Event Types

Click the **Event Types** dropdown.

Select the events you want Open Letter Connect to send to your webhook.

For example, OLC documents events including:

* **Order Created** — `orders.created`
* **Order Updated** — `orders.updated`
* **Template Created** — `templates.created`
* **Template Updated** — `templates.updated`
* **Order Item Updated** — `order_items.updated`
* **Order Item QR Scanned** — `order_items.qr_code_scanned`

**Event Types is required.**

***

#### Step 8: Review the Sample Payload

Once you select an event type, the **Sample Payloads for Selected Event Types** section will populate.

Use this section to see an example of the information OLC will send to your webhook endpoint.

This will change after you select one or more event types.

#### Step 9: Save the Webhook

After completing the configuration:

1. Confirm the **URL**.
2. Confirm the **Description**.
3. Review any **Custom Headers**.
4. Confirm the **Event Types**.
5. Review the sample payload.
6. Click the orange **Save** button in the bottom-right corner.

OLC will create the webhook and return you to the Webhooks management page.

<figure><img src="https://3163187684-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSP96nBmkaaFJC8FJquKi%2Fuploads%2FfUcorqkJIADFScgVxqWo%2Fimage.png?alt=media&amp;token=4541703e-5251-4c9b-bb70-e12ef583f1ae" alt=""><figcaption></figcaption></figure>
