Skip to main content
POST
/
v1
/
policies
/
{id}
/
versions
Create policy version
curl --request POST \
  --url https://api.trycomp.ai/v1/policies/{id}/versions \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "version": 1,
  "scriptKey": "org_abc123/tsk_abc123/aut_abc123.v1.js"
}
'
{
  "versionId": "<string>",
  "version": 123
}

Authorizations

X-API-Key
string
header
required

API key for authentication

Headers

X-Organization-Id
string

Organization ID (required for session auth, optional for API key auth)

Path Parameters

id
string
required

Policy ID

Example:

"pol_abc123def456"

Body

application/json

Create a new policy version draft

version
number
required

Version number for this published script

Example:

1

scriptKey
string
required

S3 key of the already-generated & published automation script (returned by the publish step).

Example:

"org_abc123/tsk_abc123/aut_abc123.v1.js"

changelog
string

Optional changelog describing this version

Response

Policy version created

versionId
string
version
number