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

# Notifiers SDK Reference

> Manage notifier destinations with the Node.js and Python SDKs: list, create, retrieve, update, and delete email, Slack, and webhook notifiers.

## Notifiers

### List Notifiers

Returns notifier destinations visible to the caller, ordered by creation time with the newest notifier first.

<CodeGroup>
  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
  from orq_ai_sdk import Orq
  import os

  with Orq(
      api_key=os.getenv("ORQ_API_KEY", ""),
  ) as orq:

      res = orq.notifiers.list(type_=[
          "NOTIFIER_TYPE_SLACK_WEBHOOK",
      ])

      # Handle response
      print(res)

  ```

  ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
  import { Orq } from "@orq-ai/node";

  const orq = new Orq({
    apiKey: process.env["ORQ_API_KEY"] ?? "",
  });

  async function run() {
    const result = await orq.notifiers.list({
      type: [
        "NOTIFIER_TYPE_SLACK_WEBHOOK",
      ],
    });

    console.log(result);
  }

  run();
  ```
</CodeGroup>

<Expandable title="Parameters">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "limit": Optional[int],
        "starting_after": Optional[str],
        "ending_before": Optional[str],
        "project_id": Optional[str],
        "search": Optional[str],
        "type": List[Literal["NOTIFIER_TYPE_UNSPECIFIED", "NOTIFIER_TYPE_EMAIL", "NOTIFIER_TYPE_SLACK_WEBHOOK", "NOTIFIER_TYPE_WEBHOOK"]],  # optional
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      limit?: number;
      startingAfter?: string;
      endingBefore?: string;
      projectId?: string;
      search?: string;
      type?: ("NOTIFIER_TYPE_UNSPECIFIED" | "NOTIFIER_TYPE_EMAIL" | "NOTIFIER_TYPE_SLACK_WEBHOOK" | "NOTIFIER_TYPE_WEBHOOK")[];
    }
    ```
  </CodeGroup>
</Expandable>

<Expandable title="Response">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "object": str,
        "data": List[Union[EmailNotifier, SlackWebhookNotifier, GenericWebhookNotifier]],
        "has_more": bool,
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      object: string;
      data: (EmailNotifier | SlackWebhookNotifier | GenericWebhookNotifier)[];
      hasMore: boolean;
    }
    ```
  </CodeGroup>
</Expandable>

### Create a Notifier

Creates a notifier destination in a project. Choose `NOTIFIER_TYPE_EMAIL`, `NOTIFIER_TYPE_SLACK_WEBHOOK`, or `NOTIFIER_TYPE_WEBHOOK` and provide the matching destination fields.

<CodeGroup>
  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
  from orq_ai_sdk import Orq
  import os

  with Orq(
      api_key=os.getenv("ORQ_API_KEY", ""),
  ) as orq:

      res = orq.notifiers.create(request={
          "type": "NOTIFIER_TYPE_SLACK_WEBHOOK",
          "incoming_webhook_url": "https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX",
          "display_name": "Deployment alerts",
      })

      # Handle response
      print(res)

  ```

  ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
  import { Orq } from "@orq-ai/node";

  const orq = new Orq({
    apiKey: process.env["ORQ_API_KEY"] ?? "",
  });

  async function run() {
    const result = await orq.notifiers.create({
      type: "NOTIFIER_TYPE_SLACK_WEBHOOK",
      incomingWebhookUrl: "https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX",
      displayName: "Deployment alerts",
    });

    console.log(result);
  }

  run();
  ```
</CodeGroup>

<Expandable title="Parameters">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "type": Literal["NOTIFIER_TYPE_UNSPECIFIED", "NOTIFIER_TYPE_EMAIL", "NOTIFIER_TYPE_SLACK_WEBHOOK", "NOTIFIER_TYPE_WEBHOOK"],  # required
        "emails": List[str],  # required
        "project_id": Optional[str],
        "display_name": str,  # required
        "metadata": Dict[str, Any],  # optional
        "incoming_webhook_url": Optional[str],
        "webhook_url": Optional[str],
        "headers": Dict[str, Any],  # optional
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      type: "NOTIFIER_TYPE_UNSPECIFIED" | "NOTIFIER_TYPE_EMAIL" | "NOTIFIER_TYPE_SLACK_WEBHOOK" | "NOTIFIER_TYPE_WEBHOOK";  // required
      emails: string[];  // required
      projectId?: string;
      displayName: string;  // required
      metadata?: Record<string, unknown>;
      incomingWebhookUrl?: string;
      webhookUrl?: string;
      headers?: Record<string, unknown>;
    }
    ```
  </CodeGroup>
</Expandable>

<Expandable title="Response">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "notifier": Union[EmailNotifier, SlackWebhookNotifier, GenericWebhookNotifier],
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      notifier: EmailNotifier | SlackWebhookNotifier | GenericWebhookNotifier;
    }
    ```
  </CodeGroup>
