Skip to main content
POST
/
api
/
data-platform
/
alerts
Create a new alert configuration
curl --request POST \
  --url https://app.solya.app/api/data-platform/alerts \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "checkLevel": "VARIANT",
  "description": "Fires when stock drops below threshold",
  "frequency": "DAILY",
  "isActive": true,
  "name": "Low stock alert",
  "organizationId": "org-uuid-1",
  "tagOperator": "AND",
  "tagRules": [
    {
      "mode": "INCLUDE",
      "tagId": "tag-uuid-low-stock"
    }
  ]
}
'
{
  "data": {
    "createdAt": "2023-11-07T05:31:56Z",
    "id": "<string>",
    "name": "<string>",
    "organizationId": "<string>",
    "brandIds": [
      "<string>"
    ],
    "collections": [
      "<string>"
    ],
    "description": "<string>",
    "isActive": true,
    "mediums": [
      "<string>"
    ],
    "productIds": [
      "<string>"
    ],
    "recipientIds": [
      "<string>"
    ],
    "storesIds": [
      "<string>"
    ],
    "tagRules": [
      {
        "tagId": "<string>"
      }
    ],
    "taxonomies": [
      {
        "type": "<string>",
        "values": [
          "<string>"
        ]
      }
    ],
    "updatedAt": "2023-11-07T05:31:56Z"
  }
}

Authorizations

Authorization
string
header
required

Static internal-ops token used by the data platform and internal cron jobs (e.g. zombie-run sweep). Validated via requireBearerToken inside the handler against a service-specific environment variable.

Body

application/json
name
string
required

Human-readable alert name

Minimum string length: 1
organizationId
string
required

Organization ID the alert belongs to

Minimum string length: 1
tagRules
object[]
required

Tag-based conditions that determine which entities trigger this alert (at least one required)

Minimum array length: 1
brandIds
string[]

Restrict alert evaluation to these brand IDs; omit for all brands

checkLevel
enum<string>

Granularity at which the alert is evaluated (e.g. VARIANT, PRODUCT, BRAND)

Available options:
SHOP,
BRAND,
PRODUCT,
VARIANT,
INVENTORY_ITEM
collections
string[]

Restrict alert evaluation to entities in these collection IDs

description
string | null

Optional free-text description of the alert's purpose

frequency
enum<string>
default:DAILY

How often the alert is evaluated (DAILY, WEEKLY, etc.)

Available options:
IMMEDIATELY,
HOURLY,
DAILY,
WEEKLY,
MONTHLY
isActive
boolean

Whether the alert is active and will be evaluated; defaults to true

mediums
string[]

Notification channels for delivery (e.g. EMAIL, SLACK)

productIds
string[]

Restrict alert evaluation to these product IDs; omit for all products

recipientIds
string[]

User IDs that should receive alert notifications

storesIds
string[]

Restrict alert evaluation to these store IDs; omit for all stores

tagOperator
enum<string>
default:AND

How multiple tag rules are combined: AND requires all tags, OR requires any tag

Available options:
AND,
OR
taxonomies
object[]

Restrict alert evaluation to entities matching these taxonomy filters

Response

Successful response

data
object
required
success
enum<boolean>
required
Available options:
true