# How-to guides

URL: https://lyeve.com/docs/how-to/

Each recipe starts from one goal and walks you to a working result, following one reasonable
path rather than every option. They assume LyEve is running. If it is not, start with
[Installation](https://lyeve.com/docs/getting-started/installation/) and the
[Quickstart](https://lyeve.com/docs/getting-started/quickstart/). To learn what a feature does, read its page in
[Features](https://lyeve.com/docs/features/). To look up a route or a setting, use the reference.

## The recipes

Each recipe stands on its own. Do them in any order.

| Recipe | What you end up with | Needs |
|---|---|---|
| [Send webhooks on events](https://lyeve.com/docs/how-to/add-a-webhook/) | An endpoint of yours called when content changes, with the signature checked and failed deliveries recovered | Free. Retry policies and resending need `webhook-pro`, and replaying a window needs `events` |
| [Change a setting](https://lyeve.com/docs/how-to/change-a-setting/) | A setting changed where your deployment keeps it, applied with the right restart, and confirmed in LyEve Console | Free |
| [Automate the Admin API with admin tokens](https://lyeve.com/docs/how-to/admin-tokens/) | A credential for a CI job or script: chosen grants, one tenant, an expiry of at most 90 days, rotation and a request log | Free |
| [Back up and restore tenants](https://lyeve.com/docs/how-to/backup-and-restore/) | One tenant exported, validated and restored, backup jobs writing encrypted archives to S3, and a tenant cloned | `tenant-backup` |
| [Build a custom API with flows](https://lyeve.com/docs/how-to/build-a-custom-api-with-flows/) | One `GET` endpoint joining three content types, tested, cached, rate limited, published and moved to another tenant | Free. Custom paths and outbound nodes need `flow-pro` |
| [Build a flow with the assistant](https://lyeve.com/docs/how-to/build-a-flow-with-the-assistant/) | A flow you described in plain words, drafted, checked, accepted onto the canvas and refined | `ai` |
| [Start from a flow template](https://lyeve.com/docs/how-to/flow-templates/) | One of the eighteen starter flows created as a draft, supplied with what it needs, and published | Free. Templates that call outside need `flow-pro` |
| [Migrate existing content](https://lyeve.com/docs/how-to/migrate-existing-content/) | Content from WordPress, Strapi, Contentful, a file or another LyEve instance in your content types, or the whole database on another server | Free. Moving the whole database needs `migration-toolkit` |
| [Keep the content model and flows in git](https://lyeve.com/docs/how-to/schema-and-flows-as-code/) | The model and the flows as files in your repository, a CI check that stops a change that drops data, and promotion to production | Free |
| [Harden your instance](https://lyeve.com/docs/how-to/secure-your-instance/) | The secrets, signing, cookies, CORS, proxy, rate limit, API key and password settings a public instance needs | Free. The firewall and trusted devices need `waf` and `device-fingerprint`, and passkey enrollment needs `mfa-pro` |

## Conventions

- **Ports.** Commands use the default ports: `3001` for the Admin API under `/api/admin/` and
  `3002` for the Content API under `/api/v1/`. [Core concepts](https://lyeve.com/docs/concepts/) explains
  the two.
- **Tokens.** Commands read a token from a shell variable such as `$TOKEN`. The
  [quickstart](https://lyeve.com/docs/getting-started/quickstart/) shows how to get one, and an
  [admin token](https://lyeve.com/docs/how-to/admin-tokens/) suits a script.
- **Placeholders.** Values in angle brackets, such as `<tenant-slug>`, stand for your own.
  Replace them before you run a command.
- **Databases.** Every recipe works on PostgreSQL 15 to 18, MySQL 8.0 or 8.4, and SQL Server or Azure SQL.

To check that an instance answers on both ports before you start:

```bash
# Content API: the public key set, no credential needed
curl -s http://localhost:3002/.well-known/jwks.json

# Admin API: the content types, with a token
curl -s -H "Authorization: Bearer $TOKEN" http://localhost:3001/api/admin/schemas
```

## Related

- [Features](https://lyeve.com/docs/features/): what each feature does and whether it is free.
- [Developer guide](https://lyeve.com/docs/guides/developer/): the path for code that calls LyEve.
- [Deployment](https://lyeve.com/docs/deploy/): Docker, Docker Compose, Kubernetes and the hosted platforms.
