Create an action/automation
POST/v1/actions
This route allows you to create a new self-service action or automation in your Port account.
To learn more about actions and automations, check out the documentation.
Request
- application/json
Body
required
- Self-service (DAY-2/DELETE)
- Self-service (CREATE)
- Automation
- jqQuery
- boolean
Array [
- Empty Rule
- Date Rule
- Number Rule
- String Rule
- Relation Rule
- Schema Rule
- Date Range
- Preset
- Number
- jqQuery
- string
- number
- boolean
- array
- date-time
- jqQuery
Array [
]
- string
- jqQuery
- string
- number
- boolean
- jqQuery
]
- jqQuery
- array
Array [
]
Array [
- Number Rule
- Date Rule
- String Rule
- Empty Rule
- Relation Rule
- Schema Rule
- Date Range
- Preset
- string
- number
- boolean
- array
- date-time
Array [
]
- string
- number
- boolean
]
- jqQuery
- boolean
Array [
- Empty Rule
- Date Rule
- Number Rule
- String Rule
- Relation Rule
- Schema Rule
- Date Range
- Preset
- Number
- jqQuery
- string
- number
- boolean
- array
- date-time
- jqQuery
Array [
]
- string
- jqQuery
- string
- number
- boolean
- jqQuery
]
- jqQuery
- array
Array [
]
- Entity created
- Entity updated
- Entity deleted
- Timer property expired
- Any entity change
- JQ
- Kafka
- Webhook
- GitHub
- GitLab
- Azure DevOps
- Upsert Entity
- string
- array
Array [
]
- string
- array
Array [
]
- User/s
- boolean
- Webhook
Possible values: Value must match regular expression ^[A-Za-z0-9@_.:\\/=-]+$
The identifier of the new action.
The title of the new action.
The icon of the new action.
The description of the new action.
trigger
object
required
oneOf
Possible values: [self-service
]
The identifier of the blueprint that the action is associated with.
Note that this is optional, as actions do not have to be tied directly to a blueprint.
userInputs
object
required
The user inputs of the action.
properties
object
required
property name*
object
Possible values: [string
, number
, boolean
, object
, array
]
Possible values: [date-time
, url
, email
, ipv4
, ipv6
, yaml
, entity
, user
, team
, proto
, markdown
]
When using the entity
format, this is the identifier of the blueprint whose entities will be selectable via this input.
The identifiers of the inputs that this input depends on. This input will be disabled until they have been given a value.
visible
object
The visibility of the input. Resolves to a boolean value (true
= visible).
oneOf
A jq query that resolves to true
or false
, determining the visibility of the input.
boolean
The icon of the input.
dataset
object
Possible values: [and
, or
]
The combinator to use when calculating the rules.
rules
object[]
required
Possible values: >= 1
anyOf
Possible values: [isEmpty
, isNotEmpty
]
Possible values: [between
, notBetween
, =
]
value
object
required
oneOf
Possible values: [today
, tomorrow
, yesterday
, lastWeek
, last2Weeks
, lastMonth
, last3Months
, last6Months
, last12Months
]
Possible values: [>
, >=
, <
, <=
]
value
object
required
oneOf
number
Possible values: [=
, !=
, containsAny
, contains
, doesNotContains
, beginsWith
, doesNotBeginsWith
, endsWith
, doesNotEndsWith
, in
, notIn
]
value
object
required
anyOf
string
number
boolean
string
string
Possible values: [relatedTo
]
value
object
required
anyOf
string
Possible values: [upstream
, downstream
]
Determines whether the relation is required or not.
propertySchema
object
required
Possible values: [=
, !=
]
value
object
anyOf
string
number
boolean
required
object
The required inputs' identifier/s. The inputs specified in this array must be given a value when executing the action.
oneOf
string
The order of the inputs. The order of the identifiers in this array will determine the order of the inputs in the UI.
condition
object
Filters used to include/exclude specific entities from the action.
Possible values: [SEARCH
]
rules
object[]
required
The rules used to filter entities.
anyOf
Possible values: [>
, >=
, <
, <=
]
Possible values: [between
, notBetween
, =
]
value
object
required
oneOf
Possible values: [today
, tomorrow
, yesterday
, lastWeek
, last2Weeks
, lastMonth
, last3Months
, last6Months
, last12Months
]
Possible values: [=
, !=
, containsAny
, contains
, doesNotContains
, beginsWith
, doesNotBeginsWith
, endsWith
, doesNotEndsWith
, in
, notIn
]
value
object
required
anyOf
string
number
boolean
string
string
Possible values: [isEmpty
, isNotEmpty
]
Possible values: [relatedTo
]
Possible values: [upstream
, downstream
]
propertySchema
object
required
Possible values: [=
, !=
]
value
object
anyOf
string
number
boolean
Possible values: [and
, or
]
Possible values: [self-service
]
The identifier of the blueprint that the action is associated with.
Note that this is optional, as actions do not have to be tied directly to a blueprint.
userInputs
object
required
The user inputs of the action.
properties
object
required
property name*
object
Possible values: [string
, number
, boolean
, object
, array
]
Possible values: [date-time
, url
, email
, ipv4
, ipv6
, yaml
, entity
, user
, team
, proto
, markdown
]
When using the entity
format, this is the identifier of the blueprint whose entities will be selectable via this input.
The identifiers of the inputs that this input depends on. This input will be disabled until they have been given a value.
visible
object
The visibility of the input. Resolves to a boolean value (true
= visible).
oneOf
A jq query that resolves to true
or false
, determining the visibility of the input.
boolean
The icon of the input.
dataset
object
Possible values: [and
, or
]
rules
object[]
required
Possible values: >= 1
anyOf
Possible values: [isEmpty
, isNotEmpty
]
Possible values: [between
, notBetween
, =
]
value
object
required
oneOf
Possible values: [today
, tomorrow
, yesterday
, lastWeek
, last2Weeks
, lastMonth
, last3Months
, last6Months
, last12Months
]
Possible values: [>
, >=
, <
, <=
]
value
object
required
oneOf
number
Possible values: [=
, !=
, containsAny
, contains
, doesNotContains
, beginsWith
, doesNotBeginsWith
, endsWith
, doesNotEndsWith
, in
, notIn
]
value
object
required
anyOf
string
number
boolean
string
string
Possible values: [relatedTo
]
value
object
required
anyOf
string
Possible values: [upstream
, downstream
]
Determines whether the relation is required or not.
propertySchema
object
required
Possible values: [=
, !=
]
value
object
anyOf
string
number
boolean
required
object
The required inputs' identifier/s. The inputs specified in this array must be given a value when executing the action.
oneOf
string
The order of the inputs. The order of the identifiers in this array will determine the order of the inputs in the UI.
Possible values: [automation
]
event
object
required
The event that triggers the action.
oneOf
Possible values: [ENTITY_CREATED
]
The identifier of the blueprint whose entities will trigger the automation.
Possible values: [ENTITY_UPDATED
]
The identifier of the blueprint whose entities will trigger the automation.
Possible values: [ENTITY_DELETED
]
The identifier of the blueprint whose entities will trigger the automation.
Possible values: [TIMER_PROPERTY_EXPIRED
]
The identifier of the blueprint whose entities will trigger the automation.
The identifier of the timer property in the specified blueprint.
Possible values: [ANY_ENTITY_CHANGE
]
The identifier of the blueprint whose entities will trigger the automation.
condition
object
Filters used to include/exclude specific entities from the automation.
oneOf
Possible values: [JQ
]
An array of jq expressions used to filter entities.
Read more here.
Possible values: [and
, or
]
invocationMethod
object
required
Details the action's backend type and details.
oneOf
Possible values: [KAFKA
]
An object containing the action payload.
Possible values: [WEBHOOK
]
The URL of the webhook.
If true
, Port's execution agent will be used to handle invocations of this action.
If true
, the action will be executed synchronously.
The HTTP method of the webhook (POST
, PUT
, PATCH
, or DELETE
).
A JSON object containing the headers to be sent to the webhook in each execution, in "key"
:"value"
pairs.
The body sent to the webhook in each execution. This is where the action payload is specified.
Possible values: [GITHUB
]
The Github organization in which the workflow is located.
The Github repository in which the workflow is located.
The name of the workflow (YAML file) to trigger. The file should be placed under .github/workflows/
.
The action payload to be sent to Github upon execution.
If true
, the action run will update its status automatically based on the workflow's result (pass/fail).
Possible values: [GITLAB
]
The GitLab project in which the pipeline is located.
The GitLab group in which the project is located.
The default ref (branch/tag name) we want the action to use. Default ref can be overridden dynamically by adding "ref" as a user input. If not set, the agent triggers the main
branch.
The action payload to be sent to GitLab upon execution.
Possible values: [AZURE_DEVOPS
]
The name of the webhook resource in the Azure YAML pipeline file.
The Azure DevOps organization in which the pipeline is located.
The action payload to be sent to Azure DevOps upon execution.
Possible values: [UPSERT_ENTITY
]
The identifier of the blueprint whose entity will be upserted.
mapping
object
required
An object containing the entity's properties and their new values.
The identifier of the upserted entity.
The title of the upserted entity.
team
object
The team/s the entity belongs to.
oneOf
string
string
The icon of the upserted entity.
The properties of the upserted entity, in "key"
:"value"
pairs.
relations
object
The relations of the upserted entity, in "key"
:"value"
pairs, where the key is the relation's identifier and the value is the related entity's identifier.
property name*
object
oneOf
string
string
requiredApproval
object
Determines whether the action requires approval before execution.
Choose ALL
to require all specified users to approve the action, or ANY
to require only one.
oneOf
Possible values: [ANY
, ALL
]
boolean
approvalNotification
object
The notification configuration for the approval process. Relevant only if requiredApproval
is set to true
.
oneOf
Possible values: [webhook
]
Possible values: [json
, slack
]
The URL of the webhook.
Possible values: [email
]
If true
, the action will be visible to all users and available for use.
Responses
- 200
- 409
- 422
- 500
Success
One of the following errors occurred:
Error | Description |
---|---|
identifier_taken | An action/automation with the same identifier already exists |
One of the following errors occurred:
Error | Description |
---|---|
invalid_request | The data provided does not match the route schema |
user_inputs_schema_invalid | The provided user inputs are invalid |
One of the following errors occurred:
Error | Description |
---|---|
internal_error | An internal error occurred |