Snapvisor Docs
API ReferenceAutomations

Update an automation rule

Replace an automation rule's definition. Requires administrator access to the project. The whole definition is replaced, so send the events, conditions and actions you want the rule to end up with. Use it when an existing rule should fire on different events, conditions or actions.

PUT
/projects/{owner}/{project}/automation-rules/{ruleId}

Replace an automation rule's definition. Requires administrator access to the project. The whole definition is replaced, so send the events, conditions and actions you want the rule to end up with. Use it when an existing rule should fire on different events, conditions or actions.

Authorization

AuthorizationBearer <token>

Authenticate as a user with a personal access token.

Send it as a bearer token in the Authorization header:

Authorization: Bearer <personal-access-token>

Personal access tokens act on behalf of the user that created them and are required by endpoints that perform user actions, such as reviewing builds and posting comments.

In: header

Path Parameters

owner*string
Length1 <= length
project*string
Length1 <= length
ruleId*string

Identifier of the automation rule.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

curl -X PUT "https://example.com/projects/string/string/automation-rules/string" \  -H "Content-Type: application/json" \  -d '{    "name": "string",    "events": [      "build.completed"    ],    "actions": [      {        "type": "sendSlackMessage",        "payload": {          "name": "string"        }      }    ]  }'
{  "id": "string",  "name": "string",  "active": true,  "events": [    "build.completed"  ],  "conditions": [    {      "type": "build-branch",      "value": "string"    }  ],  "actions": [    {      "action": "string",      "actionPayload": {        "property1": null,        "property2": null      }    }  ],  "createdAt": "2019-08-24T14:15:22Z",  "updatedAt": "2019-08-24T14:15:22Z"}