Create rule
POST
/api/automation/rulesAdministrator
Request body
application/json
| Field | Type | Required | Notes |
|---|---|---|---|
name | string | Required | max 120 |
triggerType | enum TriggerType | Required | RELEASE_PUBLISHEDMANUALSCHEDULED_CRONUPCOMING_RELEASE_REMINDEREXTERNAL_WEBHOOK |
projectId | string (uuid) | Optional | |
releaseId | string (uuid) | Optional | |
cronExpression | string | Optional | |
cronTimeZone | string | Optional | |
daysBefore | integer | Optional | |
actions | array of AutomationActionRequest | Optional | |
actions[].id | string (uuid) | Optional | |
actions[].actionType | enum ActionType | Optional | GITHUB_RELEASESLACKEMAILPUBLIC_CHANGELOGNOTIONCONFLUENCEMICROSOFT_TEAMSZENDESK |
actions[].audienceId | string (uuid) | Optional | |
actions[].language | string | Optional | |
actions[].recipients | string | Optional | |
actions[].parentPageId | string | Optional | |
actions[].siteUrl | string | Optional | |
actions[].email | string | Optional | |
actions[].spaceId | string | Optional | |
actions[].subdomain | string | Optional | |
actions[].clientId | string | Optional | |
actions[].sectionId | string | Optional | |
actions[].userSegmentId | string | Optional | |
actions[].secret | string | Optional |
Response
Success: 201
| Field | Type | Required | Notes |
|---|---|---|---|
id | string (uuid) | Optional | |
name | string | Optional | |
triggerType | enum TriggerType | Optional | RELEASE_PUBLISHEDMANUALSCHEDULED_CRONUPCOMING_RELEASE_REMINDEREXTERNAL_WEBHOOK |
projectId | string (uuid) | Optional | |
projectName | string | Optional | |
triggerReleaseId | string (uuid) | Optional | |
cronExpression | string | Optional | |
cronTimeZone | string | Optional | |
nextFireAt | string (date-time) | Optional | |
reminderDaysBefore | integer | Optional | |
webhookPath | string | Optional | |
webhookSecretConfigured | boolean | Optional | |
webhookSecret | string | Optional | |
enabled | boolean | Optional | |
createdAt | string (date-time) | Optional | |
updatedAt | string (date-time) | Optional | |
actions | array of AutomationActionView | Optional | |
actions[].id | string (uuid) | Optional | |
actions[].position | integer | Optional | |
actions[].actionType | enum ActionType | Optional | GITHUB_RELEASESLACKEMAILPUBLIC_CHANGELOGNOTIONCONFLUENCEMICROSOFT_TEAMSZENDESK |
actions[].audienceId | string (uuid) | Optional | |
actions[].audienceName | string | Optional | |
actions[].language | string | Optional | |
actions[].recipients | string | Optional | |
actions[].parentPageId | string | Optional | |
actions[].siteUrl | string | Optional | |
actions[].email | string | Optional | |
actions[].spaceId | string | Optional | |
actions[].subdomain | string | Optional | |
actions[].clientId | string | Optional | |
actions[].sectionId | string | Optional | |
actions[].userSegmentId | string | Optional | |
actions[].secretConfigured | boolean | Optional | |
gitHubSourceMissing | boolean | Optional | |
deliversRetiredAudience | boolean | Optional |
Errors
| Status | Code | Applies to |
|---|---|---|
400 | validation_faileda field is missing or out of range | Any endpoint |
400 | malformed_requestthe body cannot be read | Any endpoint |
400 | invalid_parametera path or query parameter is missing or does not convert, such as an ID that is not a UUID | Any endpoint |
401 | authentication_requiredno session | Any endpoint |
403 | access_deniedan administrator endpoint, or a missing or stale CSRF token | Any endpoint |
404 | not_foundno such address | Any endpoint |
405 | method_not_allowedthe address does not take that method | Any endpoint |
415 | unsupported_media_typethe address does not read a body of that type | Any endpoint |
500 | internal_errora fault ReleaseFlow did not foresee; the body never carries the exception behind it | Any endpoint |
400, 404, 409 | See the guide | Automation area |
Request
bash
# Sign in first and keep the session cookie in cookies.txt (see Sessions and CSRF).
# CSRF_HEADER and CSRF_TOKEN are the headerName and token GET /api/csrf returned.
curl -X POST "http://localhost:8080/api/automation/rules" \
-b cookies.txt -c cookies.txt \
-H "$CSRF_HEADER: $CSRF_TOKEN" \
-H "Content-Type: application/json" \
--data '{
"name": "<string>",
"triggerType": "RELEASE_PUBLISHED",
"projectId": "<uuid>",
"releaseId": "<uuid>",
"cronExpression": "<string>",
"cronTimeZone": "<string>",
"daysBefore": 0,
"actions": [
{
"id": "<uuid>",
"actionType": "GITHUB_RELEASE",
"audienceId": "<uuid>",
"language": "<string>",
"recipients": "<string>",
"parentPageId": "<string>",
"siteUrl": "<string>",
"email": "<string>",
"spaceId": "<string>",
"subdomain": "<string>",
"clientId": "<string>",
"sectionId": "<string>",
"userSegmentId": "<string>",
"secret": "<string>"
}
]
}'
The request body is an example built from the schema; replace every placeholder.
Response
201Example
{
"id": "<uuid>",
"name": "<string>",
"triggerType": "RELEASE_PUBLISHED",
"projectId": "<uuid>",
"projectName": "<string>",
"triggerReleaseId": "<uuid>",
"cronExpression": "<string>",
"cronTimeZone": "<string>",
"nextFireAt": "<date-time>",
"reminderDaysBefore": 0,
"webhookPath": "<string>",
"webhookSecretConfigured": false,
"webhookSecret": "<string>",
"enabled": false,
"createdAt": "<date-time>",
"updatedAt": "<date-time>",
"actions": [
{
"id": "<uuid>",
"position": 0,
"actionType": "GITHUB_RELEASE",
"audienceId": "<uuid>",
"audienceName": "<string>",
"language": "<string>",
"recipients": "<string>",
"parentPageId": "<string>",
"siteUrl": "<string>",
"email": "<string>",
"spaceId": "<string>",
"subdomain": "<string>",
"clientId": "<string>",
"sectionId": "<string>",
"userSegmentId": "<string>",
"secretConfigured": false
}
],
"gitHubSourceMissing": false,
"deliversRetiredAudience": false
}