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

# Create Alert

> Creates an Availability Alert

This endpoint creats an Alert, and immediately starts it. The Alert will run indefinitely until canceled, or until all of the dates are in the past.


## OpenAPI

````yaml POST /alert/create
openapi: 3.0.1
info:
  title: OpenAPI Plant Store
  description: >-
    A sample API that uses a plant store as an example to demonstrate features
    in the OpenAPI specification
  version: 1.0.0
servers:
  - url: https://api.campflare.com/v2
security: []
paths:
  /alert/create:
    post:
      summary: Creates an Availability Alert
      description: Creates an Availability Alert
      parameters: []
      requestBody:
        description: Alert parameters
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - parameters
                - campground_ids
              properties:
                parameters:
                  $ref: '#/components/schemas/AvailabilityFilter'
                  description: >-
                    Availability parameters. When these are set, the alert will
                    trigger each time availability of the specified campgrounds
                    matches the this criteria. These are the same as the
                    parameters used in the campground search endpoint, which may
                    be helpful for debugging and previewing alert parameters.
                campground_ids:
                  type: array
                  items:
                    type: string
                  description: Array of campground IDs to watch. Limited to 12 campgrounds.
                metadata:
                  type: object
                  description: >-
                    A mapping of any data you wish to associate with the alert
                    which will be sent with each notification to the webhook.
                    Limited to 2kb.
                webhook_override_url:
                  type: string
                  description: >-
                    Optional webhook URL to use for this alert instead of the
                    default webhook URL configured on your account.
      responses:
        '200':
          description: Alert response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Alert'
        '400':
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    AvailabilityFilter:
      type: object
      required:
        - date_ranges
      properties:
        date_ranges:
          type: array
          description: >-
            List of date ranges. These are treated as an OR condition. For
            example, if there are two weekend date ranges, and only one is
            available, it will still resolve to true. 
          items:
            type: object
            properties:
              starting_date:
                type: string
                format: date
                description: The starting date of the range in YYYY-MM-DD format
              nights:
                type: integer
            required:
              - starting_date
              - nights
        status:
          type: array
          description: >-
            List of statuses to filter on. These are treated as an OR condition.
            Allows you to check for any combination of statuses. This defaults
            to ["available"]. However, it may be useful to filter on others,
            like ["available", "first-come-first-serve"].
          items:
            type: string
            enum:
              - available
              - reserved
              - closed
              - first-come-first-serve
              - not-yet-released
              - unknown
        campsite_kinds:
          type: array
          items:
            type: string
            enum:
              - standard
              - rv
              - tent-only
              - cabin
              - management
              - group
              - walk-to
              - equestrian
              - water-access
        min_rv_length:
          type: number
          description: Minimum RV length a campsite must have
        min_trailer_length:
          type: number
          description: Minimum Trailer length a campsite must have
    Alert:
      type: object
      required:
        - id
        - campground_ids
        - parameters
        - created_at
        - notifications
        - status
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier for the alert
        status:
          type: string
          enum:
            - active
            - canceled
            - expired
          description: Status of the alert
        campground_ids:
          type: array
          items:
            type: string
        parameters:
          $ref: '#/components/schemas/AvailabilityFilter'
        created_at:
          type: string
          format: date-time
          description: Timestamp of the alert creation
        canceled_at:
          type: string
          format: date-time
          description: Timestamp of the last update (when/if canceled)
        metadata:
          type: object
          description: The additional metadata associated with the alert when created
        webhook_override_url:
          type: string
          description: >-
            The webhook URL override for this alert, if one was set at creation
            time.
        notifications:
          type: array
          items:
            $ref: '#/components/schemas/AlertNotification'
    Error:
      required:
        - error
        - message
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
            kind:
              type: string
    AlertNotification:
      type: object
      required:
        - id
        - sent_at
        - campsite_id
        - campground_id
        - date_range
        - status
        - webhook_status
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier for the notification
        sent_at:
          type: string
          format: date-time
          description: Timestamp of when the notification was sent
        campground_id:
          type: string
          description: Unique identifier for the campground
        campsite_id:
          type: string
          description: Unique identifier for the campsite
        webhook_http_response_code:
          type: string
          description: The HTTP status code returned by the webhook (e.g. 200, 400)
        webhook_status:
          type: string
          enum:
            - delivered
            - error
            - no-webhook
          description: The status of the webhook delivery
        date_range:
          type: object
          properties:
            starting_date:
              type: string
              format: date
              description: The starting date of the range in YYYY-MM-DD format
            nights:
              type: integer
          required:
            - starting_date
            - nights

````