Skip to main content
POST
/
api
/
data-platform
/
tagging-rules
Create a new tagging rule
curl --request POST \
  --url https://app.solya.app/api/data-platform/tagging-rules \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "conditions": {
    "operator": "AND",
    "rules": [
      {
        "columnId": "stock_quantity",
        "columnOperator": "LOWER_THAN",
        "type": "COLUMN",
        "value": 5
      }
    ]
  },
  "description": "Tags variants with fewer than 5 units",
  "isActive": true,
  "name": "Low stock rule",
  "organizationId": "org-uuid-1",
  "scope": {
    "entityType": "VARIANT"
  },
  "tagId": "550e8400-e29b-41d4-a716-446655440010"
}
'
{
  "data": {
    "conditions": {
      "rules": [
        "<unknown>"
      ]
    },
    "createdAt": "2023-11-07T05:31:56Z",
    "id": "<string>",
    "name": "<string>",
    "organizationId": "<string>",
    "tagId": "<string>",
    "description": "<string>",
    "isActive": true,
    "scope": {
      "brandIds": [
        "<string>"
      ],
      "collections": [
        "<string>"
      ],
      "productIds": [
        "<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
conditions
object
required
name
string
required

Human-readable name for the tagging rule

Minimum string length: 1
organizationId
string
required

Organization ID the tagging rule belongs to

Minimum string length: 1
tagId
string<uuid>
required

UUID of the tag this rule will assign when conditions are met

Pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
description
string | null

Optional free-text description of the tagging rule's purpose

isActive
boolean

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

scope
object

Optional scope limiting which entities this rule evaluates; null means evaluate all entities

Response

Successful response

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