</Expandable>

### Retrieve a Notifier

Retrieves an existing notifier by ID.

<CodeGroup>
  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
  from orq_ai_sdk import Orq
  import os

  with Orq(
      api_key=os.getenv("ORQ_API_KEY", ""),
  ) as orq:

      res = orq.notifiers.get(notifier_id="<id>")

      # Handle response
      print(res)

  ```

  ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
  import { Orq } from "@orq-ai/node";

  const orq = new Orq({
    apiKey: process.env["ORQ_API_KEY"] ?? "",
  });

  async function run() {
    const result = await orq.notifiers.get({
      notifierId: "<id>",
    });

    console.log(result);
  }

  run();
  ```
</CodeGroup>

<Expandable title="Parameters">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "notifier_id": str,  # required
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      notifierId: string;  // required
    }
    ```
  </CodeGroup>
</Expandable>

<Expandable title="Response">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "notifier": Union[EmailNotifier, SlackWebhookNotifier, GenericWebhookNotifier],
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      notifier: EmailNotifier | SlackWebhookNotifier | GenericWebhookNotifier;
    }
    ```
  </CodeGroup>
</Expandable>

### Delete a Notifier

Deletes an existing notifier by ID.

<CodeGroup>
  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
  from orq_ai_sdk import Orq
  import os

  with Orq(
      api_key=os.getenv("ORQ_API_KEY", ""),
  ) as orq:

      res = orq.notifiers.delete(notifier_id="<id>")

      # Handle response
      print(res)

  ```

  ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
  import { Orq } from "@orq-ai/node";

  const orq = new Orq({
    apiKey: process.env["ORQ_API_KEY"] ?? "",
  });

  async function run() {
    const result = await orq.notifiers.delete({
      notifierId: "<id>",
    });

    console.log(result);
  }

  run();
  ```
</CodeGroup>

<Expandable title="Parameters">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "notifier_id": str,  # required
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      notifierId: string;  // required
    }
    ```
  </CodeGroup>
</Expandable>

### Update a Notifier

Partially updates an existing notifier. When changing `type`, provide the destination fields required by the new notifier type.

<CodeGroup>
  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
  from orq_ai_sdk import Orq
  import os

  with Orq(
      api_key=os.getenv("ORQ_API_KEY", ""),
  ) as orq:

      res = orq.notifiers.update(notifier_id="<id>", type_="NOTIFIER_TYPE_SLACK_WEBHOOK", incoming_webhook_url="https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX")

      # Handle response
      print(res)

  ```

  ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
  import { Orq } from "@orq-ai/node";

  const orq = new Orq({
    apiKey: process.env["ORQ_API_KEY"] ?? "",
  });

  async function run() {
    const result = await orq.notifiers.update({
      notifierId: "<id>",
      updateNotifierRequest: {
        type: "NOTIFIER_TYPE_SLACK_WEBHOOK",
        incomingWebhookUrl: "https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX",
      },
    });

    console.log(result);
  }

  run();
  ```
</CodeGroup>

<Expandable title="Parameters">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "notifier_id": str,  # required
        "project_id": Optional[str],
        "display_name": Optional[str],
        "metadata": Dict[str, Any],  # optional
        "type": Optional[Literal["NOTIFIER_TYPE_UNSPECIFIED", "NOTIFIER_TYPE_EMAIL", "NOTIFIER_TYPE_SLACK_WEBHOOK", "NOTIFIER_TYPE_WEBHOOK"]],
        "emails": List[str],  # optional
        "incoming_webhook_url": Optional[str],
        "webhook_url": Optional[str],
        "headers": Dict[str, Any],  # optional
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      notifierId: string;  // required
      updateNotifierRequest: {  // required
        projectId?: string;
        displayName?: string;
        metadata?: Record<string, unknown>;
        type?: "NOTIFIER_TYPE_UNSPECIFIED" | "NOTIFIER_TYPE_EMAIL" | "NOTIFIER_TYPE_SLACK_WEBHOOK" | "NOTIFIER_TYPE_WEBHOOK";
        emails?: string[];
        incomingWebhookUrl?: string;
        webhookUrl?: string;
        headers?: Record<string, unknown>;
      };
    }
    ```
  </CodeGroup>
</Expandable>

<Expandable title="Response">
  <CodeGroup>
    ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
        "notifier": Union[EmailNotifier, SlackWebhookNotifier, GenericWebhookNotifier],
    }
    ```

    ```typescript Node.js theme={"theme":{"light":"github-light","dark":"github-dark"}}
    {
      notifier: EmailNotifier | SlackWebhookNotifier | GenericWebhookNotifier;
    }
    ```
  </CodeGroup>
</Expandable>


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