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
- Default order
- Custom order
- Custom steps
- jqQuery
- boolean
Array [
- Empty Rule
- Date Rule
- Number Rule
- String Rule
- MOD5
- MOD6
- Date Range
- Preset
- jqQuery
- string
- number
- boolean
- array
- date-time
- jqQuery
Array [
]
- MOD2
- MOD2
- MOD3
- MOD4
- MOD5
]
- jqQuery
- array
Array [
]
- jqQuery
- boolean
Array [
- Empty Rule
- Date Rule
- Number Rule
- String Rule
- Relation Rule
- Schema Rule
- Date Range
- Preset
- jqQuery
- string
- number
- boolean
- array
- date-time
- jqQuery
Array [
]
- MOD2
- string
- number
- boolean
- jqQuery
]
- jqQuery
- array
Array [
]
- jqQuery
- boolean
Array [
- Empty Rule
- Date Rule
- Number Rule
- String Rule
- Relation Rule
- Schema Rule
- Date Range
- Preset
- jqQuery
- string
- number
- boolean
- array
- date-time
- jqQuery
Array [
]
- jqQuery
- string
- number
- boolean
- jqQuery
]
- jqQuery
- array
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
]
- Default order
- Custom order
- Custom steps
- jqQuery
- boolean
Array [
- Empty Rule
- Date Rule
- Number Rule
- String Rule
- MOD5
- MOD6
- Date Range
- Preset
- jqQuery
- string
- number
- boolean
- array
- date-time
- jqQuery
Array [
]
- MOD2
- MOD2
- MOD3
- MOD4
- MOD5
]
- jqQuery
- array
Array [
]
- jqQuery
- boolean
Array [
- Empty Rule
- Date Rule
- Number Rule
- String Rule
- Relation Rule
- Schema Rule
- Date Range
- Preset
- jqQuery
- string
- number
- boolean
- array
- date-time
- jqQuery
Array [
]
- MOD2
- string
- number
- boolean
- jqQuery
]
- jqQuery
- array
Array [
]
- jqQuery
- boolean
Array [
- Empty Rule
- Date Rule
- Number Rule
- String Rule
- Relation Rule
- Schema Rule
- Date Range
- Preset
- jqQuery
- string
- number
- boolean
- array
- date-time
- jqQuery
Array [
]
- jqQuery
- string
- number
- boolean
- jqQuery
]
- jqQuery
- array
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
The identifier of the new action.
Possible values: Value must match regular expression ^[A-Za-z0-9@_.:\\/=-]+$
The title of the new action.
The icon of the new action.
The description of the new action.
trigger
object
required
oneOf
The trigger definition of the new action.
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.
oneOf
Use this option when you don't want to define a custom order/steps for the user inputs.
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.
A boolean value determining the visibility of the input.
boolean
The icon of the input.
dataset
object
The combinator to use when calculating the rules.
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
A jq query that resolves to a number.
Possible values: [=
, !=
, containsAny
, contains
, doesNotContains
, beginsWith
, doesNotBeginsWith
, endsWith
, doesNotEndsWith
, in
, notIn
]
value
object
required
anyOf
string
number
boolean
string
string
A jq query that resolves to a string.
Possible values: [relatedTo
]
value
object
required
anyOf
Possible values: [upstream
, downstream
]
propertySchema
object
required
items
object
Possible values: [=
, !=
, contains
]
value
object
anyOf
string
number
boolean
sort
object
Relevant only for Entity selection
inputs (type
= string
and format
= entity
).
This input allows you to sort the entities in the dropdown by a specific property.
The property by which to sort the entities.
Possible values: [ASC
, DESC
]
required
object
The action's user inputs that must be provided by the executed user.
oneOf
A jq query that runs on the action's inputs and resolves to a boolean value (true
= required).
The identifiers of the required inputs.
string
Use this option when you want to define a custom order for the user inputs.
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 boolean value determining the visibility of the input.
boolean
The icon of the input.
dataset
object
The combinator to use when calculating the rules.
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
Possible values: [=
, !=
, containsAny
, contains
, doesNotContains
, beginsWith
, doesNotBeginsWith
, endsWith
, doesNotEndsWith
, in
, notIn
]
value
object
required
anyOf
string
number
boolean
string
string
A jq query that resolves to a string.
Possible values: [relatedTo
]
value
object
required
anyOf
A jq query that resolves to a string.
Possible values: [upstream
, downstream
]
Determines whether the relation is required or not.
propertySchema
object
required
items
object
Possible values: [=
, !=
, contains
]
value
object
anyOf
string
number
boolean
A jq query that resolves to a string.
sort
object
Relevant only for Entity selection
inputs (type
= string
and format
= entity
).
This input allows you to sort the entities in the dropdown by a specific property.
The property by which to sort the entities.
Possible values: [ASC
, DESC
]
required
object
The action's user inputs that must be provided by the executed user.
oneOf
A jq query that runs on the action's inputs and resolves to a boolean value (true
= required).
The identifiers of the required inputs.
string
The order of the user inputs - an array of the inputs' identifiers.
Use this option when you want to define custom steps for the user inputs.
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.
A boolean value determining the visibility of the input.
boolean
The icon of the input.
dataset
object
The combinator to use when calculating the rules.
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
A jq query that resolves to a number.
Possible values: [=
, !=
, containsAny
, contains
, doesNotContains
, beginsWith
, doesNotBeginsWith
, endsWith
, doesNotEndsWith
, in
, notIn
]
value
object
required
anyOf
string
number
boolean
string
string
A jq query that resolves to a string.
Possible values: [relatedTo
]
value
object
required
anyOf
A jq query that resolves to a string.
Possible values: [upstream
, downstream
]
Determines whether the relation is required or not.
propertySchema
object
required
items
object
Possible values: [=
, !=
, contains
]
value
object
anyOf
string
number
boolean
A jq query that resolves to a string.
sort
object
Possible values: [ASC
, DESC
]
required
object
The action's user inputs that must be provided by the executed user.
oneOf
A jq query that runs on the action's inputs and resolves to a boolean value (true
= required).
The identifiers of the required inputs.
string
steps
object[]
required
The steps of the user inputs. Each step is an object containing its title and the order of its properties.
The title of the step.
The order of the properties in the step - an array of property identifiers.
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
]
The trigger definition of the new action.
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.
oneOf
Use this option when you don't want to define a custom order/steps for the user inputs.
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.
A boolean value determining the visibility of the input.
boolean
The icon of the input.
dataset
object
The combinator to use when calculating the rules.
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
A jq query that resolves to a number.
Possible values: [=
, !=
, containsAny
, contains
, doesNotContains
, beginsWith
, doesNotBeginsWith
, endsWith
, doesNotEndsWith
, in
, notIn
]
value
object
required
anyOf
string
number
boolean
string
string
A jq query that resolves to a string.
Possible values: [relatedTo
]
value
object
required
anyOf
Possible values: [upstream
, downstream
]
propertySchema
object
required
items
object
Possible values: [=
, !=
, contains
]
value
object
anyOf
string
number
boolean
sort
object
Relevant only for Entity selection
inputs (type
= string
and format
= entity
).
This input allows you to sort the entities in the dropdown by a specific property.
The property by which to sort the entities.
Possible values: [ASC
, DESC
]
required
object
The action's user inputs that must be provided by the executed user.
oneOf
A jq query that runs on the action's inputs and resolves to a boolean value (true
= required).
The identifiers of the required inputs.
string
Use this option when you want to define a custom order for the user inputs.
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 boolean value determining the visibility of the input.
boolean
The icon of the input.
dataset
object
The combinator to use when calculating the rules.
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
Possible values: [=
, !=
, containsAny
, contains
, doesNotContains
, beginsWith
, doesNotBeginsWith
, endsWith
, doesNotEndsWith
, in
, notIn
]
value
object
required
anyOf
string
number
boolean
string
string
A jq query that resolves to a string.
Possible values: [relatedTo
]
value
object
required
anyOf
A jq query that resolves to a string.
Possible values: [upstream
, downstream
]
Determines whether the relation is required or not.
propertySchema
object
required
items
object
Possible values: [=
, !=
, contains
]
value
object
anyOf
string
number
boolean
A jq query that resolves to a string.
sort
object
Relevant only for Entity selection
inputs (type
= string
and format
= entity
).
This input allows you to sort the entities in the dropdown by a specific property.
The property by which to sort the entities.
Possible values: [ASC
, DESC
]
required
object
The action's user inputs that must be provided by the executed user.
oneOf
A jq query that runs on the action's inputs and resolves to a boolean value (true
= required).
The identifiers of the required inputs.
string
The order of the user inputs - an array of the inputs' identifiers.
Use this option when you want to define custom steps for the user inputs.
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.
A boolean value determining the visibility of the input.
boolean
The icon of the input.
dataset
object
The combinator to use when calculating the rules.
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
A jq query that resolves to a number.
Possible values: [=
, !=
, containsAny
, contains
, doesNotContains
, beginsWith
, doesNotBeginsWith
, endsWith
, doesNotEndsWith
, in
, notIn
]
value
object
required
anyOf
string
number
boolean
string
string
A jq query that resolves to a string.
Possible values: [relatedTo
]
value
object
required
anyOf
A jq query that resolves to a string.
Possible values: [upstream
, downstream
]
Determines whether the relation is required or not.
propertySchema
object
required
items
object
Possible values: [=
, !=
, contains
]
value
object
anyOf
string
number
boolean
A jq query that resolves to a string.
sort
object
Possible values: [ASC
, DESC
]
required
object
The action's user inputs that must be provided by the executed user.
oneOf
A jq query that runs on the action's inputs and resolves to a boolean value (true
= required).
The identifiers of the required inputs.
string
steps
object[]
required
The steps of the user inputs. Each step is an object containing its title and the order of its properties.
The title of the step.
The order of the properties in the step - an array of property identifiers.
The trigger definition of the new action.
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
]
Possible values: [webhook
, email
]
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 |