Skip to content

Publish Rule Set

Publishes the current draft version of a reviewed rule set. Production ingestion requires a published extractor rule set. Fallback pricing only uses the current published pricing version after it is published or explicitly selected by an event.

POST /v1/projects/:project_id/extractor-rule-sets/:id/publish
POST /v1/projects/:project_id/pricing-rule-sets/:id/publish
Terminal window
Authorization: Bearer <api-key>

Requires rules write access.

Field Required Description
project_id Yes Project that owns the rule set.
id Yes Rule set ID to publish.

The request body may be empty. To guard against publishing a stale draft, pass the draft version explicitly:

{
"version": 2
}

Only the current draft version can be published. Published history is read-only.

Terminal window
curl 'http://127.0.0.1:8080/v1/projects/proj_gateway/extractor-rule-sets/ers_openai/publish' \
-X POST \
-H 'Authorization: Bearer <api-key>'

The server compiles the extractor before publishing. Invalid JSON paths, invalid expressions, or template expansion errors return 400.

Terminal window
curl 'http://127.0.0.1:8080/v1/projects/proj_gateway/pricing-rule-sets/prs_openai_fallback/publish' \
-X POST \
-H 'Authorization: Bearer <api-key>'

The bound extractor rule set must already be published. The server compiles CEL pricing programs before publishing.

{
"status": "published",
"rule_set": {
"id": "ers_openai",
"version": 2,
"status": "published"
}
}
  • The rule set ID stays the same after publishing a new version.
  • Publish only after running Test Rules with representative raw events.
  • Publishing a pricing rule set invalidates the runtime pricing binding cache for its extractor.