<a id="a3c4405a1438416aa02a690ad0348cae"></a><a id="a3c4405a-1438-416a-a02a-690ad0348cae"></a>

Learn hooks allow receiving booking notifications at a URL on your platform.

To receive notifications, register a subscription per school and event. Function availability does not automatically activate subscriptions.

## <a id="requisitos" data-help-heading="true"></a>Requirements

You need a valid API key from a Learn administrator and authorized access to the school. If you do not yet have access, coordinate the integration enablement with the school administrator.

If the integration uses a PADMA key, see [How to generate and manage API keys for your school](/help/automatizaciones-e-integraciones-7cc61a2e/derose-app-api-keys-569af84e). The key must be associated with the corresponding user in Learn; creating it does not grant additional permissions.

Prepare an endpoint that accepts POST requests and reads URL parameters.

## <a id="suscripciones" data-help-heading="true"></a>Subscriptions

Each subscription relates:

- A school, identified by its `account_padma_id`.
- A booking event.
- The URL that will receive the notifications.

Learn does not allow repeating the same combination of school, event, and URL. You can register different URLs for the same event.

## <a id="eventos" data-help-heading="true"></a>Events

Use the value from the “Event” column when creating the subscription. The field `event_name` received in the notification includes an additional prefix.

| Event | When it is generated | `event_name` received |
| --- | --- | --- |
| `booking_created` | A confirmed booking is created. | `booking_create-booking_created` |
| `booking_confirmed` | The confirmation of a booking changes, without changing its waitlist status. | `booking_update-booking_confirmed` |
| `booking_on_waiting_list` | A booking is created on the waitlist or a booking moves to that list. | `booking_update-booking_on_waiting_list` |
| `booking_pending_confirmation` | A booking is created unconfirmed and off the waitlist. | `booking_update-booking_pending_confirmation` |
| `booking_promoted` | A booking leaves the waitlist. | `booking_update-booking_promoted` |
| `booking_destroyed` | A booking is deleted. | `booking_destroy-booking_destroyed` |

An unconfirmed created booking does not initially `booking_created`: generate the corresponding event for its status.

## <a id="formato-de-las-notificaciones" data-help-heading="true"></a>Notification format

Learn makes a POST to the registered URL. **Data travel as URL query parameters; the body does not contain a JSON payload.**

This example shows the parameters of a confirmed booking. The values are fictitious and shown unencoded for readability.:

```text
event_name=booking_create-booking_created
data[booked_date]=2026-11-10
data[update_date]=2026-11-10
data[booking_id]=12345
data[booked_class_name]=Clase de ejemplo
data[teacher_username]=instructor_ejemplo
data[contact_id]=contacto_ejemplo
data[recipient_email]=alumno@example.com
data[account_name]=escuela_ejemplo
data[is_trial]=true
```

| Field | Content |
| --- | --- |
| `event_name` | Received event name, with the prefix indicated in the previous table. |
| `data[booked_date]` | Reservation date. |
| `data[update_date]` | Notification preparation date; does not include time. |
| `data[booking_id]` | Reservation ID in Learn. |
| `data[booked_class_name]` | Class name. |
| `data[teacher_username]` | PADMA username of the class author, if available. |
| `data[contact_id]` | PADMA ID of the associated user, if available. |
| `data[recipient_email]` | Email of the associated user or email registered in the reservation. |
| `data[account_name]` | PADMA identifier of the school that owns the class. |
| `data[is_trial]` | Indicates if the reservation is a test. |

Fields without information may arrive empty. For `booking_destroyed`, Learn sends the reservation ID and preparation date; the other fields of `data` remain empty.

Notifications are processed asynchronously. The data reflects the reservation when preparing to send, not an immutable copy of the moment of the event.

## <a id="entrega-y-recepción" data-help-heading="true"></a>Delivery and reception

Prepare the receiver to accept repetitions without duplicating actions. Do not rely on immediate delivery, a specific order, or a guaranteed retry.

Current notifications do not include an authenticity signature. Before using an event for a sensitive action, agree on a validation mechanism for your integration.

<a id="021417f5faf64eb9b84d42d11bed14b5"></a><a id="021417f5-faf6-4eb9-b84d-42d11bed14b5"></a>

## <a id="autenticación-de-la-api" data-help-heading="true"></a>API Authentication

Administration endpoints require an API key and the format `.json`You can send the key in the header `X-API-KEY` or in the parameter `api_key`.

Examples use `X-API-KEY`. Replace `TU_API_KEY` with your authorized key and `escuela_ejemplo` with the PADMA identifier of your school.

The API key authenticates administration calls. It is not a signature for notifications sent to your URL.

## <a id="crear-una-suscripción" data-help-heading="true"></a>Create a subscription

```text
POST https://learn.derose.app/admin/hooks_subscriptions.json
```

Parameters:

- `hooks_subscription[account_padma_id]`: PADMA identifier of the school.
- `hooks_subscription[event]`: one of the events from the table.
- `hooks_subscription[url]`: Receiver URL.

```bash
curl --request POST \
  'https://learn.derose.app/admin/hooks_subscriptions.json' \
  --header 'X-API-KEY: TU_API_KEY' \
  --data-urlencode 'hooks_subscription[account_padma_id]=escuela_ejemplo' \
  --data-urlencode 'hooks_subscription[event]=booking_created' \
  --data-urlencode 'hooks_subscription[url]=https://example.com/learn-hooks'
```

Keep the ID of the created subscription to consult or delete it. If creation fails, check permissions, the school, the event, and possible duplicate subscriptions.

## <a id="consultar-una-suscripción" data-help-heading="true"></a>Consult a subscription

Replace `123` with the subscription ID:

```bash
curl 'https://learn.derose.app/admin/hooks_subscriptions/123.json' \
  --header 'X-API-KEY: TU_API_KEY'
```

## <a id="cancelar-una-suscripción" data-help-heading="true"></a>Cancel a subscription

```bash
curl --request DELETE \
  'https://learn.derose.app/admin/hooks_subscriptions/123.json' \
  --header 'X-API-KEY: TU_API_KEY'
```

Cancellation deletes that subscription. It does not delete the reservation or other subscriptions.
