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

# Create a VictorOps notifier

> Create a VictorOps notifier with Palo Alto Networks Cortex XCOR, Chronoctl, or Terraform.

To create a VictorOps notifier, set up VictorOps and then create the notifier in
Palo Alto Networks Cortex XCOR.

Before you begin, make sure you have your VictorOps service API key, the
**URL to notify**, and a routing key.

## Set up VictorOps

Before creating a VictorOps notifier in Cortex XCOR, enable the Prometheus
integration in VictorOps and create a service API key. See the
[REST endpoint integration guide](https://help.victorops.com/knowledge-base/rest-endpoint-integration-guide/)
in the VictorOps documentation for more information.

To configure a VictorOps notifier:

1. In VictorOps, click the **Integrations** tab.
2. Search for **Prometheus**, and then click **Enable Integration**.
3. Copy the **Service API Key** value.
4. Open the pre-configured REST integration, and copy the **URL to notify** value.
5. In the navigation menu select **Settings >
   Routing Keys**
   and review your routing keys. If you have any routing keys defined, copy the
   appropriate value for the team you want to route this notifier to.

Next, [create a VictorOps notifier](#create-a-victorops-notifier-in-cortex-xcor)
in Cortex XCOR.

## Create a VictorOps notifier in Cortex XCOR

After [setting up VictorOps](#set-up-victorops), you can create a VictorOps notifier in
Cortex XCOR.

Select from the following methods to create a VictorOps notifier. You can use
[variables](https://docs-xcor.paloaltonetworks.com/investigate/alerts/notifications/notifiers#use-variables-in-notifiers) in your
notifiers.

> [tab] Web
>
> To create a VictorOps notifier:
>
> 1. In the navigation menu select
>    \*\* Alerting > Notifiers\*\*.
>
> 2. Click **Create notifier**.
>
> 3. Enter a descriptive name for the notifier.
>
> 4. Select **VictorOps** as the type of notifier you want to create.
>
> 5. In the **API Key** field, enter the value of your VictorOps API key.
>
> 6. In the **API URL** field, enter the **URL to notify** value you copied from
>    VictorOps, which is called as a `POST` request. For example:
>
>    ```text theme={null}
>    https://alert.victorops.com/integrations/generic/20131114/alert/
>    ```
>
> 7. In the **Routing Key** field, enter the routing key you copied from VictorOps.
>
> 8. Optional: Select **Notify when resolved** to send a resolved alert notification.
>
> 9. Click **Save**.

> [tab] Chronoctl
>
> To create one or more notifiers using [Chronoctl](https://docs-xcor.paloaltonetworks.com/tooling/chronoctl), create a YAML file
> that defines them and apply the configuration to your instance.
>
> > [!NOTE]
> >
> > You can use the `notifiers scaffold` command to generate an example notifier, and
> > then copy the resource definition for your notifier type:
> >
> > ```shell theme={null}
> > chronoctl notifiers scaffold
> > ```
>
> 1. Define the resource definition for your VictorOps notifier:
>
>    ```yaml Chronoctl example icon="square-terminal" /NAME/ /SLUG/ /API_KEY/ theme={null}
>    api_version: v1/config
>    kind: Notifier
>    spec:
>      name: NAME
>      slug: SLUG
>      skip_resolved: true
>      victor_ops:
>        api_key: 'API_KEY'
>        api_url: https://alert.victorops.com/integrations/generic/20131114/alert/
>        routing_key: 'test'
>    ```
>
>    Replace the following:
>
>    * *`NAME`*: A descriptive name, such as `test-victorops`.
>    * *`SLUG`*: A unique identifier, such as `team-victorops`.
>    * *`API_KEY`*: Your VictorOps API key.
>
> 2. Enter the **URL to notify** value you copied from VictorOps as the value in the
>    `api_url` field.
>
> 3. Enter the routing key you copied from VictorOps as the value in the `routing_key`
>    field.
>
> 4. Apply the changes:
>
>    ```shell /FILE_NAME/ theme={null}
>    chronoctl apply -f FILE_NAME.yaml
>    ```
>
>    Replace *`FILE_NAME`* with the name of your notifier YAML file.

> [tab] Terraform
>
> To create a VictorOps notifier:
>
> 1. Create a VictorOps notifier with [Terraform](https://docs-xcor.paloaltonetworks.com/tooling/infrastructure/terraform) by using the
>    `chronosphere_victorops_alert_notifier` type followed by a name in a resource
>    declaration:
>
>    ```terraform expandable Terraform example icon="square-terminal" theme={null}
>    resource "chronosphere_victorops_alert_notifier" "test_victorops" {
>      name          = "test-victorops"
>
>      # Optional slug of the victorops notifier.
>      slug = "vo-test-notifier"
>
>      ## Notifier-specific required configuration
>      # Detailed definitions can be found at: https://prometheus.io/docs/alerting/latest/configuration/#victorops_config
>      api_key       = "0b590c67-20d6-40ba-afb4-84f0808dd969"
>      api_url       = "https://alert.victorops.com/integrations/generic/20131114/alert/"
>      routing_key   = "test"
>
>      ## Notifier-specific optional configurations
>      message_type = "CRITICAL" # (Default) OR: WARNING, INFO
>      entity_display_name = "summary of the problem"
>      state_message = "long explanation of the problem"
>      monitoring_tool = "Cortex XCOR"
>
>      # Can have multiple custom fields.
>      custom_fields = {
>        "first_field" = "interesting value"
>      }
>
>      ## (Optional) Base configuration common to all notifiers
>      send_resolved = true # The default value
>
>      ## (Optional) HTTP configuration common to HTTP notifiers
>      basic_auth_username = "username"
>      basic_auth_password = "strong+p@ssword"
>      # Can use bearer_token instead of basic auth
>      tls_insecure_skip_verify = false
>    }
>    ```
>
> 2. Enter your VictorOps API key as the value in the `api_key` field.
>
> 3. Enter the **URL to notify** value you copied from VictorOps as the value in the
>    `api_url` field.
>
> 4. Enter the routing key you copied from VictorOps as the value in the `routing_key`
>    field.
>
> 5. Run `terraform apply` to create the notifier resource.
>
>    ```shell theme={null}
>    terraform apply
>    ```

> [tab] API
>
> To complete this action with the Cortex XCOR API, use the `victor_ops` object in the
> [`CreateNotifier`](https://docs-xcor.paloaltonetworks.com/tooling/api-info/definition/operations/CreateNotifier) endpoint.
>
> Because the Cortex XCOR API requires authentication, include an API token with your
> `curl` request, as shown in the following example. For more details, see
> [Create an API token](https://docs-xcor.paloaltonetworks.com/tooling/api-info.md#create-an-api-token).
>
> ```shell /"TOKEN"/ /INSTANCE/ /METHOD/ /ENDPOINT_PATH/ theme={null}
> export CHRONOSPHERE_API_TOKEN="TOKEN"
> export CHRONOSPHERE_DOMAIN="INSTANCE.chronosphere.io"
>
> curl -H "API-Token: ${CHRONOSPHERE_API_TOKEN}" \
>      -X METHOD "https://${CHRONOSPHERE_DOMAIN}/ENDPOINT_PATH"
> ```
>
> Replace the following:
>
> * *`TOKEN`*: Your API token.
> * *`INSTANCE`*: The subdomain name for your organization's Cortex XCOR instance.
> * *`METHOD`*: The HTTP method to use with the request, such as `GET` or `POST`.
> * *`ENDPOINT_PATH`*: The specific endpoint you want to access.


## Related topics

- [Notifiers](https://docs-xcor.paloaltonetworks.com/investigate/alerts/notifications/notifiers.md)
- [Integrate with Cortex XCOR](https://docs-xcor.paloaltonetworks.com/integrate.md)
- [CreateNotifier](https://docs-xcor.paloaltonetworks.com/tooling/api-info/definition/operations/CreateNotifier.md)
- [Notifier connections](https://docs-xcor.paloaltonetworks.com/investigate/alerts/notifications/external-connections.md)
- [Create an Opsgenie notifier](https://docs-xcor.paloaltonetworks.com/investigate/alerts/notifications/notifiers/opsgenie.md)


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