> ## 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: Create Hook

> Create a webhook subscription using hook_type and hook_url. Includes SDK V2 guidance, input constraints, response fields, and Deepline credit cost.

Create a webhook subscription using hook\_type and hook\_url.

> [!NOTE]
>
> Tool ID: `grain_create_hook`

## Run this action

Use the TypeScript SDK for one call. Use `ctx.tools.execute(...)` inside a Play for durable calls, scheduled calls, or CSV processing.

```ts theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
import { Deepline } from 'deepline';

const deepline = await Deepline.connect();
const result = await deepline.tools.execute(
  'grain_create_hook',
  {
    "hook_url": "https://example.com",
    "hook_type": "recording_added"
  },
);

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

### CLI

```bash theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
deepline tools execute grain_create_hook --input '{
  "hook_url": "https://example.com",
  "hook_type": "recording_added"
}' --json
```

## Example response

The SDK returns this shape at `result.toolResponse.raw`. The example values illustrate the response.

```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
{
  "data": {
    "id": "id_123",
    "enabled": true,
    "hook_url": "https://example.com"
  }
}
```

Use `deepline describe grain_create_hook --json` for the latest machine-readable contract.

## Input reference

Create a webhook subscription using hook\_type and hook\_url. Grain tests the URL, which must return a 2xx response.

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `payload.hook_url` | `string` | Yes | — | Endpoint to be called when the event is triggered. A reachability test is made to the provided url on creation. The endpoint must respond with a 2xx status in order to successfully create the hook. |
| `payload.hook_type` | `"recording_added" \| "recording_updated" \| "recording_deleted" \| "highlight_added" \| "highlight_updated" \| "highlight_deleted" \| "story_added" \| "story_updated" \| "story_deleted" \| "upload_status"` | Yes | — | 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`. |
| `payload.include` | `object` | No | — | — |

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

  ### Input JSON Schema

  ```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
  {
    "type": "object",
    "description": "Create a webhook subscription using hook_type and hook_url. Grain tests the URL, which must return a 2xx response.",
    "properties": {
      "hook_url": {
        "type": "string",
        "description": "Endpoint to be called when the event is triggered. A reachability test is made to the provided url on creation. The endpoint must respond with a 2xx status in order to successfully create the hook."
      },
      "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",
        "properties": {
          "highlights": {
            "type": "boolean",
            "description": "Include clips / highlights in the response"
          },
          "participants": {
            "type": "boolean",
            "description": "Include participants in the response"
          },
          "ai_action_items": {
            "type": "boolean",
            "description": "Include the ai_action_items in the response"
          },
          "ai_summary": {
            "type": "boolean",
            "description": "Include the ai_summary in the response"
          },
          "private_notes": {
            "type": "boolean",
            "description": "Include your private notes in the response"
          },
          "calendar_event": {
            "type": "boolean",
            "description": "Include calendar event data in the response"
          },
          "hubspot": {
            "type": "boolean",
            "description": "Include HubSpot related data in the response"
          },
          "screenshares": {
            "type": "boolean",
            "description": "Include screenshare ranges in the response"
          },
          "ai_template_sections": {
            "type": "object",
            "description": "Includes ai_template_sections in the response",
            "properties": {
              "format": {
                "type": "string",
                "description": "Controls the output of ai_template_sections Defaults to json",
                "enum": [
                  "json",
                  "markdown",
                  "text"
                ]
              },
              "allowed_sections": {
                "type": "array",
                "description": "Only include sections which title matches the given allowed_sections Case insensitive",
                "items": {
                  "type": "string"
                }
              }
            },
            "additionalProperties": false
          },
          "transcript": {
            "type": "boolean",
            "description": "Include the highlight's transcript in the response."
          },
          "speakers": {
            "type": "boolean",
            "description": "Include the highlight's speakers in the response"
          }
        },
        "additionalProperties": false
      }
    },
    "required": [
      "hook_url",
      "hook_type"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Output reference

Standard tool result payload.

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `result.data` | `object` | Yes | — | Provider response payload. |
| `result.data.id` | `string` | No | — | id of the hook |
| `result.data.enabled` | `boolean` | No | — | Whether the hook is enabled or not |
| `result.data.hook_url` | `string` | No | — | URL to which Grain will post to |
| `result.data.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.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.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={"languages":{"custom":["/languages/deepline-prompt.json"]}}
  {
    "type": "object",
    "description": "Standard tool result payload.",
    "properties": {
      "data": {
        "type": "object",
        "description": "Provider response payload.",
        "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
      },
      "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](https://deepline.com/docs/providers/grain/guide.md)
* [SDK V2 quickstart](https://deepline.com/docs/sdk-v2/quickstart.md)
* [SDK reference](https://deepline.com/docs/sdk-v2/sdk-reference.md)
* [Run tools across a CSV](https://deepline.com/docs/sdk-v2/batch-csv.md)


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