Appearance
Run action ​
API ReferenceNote: The path is a placeholder. The actual path is determined by the configuration of the app component.
The request made when an action is triggered. Rule actions in rules containing a "Task added to this project" trigger have a 2 minute delay for newly created tasks in that project. This is to provide time for the creating user to fill out task details (name, description, etc.) before the rule action is triggered.
An app server must be hosted in order for rule actions to function. For a brief list of popular hosting options, see hosting.
OpenAPI definition ​
json
{
"openapi": "3.0.0",
"info": {
"description": "This is the interface for handling requests for app components. This reference is generated from an [OpenAPI spec] (https://raw.githubusercontent.com/Asana/openapi/master/defs/app_components_oas.yaml).",
"title": "App Components",
"termsOfService": "https://asana.com/terms",
"contact": {
"name": "Asana Support",
"url": "https://asana.com/support"
},
"license": {
"name": "Apache 2.0",
"url": "https://www.apache.org/licenses/LICENSE-2.0"
},
"version": "0.1",
"x-docs-schema-whitelist": [
"AttachedResourceResponse",
"FormField-Checkbox",
"FormField-Date",
"FormField-Datetime",
"FormField-Dropdown",
"FormField-MultiLineText",
"FormField-RadioButton",
"FormField-RichText",
"FormField-SingleLineText",
"FormField-StaticText",
"FormField-Typeahead",
"FormMetadataResponse",
"RanActionResponse",
"WidgetFooter-CustomText",
"WidgetFooter-Created",
"WidgetFooter-Updated",
"WidgetMetadataResponse",
"WidgetField-DatetimeWithIcon",
"WidgetField-Pill",
"WidgetField-TextWithIcon",
"TypeaheadListResponse",
"TypeaheadItem",
"FormValues",
"BadRequestResponse",
"UnauthorizedResponse",
"ForbiddenResponse",
"NotFoundResponse",
"InternalServerErrorResponse"
]
},
"x-readme": {
"explorer-enabled": false
},
"servers": [
{
"url": "{siteUrl}",
"description": "Main endpoint."
}
],
"tags":
{
"name": "Rule actions",
"description": "When a rule containing a rule action is triggered, the [rules engine will make a request to the app to inform the app to run the configured rule action. The resulting status code will indicate to the rules engine whether the action was successfully completed and, if not, specify a cause for the error.\n\n_Note: An app server must be hosted in order for rule actions to function. For a brief list of popular hosting options, see [hosting](/docs/hosting)._"
}
],
"components": {
"responses": {
"BadRequest": {
"description": "Bad request",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/BadRequestResponse"
}
}
}
},
"Unauthorized": {
"description": "Unauthorized",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UnauthorizedResponse"
}
}
}
},
"Forbidden": {
"description": "Forbidden",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ForbiddenResponse"
}
}
}
},
"NotFound": {
"description": "Not found",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/NotFoundResponse"
}
}
}
},
"Gone": {
"description": "Gone"
},
"InternalServerError": {
"description": "Server error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/InternalServerErrorResponse"
}
}
}
}
},
"schemas": {
"RootUIComponentRequest": {
"description": "The building block of all app component requests.",
"type": "object",
"properties": {
"expires_at": {
"type": "string",
"description": "The time (in ISO 8601 date format) when the request should expire.",
"example": "2019-04-15T01:01:46.055Z"
},
"user": {
"type": "string",
"description": "The user GID this hook is coming from.",
"example": "54321"
},
"workspace": {
"type": "string",
"description": "The workspace GID this hook is coming from.",
"example": "12345"
}
}
},
"AttachedResourceResponse": {
"description": "The response to a successful lookup request.",
"type": "object",
"required": [
"resource_name",
"resource_url"
],
"properties": {
"resource_name": {
"description": "The name of the attached resource",
"type": "string",
"example": "Build the Thing"
},
"resource_url": {
"description": "The URL of the attached resource",
"type": "string",
"example": "https://example.atlassian.net/browse/CP-1"
},
"error": {
"description": "The error that should be displayed to the user",
"type": "string",
"example": "No resource matched that input"
}
}
},
"BadRequestResponse": {
"description": "An error response object indicating a bad request (i.e., a status code of `400`).",
"type": "object",
"properties": {
"error": {
"description": "The error to display.",
"type": "string",
"example": "Illegal or malformed request."
}
}
},
"ForbiddenResponse": {
"description": "An error response object indicating a forbidden request (i.e., a status code of `403`).",
"type": "object",
"properties": {
"error": {
"description": "The error to display.",
"type": "string",
"example": "Access forbidden."
}
}
},
"InternalServerErrorResponse": {
"description": "An error response object indicating a request that could not be found (i.e., a status code of `500`).",
"type": "object",
"properties": {
"error": {
"description": "The error to display.",
"type": "string",
"example": "Internal server error."
}
}
},
"NotFoundResponse": {
"description": "An error response object indicating a request that could not be found (i.e., a status code of `404`).",
"type": "object",
"properties": {
"error": {
"description": "The error to display.",
"type": "string",
"example": "Not found."
}
}
},
"RunActionRequest": {
"allOf": [
{
"$ref": "#/components/schemas/RootUIComponentRequest"
},
{
"type": "object",
"description": "The body of an action request.",
"required": [
"idempotency_key"
],
"properties": {
"project": {
"type": "string",
"description": "The project GID this hook is coming from.",
"example": "12345"
},
"target_object": {
"type": "string",
"description": "The ID of the target object that the rule action is acting on. Currently, this value is always a task GID."
},
"action": {
"type": "string",
"description": "The action ID generated from rule creation."
},
"action_type": {
"type": "string",
"description": "The ID from the configuration used to create the rule action."
},
"idempotency_key": {
"type": "string",
"description": "A unique key associated with the \"run action\" request. App servers should use this key to implement idempotency."
}
}
}
]
},
"RanActionResponse": {
"type": "object",
"description": "The response to an action request.",
"required": [
"action_result"
],
"properties": {
"error": {
"description": "The error that should be displayed to the user.",
"type": "string",
"example": "That resource no longer exists"
},
"action_result": {
"type": "string",
"enum": [
"resources_created",
"ok"
],
"description": "Specifies any additional information that the app wants to send to Asana on completion of the action. Can only be `resources_created` or `ok`.",
"example": "ok"
},
"resources_created": {
"type": "array",
"description": "A field with the data corresponding to the action_result value. Each `action_result` has its own data field shape that Asana expects. `resources_created` expects the name and URL of the resources that the action created.",
"items": {
"$ref": "#/components/schemas/AttachedResourceResponse"
}
}
}
},
"UnauthorizedResponse": {
"description": "An error response object indicating a unauthorized request (i.e., a status code of `401`).",
"type": "object",
"properties": {
"error": {
"description": "The error to display.",
"type": "string",
"example": "Authorization required."
}
}
}
}
},
"paths": {
"/run_action_url_path_placeholder": {
"post": {
"summary": "Run action",
"description": "_Note: The path is a placeholder. The actual path is determined by the configuration of the app component._\n\nThe request made when an action is triggered. Rule actions in rules containing a \"Task added to this project\" trigger have a 2 minute delay for newly created tasks in that project. This is to provide time for the creating user to fill out task details (name, description, etc.) before the rule action is triggered.\n\nAn app server must be hosted in order for rule actions to function. For a brief list of popular hosting options, see [hosting](/docs/hosting). <br> <br> <a href=\"https://d3ki9tyy5l5ruj.cloudfront.net/obj/89ac88743dd7446b7ae94ba88937349cdc50f70f/ac-rule-run-action.png\">\n \n</a>",
"tags": [
"Rule actions"
],
"operationId": "runAction",
"requestBody": {
"description": "Request to notify of an action running.",
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RunActionRequest"
}
}
}
},
"responses": {
"200": {
"description": "Successfully attached the resource created by the form.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/RanActionResponse"
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
},
"410": {
"$ref": "#/components/responses/Gone"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
}
}
}
}
}
}