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

# Grain: List Hooks

> List Hooks. Grain List Hooks reference includes SDK V2 and CLI requests, input constraints, response fields, and Deepline cost.

List Hooks.

<Info>
  Tool ID: `grain_list_hooks`
</Info>

## Run this action

Use the TypeScript SDK for a single call. Put `ctx.tools.execute(...)` inside a Play when the call should be durable, scheduled, or run across a CSV.

```ts theme={null}
import { Deepline } from 'deepline';

const deepline = await Deepline.connect();
const result = await deepline.tools.execute(
  'grain_list_hooks',
  {
    "filter": {
      "hook_type": "recording_added",
      "state": "enabled"
    }
  },
);

console.log(result.toolResponse.raw);
```

### CLI

```bash theme={null}
deepline tools execute grain_list_hooks --input '{
  "filter": {
    "hook_type": "recording_added",
    "state": "enabled"
  }
}' --json
```

## Example response

The SDK exposes this shape at `result.toolResponse.raw`. Values below are representative.

```json theme={null}
{
  "data": {
    "hooks": [
      {
        "id": "id_123",
        "enabled": true,
        "hook_url": "https://example.com"
      }
    ]
  }
}
```

Use `deepline tools get grain_list_hooks --json` for the latest machine-readable contract.

## Input reference

List Hooks.

| Name             | Type     | Required | Default | Details |
| ---------------- | -------- | -------- | ------- | ------- |
| `payload.filter` | `object` | No       | —       | —       |

<details>
  <summary>Show raw input schema</summary>

  ### Input JSON Schema

  ```json theme={null}
  {
    "type": "object",
    "description": "List Hooks.",
    "properties": {
      "filter": {
        "type": "object",
        "properties": {
          "hook_type": {
            "type": "string",
            "description": "Only return hooks with the matching hook_type",
            "enum": [
              "recording_added",
              "recording_updated",
              "recording_deleted",
              "highlight_added",
              "highlight_updated",
              "highlight_deleted",
              "story_added",
              "story_updated",
              "story_deleted",
              "upload_status"
            ]
          },
          "state": {
            "type": "string",
            "description": "Only return hooks that are either enabled or disabled.",
            "enum": [
              "enabled",
              "disabled"
            ]
          }
        },
        "additionalProperties": false
      }
    },
    "required": [],
    "additionalProperties": false
  }
  ```
</details>

## Output reference

Standard tool result payload.

| Name                              | Type                                                                                                                                                                                                           | Required | Default | Details                                                                                                                                                                                                                                                                                   |
| --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `result.data`                     | `object`                                                                                                                                                                                                       | Yes      | —       | Provider response payload.                                                                                                                                                                                                                                                                |
| `result.data.hooks`               | `array`                                                                                                                                                                                                        | No       | —       | —                                                                                                                                                                                                                                                                                         |
| `result.data.hooks[].id`          | `string`                                                                                                                                                                                                       | No       | —       | id of the hook                                                                                                                                                                                                                                                                            |
| `result.data.hooks[].enabled`     | `boolean`                                                                                                                                                                                                      | No       | —       | Whether the hook is enabled or not                                                                                                                                                                                                                                                        |
| `result.data.hooks[].hook_url`    | `string`                                                                                                                                                                                                       | No       | —       | URL to which Grain will post to                                                                                                                                                                                                                                                           |
| `result.data.hooks[].hook_type`   | `"recording_added" \| "recording_updated" \| "recording_deleted" \| "highlight_added" \| "highlight_updated" \| "highlight_deleted" \| "story_added" \| "story_updated" \| "story_deleted" \| "upload_status"` | No       | —       | Type of notifications the hook will be sent. Allowed: `recording_added`, `recording_updated`, `recording_deleted`, `highlight_added`, `highlight_updated`, `highlight_deleted`, `story_added`, `story_updated`, `story_deleted`, `upload_status`.                                         |
| `result.data.hooks[].include`     | `object`                                                                                                                                                                                                       | No       | —       | recording\_added recording\_updated Recording Include the hook was created with. highlight\_added highlight\_updated Highlight Include the hooks was created with. recording\_deleted highlight\_deleted story\_added story\_updated story\_deleted upload\_status Always an empty object |
| `result.data.hooks[].inserted_at` | `string`                                                                                                                                                                                                       | No       | —       | UTC datetime of when the hook was created                                                                                                                                                                                                                                                 |
| `result.meta`                     | `object`                                                                                                                                                                                                       | No       | —       | Additional response metadata (status, paging).                                                                                                                                                                                                                                            |

<details>
  <summary>Show raw output schema</summary>

  ### Output JSON Schema

  ```json theme={null}
  {
    "type": "object",
    "description": "Standard tool result payload.",
    "properties": {
      "data": {
        "type": "object",
        "description": "Provider response payload.",
        "properties": {
          "hooks": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "id of the hook"
                },
                "enabled": {
                  "type": "boolean",
                  "description": "Whether the hook is enabled or not"
                },
                "hook_url": {
                  "type": "string",
                  "description": "URL to which Grain will post to"
                },
                "hook_type": {
                  "type": "string",
                  "description": "Type of notifications the hook will be sent.",
                  "enum": [
                    "recording_added",
                    "recording_updated",
                    "recording_deleted",
                    "highlight_added",
                    "highlight_updated",
                    "highlight_deleted",
                    "story_added",
                    "story_updated",
                    "story_deleted",
                    "upload_status"
                  ]
                },
                "include": {
                  "type": "object",
                  "description": "recording_added recording_updated Recording Include the hook was created with. highlight_added highlight_updated Highlight Include the hooks was created with. recording_deleted highlight_deleted story_added story_updated story_deleted upload_status Always an empty object",
                  "properties": {},
                  "additionalProperties": false
                },
                "inserted_at": {
                  "type": "string",
                  "description": "UTC datetime of when the hook was created"
                }
              },
              "additionalProperties": false
            }
          }
        },
        "additionalProperties": false
      },
      "meta": {
        "type": "object",
        "description": "Additional response metadata (status, paging).",
        "additionalProperties": true
      }
    },
    "required": [
      "data"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Deepline cost

* Pricing model: `fixed` (per call).
* Estimated Deepline credits: `0` per pricing unit.
* Provider-native pricing may still exist outside Deepline credit billing.

## Related documentation

* [Grain provider guide](/docs/providers/grain/guide)
* [SDK V2 quickstart](/docs/sdk-v2/quickstart)
* [SDK reference](/docs/sdk-v2/sdk-reference)
* [Run tools across a CSV](/docs/sdk-v2/batch-csv)
