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

# ctx.action

> Which action is running.

Information about the action the handler belongs to.

## Value

| Field | Type | Description |
| - | - | - |
| `slug` | `string` | The action's path in the actions folder, also its URL: `/actions/<slug>`. |

## Usage

Shared code can tell which action called it, for a log line or an audit record:

```ts actions/_shared/audit.ts theme={null}
import type { ActionCtx } from 'awaitio';

type AuditArgs = {
  ctx: ActionCtx;
  message: string;
};

export const audit = ({ ctx, message }: AuditArgs) => {
  console.info(`[${ctx.action.slug}] ${ctx.user.email}: ${message}`);
};
```

In `actions/billing/refundOrderAction.ts`, `ctx.action.slug` is `billing/refund_order`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.