# Hook points index

Every string you can put in `capabilities.hooks[].event`, `capabilities.events` or `capabilities.mixins[].target`, with what it can do.

| Target | Where | Count | Cancel | Modify | Docs |
|---|---|---|---|---|---|
| `<pre-event>`, e.g. `order.before_place` | `hooks` | 4 | yes | listed keys | [Cancel and modify](cancellable.md) |
| `<domain-event>` | `events` (on-event) | 34 | no | no | [Events index](events.md) |
| `after:<domain-event>`, `finished:<domain-event>` | `hooks` | 68 | no | no | [Events index](events.md) |
| `before:<METHOD> <route>`, `before:*` | `hooks` | 464 | yes | request body | [Cancel and modify](cancellable.md) |
| `during:` / `after:` / `finished:<METHOD> <route>` | `hooks` | 1392 | no | no | [Hooks and mixins](hooks.md) |
| `before:<addon>:<event>` | `hooks` | addon-defined | yes | whole payload | [Events and hooks](events-guide.md) |
| `<METHOD> <route>` mixin (`before`, `after`, `around`, `return`) | `mixins` | 795 | `return` replaces | body / response | [Hooks and mixins](hooks.md) |
| UI slot | `ui.slots` | see page | - | - | [Widgets and slots](widgets.md) |

## Phases

| Phase | When | Can change it | Payload |
|---|---|---|---|
| `before` | Before the action, synchronously, in priority order | yes: modify, cancel, uncancel | event payload (requests: `{method, path, route, query, body}`) |
| `during` | While the request runs, in the background (requests only) | no | `{request}` |
| `after` | After success | no | domain: the event payload; requests: `{request, http_status, response}`; custom: `{source, payload}` |
| `finished` | Always last | no | `{status: ok\|failed\|cancelled, …}` |

## Priorities

| Name | Value | Note |
|---|---|---|
| `lowest` | 0 | runs first |
| `low` | 50 |  |
| `normal` | 100 | default |
| `high` | 150 |  |
| `highest` | 200 |  |
| `monitor` | 1000 | runs last, observe only |

Integers from -1000 to 1000 are accepted too.

