# Send requests automatically from your app with the API

Source: https://help.testimonials.ltd/articles/send-requests-with-the-api

To send a testimonial request from your own app, create an API key under **Requests**, **Settings**, **API**, then call our trigger endpoint from your server, for example when an order is delivered or a project is finished.

## Create an API key

1. Click **Requests** in the top menu.
2. Open the **Settings** tab, then **API**.
3. Under **Your API keys**, generate a key. Keys start with `treq_`.
4. Store the key on your server. Never put it in website code that runs in the browser.

You can revoke a key at any time from the same place.

## Call the endpoint

Send a `POST` request to `https://api.testimonials.ltd/api/requests/trigger/` with the header `Authorization: Bearer YOUR_KEY` and a JSON body:

- `recipient_email` (required)
- `recipient_name` (optional)
- `event` (optional, a label for what happened, for example `order_delivered`)
- `delay_hours` (optional, default 0)
- `form_slug` (optional, which form to link to)
- `template_id` (optional, which template to use)

## What you get back

- **201** with the request queued or sent.
- **201** with status `skipped` when the person was asked recently, already left a testimonial, or is suppressed. Skips do not count against your allowance.
- **429** when your plan's request email allowance is used up.

## Let your AI assistant set it up

The **API** tab has a **Hand this to your AI** prompt. Copy it into your coding assistant and it will add the call to your app.

## Related articles

- [Request email limits and why some emails are not sent](https://help.testimonials.ltd/articles/request-email-limits)
- [Ask for testimonials inside your product](https://help.testimonials.ltd/articles/in-app-prompt)
- [Send testimonial requests by email](https://help.testimonials.ltd/articles/send-testimonial-requests-by-email)
