Skip to main content
POST
/
v1
/
trace
/
rule-packs
Upload a custom rule pack
curl --request POST \
  --url https://api.pyai.com/v1/trace/rule-packs \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "pack_id": "<string>",
  "version": "<string>",
  "rules": [
    {}
  ],
  "jurisdiction": "<string>",
  "legal_status": "<string>"
}
'
{
  "object": "trace.rule_pack",
  "id": "tpack_...",
  "pack_id": "tcpa",
  "version": "<string>",
  "builtin": true,
  "jurisdiction": "<string>",
  "legal_status": "<string>",
  "etag": "<string>",
  "created_at": 123,
  "spec": {}
}

Authorizations

Authorization
string
header
required

Use Authorization: Bearer pyai_live_... (or pyai_test_...).

Body

application/json

An authored rule pack in the Trace DSL (rule_pack_schema.json).

pack_id
string
required
Pattern: ^[a-z0-9_]+$
version
string
required
rules
object[]
required
Minimum array length: 1
jurisdiction
string

Provenance / attorney-curation status.

Response

Rule pack created

object
string
Example:

"trace.rule_pack"

id
string
Example:

"tpack_..."

pack_id
string
Example:

"tcpa"

version
string
builtin
boolean

True for PyAI's bundled packs; false for tenant uploads.

jurisdiction
string | null
etag
string
status
enum<string>
Available options:
active,
deprecated
created_at
integer

Unix ms.

spec
object

The authored DSL (only on the single-pack GET).