> **Building with AI coding agents?** If you're using an AI coding agent, install the official Scalekit plugin. It gives your agent full awareness of the Scalekit API — reducing hallucinations and enabling faster, more accurate code generation.
>
> - **Claude Code**: `/plugin marketplace add scalekit-inc/claude-code-authstack` then `/plugin install <auth-type>@scalekit-auth-stack`
> - **GitHub Copilot CLI**: `copilot plugin marketplace add scalekit-inc/github-copilot-authstack` then `copilot plugin install <auth-type>@scalekit-auth-stack`
> - **Codex**: run the bash installer, restart, then open Plugin Directory and enable `<auth-type>`
> - **Skills CLI** (Windsurf, Cline, 40+ agents): `npx skills add scalekit-inc/skills --list` then `--skill <skill-name>`
>
> `<auth-type>` / `<skill-name>`: `agent-auth`, `full-stack-auth`, `mcp-auth`, `modular-sso`, `modular-scim` — [Full setup guide](https://docs.scalekit.com/dev-kit/build-with-ai/)

---

# Role events

This page documents the webhook events related to role operations in Scalekit.

----

## Role events

### `role.created`

This webhook is triggered when a new role is created. The event type is `role.created`

```json title="role.created"
{
  "environment_id": "env_1234567890",
  "id": "evt_1234567890",
  "object": "Role",
  "occurred_at": "2024-01-15T10:30:00.123456789Z",
  "spec_version": "1",
  "type": "role.created",
  "data": {
    "description": "Viewer role with read-only access",
    "display_name": "Viewer",
    "extends": "member",
    "id": "role_1234567890",
    "name": "viewer"
  }
}
```

| Field | Type | Description |
|-------|------|-------------|
| `id` | string | Unique identifier for the role |
| `name` | string | Unique name identifier for the role |
| `display_name` | string | Human-readable display name for the role |
| `description` | string | Description of the role and its purpose |
| `extends` | string | Name of the role that this role extends from |

### `role.updated`

This webhook is triggered when a role is updated. The event type is `role.updated`

```json title="role.updated"
{
  "environment_id": "env_1234567890",
  "id": "evt_2345678901",
  "object": "Role",
  "occurred_at": "2024-01-15T10:35:00.123456789Z",
  "spec_version": "1",
  "type": "role.updated",
  "data": {
    "description": "Updated viewer role with limited permissions",
    "display_name": "Viewer",
    "extends": "member",
    "id": "role_1234567890",
    "name": "viewer"
  }
}
```

| Field | Type | Description |
|-------|------|-------------|
| `id` | string | Unique identifier for the role |
| `name` | string | Unique name identifier for the role |
| `display_name` | string | Human-readable display name for the role |
| `description` | string | Description of the role and its purpose |
| `extends` | string | Name of the role that this role extends from |

### `role.deleted`

This webhook is triggered when a role is deleted. The event type is `role.deleted`

```json title="role.deleted"
{
  "environment_id": "env_1234567890",
  "id": "evt_3456789012",
  "object": "Role",
  "occurred_at": "2024-01-15T10:40:00.123456789Z",
  "spec_version": "1",
  "type": "role.deleted",
  "data": {
    "description": "Updated viewer role with limited permissions",
    "display_name": "Viewer",
    "extends": "member",
    "id": "role_1234567890",
    "name": "viewer"
  }
}
```

| Field | Type | Description |
|-------|------|-------------|
| `id` | string | Unique identifier for the deleted role |
| `name` | string | Unique name identifier for the deleted role |
| `display_name` | string | Human-readable display name for the deleted role |
| `description` | string | Description of the role that was deleted |
| `extends` | string | Name of the role that this role extends from |

---

## More Scalekit documentation

| Resource | What it contains | When to use it |
|----------|-----------------|----------------|
| [/llms.txt](/llms.txt) | Structured index with routing hints per product area | Start here — find which documentation set covers your topic before loading full content |
| [/llms-full.txt](/llms-full.txt) | Complete documentation for all Scalekit products in one file | Use when you need exhaustive context across multiple products or when the topic spans several areas |
| [sitemap-0.xml](https://docs.scalekit.com/sitemap-0.xml) | Full URL list of every documentation page | Use to discover specific page URLs you can fetch for targeted, page-level answers |
