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

# Send a Test Notification

> Send a sample alert to email, a webhook, Slack or Discord before saving a monitor.

Sends a sample alert, with one new item and one price change, to the channels in `notify`. Use it to check a webhook endpoint or a Slack or Discord URL before you save a monitor. Free.

```bash theme={null}
curl -X POST https://api.spidra.io/api/monitors/test-notification \
  -H "Authorization: Bearer $SPIDRA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "notify": { "email": { "enabled": false }, "webhook": { "url": "https://example.com/spidra-hook" } } }'
```

```json theme={null}
{ "status": "success", "sent": 1, "errors": [] }
```

`status` is `partial` and `errors` says which channel failed and why when one can't be reached. Email goes to your account's address unless `enabled` is `false`, and to extra `recipients` only if they have already confirmed.


## OpenAPI

````yaml POST /monitors/test-notification
openapi: 3.1.0
info:
  title: Spidra API
  version: 1.0.0
  description: >-
    Public API endpoints for web scraping via Spidra. Authenticate with
    `Authorization: Bearer YOUR_API_KEY`.
servers:
  - url: https://api.spidra.io/api
security:
  - BearerAuth: []
  - ApiKeyAuth: []
paths:
  /monitors/test-notification:
    post:
      tags:
        - Monitors
      summary: Send a Test Notification
      description: >-
        Sends a sample alert (one new item and one price change) to the channels
        you give, so you can check them before saving. Free.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                  description: The monitor name shown in the sample.
                notify:
                  $ref: '#/components/schemas/MonitorNotify'
            example:
              notify:
                email:
                  enabled: false
                webhook:
                  url: https://example.com/spidra-hook
      responses:
        '200':
          description: Sent. `status` is `partial` when a channel failed.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    enum:
                      - success
                      - partial
                  sent:
                    type: integer
                  errors:
                    type: array
                    items:
                      type: string
        '401':
          description: Missing or invalid API key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Some inputs need fixing. `errors` lists each field.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvalidInputError'
components:
  schemas:
    MonitorNotify:
      type: object
      properties:
        email:
          type: object
          properties:
            enabled:
              type: boolean
              default: true
            recipients:
              type: array
              items:
                type: string
              maxItems: 10
              description: >-
                Extra addresses. Each gets alerts only after confirming by
                email.
          description: Your account's email is on unless `enabled` is false.
        webhook:
          type: object
          properties:
            url:
              type: string
              description: A public https URL.
            secret:
              type: string
              description: >-
                16 to 128 letters, digits, - or _. Generated when you leave it
                out.
        slack:
          type: object
          properties:
            webhookUrl:
              type: string
              description: A Slack incoming webhook URL (https://hooks.slack.com/...).
        discord:
          type: object
          properties:
            webhookUrl:
              type: string
              description: A Discord webhook URL (https://discord.com/api/webhooks/...).
    ErrorResponse:
      type: object
      properties:
        status:
          type: string
          enum:
            - error
        message:
          type: string
      required:
        - status
        - message
    InvalidInputError:
      type: object
      properties:
        status:
          type: string
          enum:
            - error
        code:
          type: string
          enum:
            - INVALID_INPUT
        message:
          type: string
        errors:
          type: array
          items:
            type: object
            properties:
              field:
                type: string
              message:
                type: string
          description: One entry per field that needs fixing.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API key
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````

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