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

# Automation

> Automate your workflows with webhooks, the API, and built-in integrations

## Webhook-powered workflows

[Webhooks](/developer/guides/webhooks) let you react to events in real time. When something happens in Crevio, your server gets notified.

### Common automations

| Event              | Automation idea                                                               |
| ------------------ | ----------------------------------------------------------------------------- |
| `order.paid`       | Send a custom welcome email, add to your CRM, or trigger a Slack notification |
| `customer.created` | Add the customer to your email marketing tool                                 |
| `invoice.past_due` | Send a reminder or flag the account in your system                            |
| `product.updated`  | Sync product data to your external storefront                                 |

<Tip>
  Crevio has [3,000+ built-in integrations](/integrations/connected-apps) that your AI assistant can use directly. For advanced webhook-based workflows, you can also use services like Zapier or Make.
</Tip>

## API automation

The [Crevio API](/developer/guides/api-overview) lets you programmatically manage your store:

* **Bulk customer creation** -- import customers from another platform
* **Dynamic pricing** -- update price variants based on external factors
* **Order reporting** -- pull order data into your own analytics system
* **Automated discounts** -- create and manage discount codes programmatically

```typescript theme={null}
import { Crevio } from "@crevio/sdk";

const crevio = new Crevio({
  security: { apiKey: "YOUR_API_TOKEN" },
});

// Create a time-limited discount
await crevio.discounts.create({
  code: "FLASH50",
  discountType: "percent_off",
  percentOff: 50,
  maxRedemptions: 100,
  redeemBy: "2026-03-01T00:00:00Z",
});
```

## Discord and Telegram auto-management

Both integrations run automatically once configured:

### Discord

* **On purchase**: Customer is added to your server and assigned the configured role
* **On cancellation**: The configured action runs (remove role, kick, etc.)
* No manual member management needed

### Telegram

* **On purchase**: Customer receives an invite link via the Crevio bot
* **On cancellation**: Customer is removed or banned based on your settings

<Note>
  Both integrations require the customer to connect their account via OAuth. Prompt them during onboarding or on their order confirmation page.
</Note>

## Scheduled publishing

Use the blog's [scheduled publishing](/features/blog#scheduled-publishing) to maintain a consistent content cadence:

1. Write multiple blog posts in advance
2. Set each one to publish at a specific date and time
3. Crevio automatically publishes them on schedule

This keeps your storefront fresh and helps with SEO without requiring you to be online at publish time.
