API Reference version 2

Create global action

PUT/v2/extension/action/{key}

Create a global action.

Dynamically created actions have the following restrictions:

  • You can only create 10 global actions
  • You cannot modify an action that was declared in the descriptor

Path parameters

Type Parameter Description Required?
string key

Unique key (in the context of the integration) to identify this action.

Valid length range: 1 - 40.

Required

Request body

Type Property Description Required?
str | obj target

Defines how the action is handled in the client, such as opening a dialog or a sidebar.

Required
object [target, object 2]

An object with the following properties.

Required
object options

An object containing options which vary based on the type of target.

string key

The key of a dialog, glance or web panel that should be opened in response to this action.

Valid length range: 1 - 40.

Required
integer weight

Determines the order in which the action appears in menu or list.

Defaults to 100.

string location

The location of this action

Valid values: hipchat.message.action, hipchat.input.action.

Required
string key

Unique key (in the context of the integration) to identify this action.

Valid length range: 1 - 40.

Required
array conditions

Conditions determine whether this action is shown

A mixed array of the following types.

object [conditions array, option 1]

An object with the following properties.

Required
boolean invert

A flag indicating whether to invert the boolean result of the condition.

object params

A map of key/value parameters for a built-in condition.

string condition

The identifier of a built-in condition.

Valid values: room_is_public, user_is_admin, user_is_guest, user_is_room_owner, message_matches, message_contains_link, message_sent_by_current_user, card_matches.

Required
object [conditions array, option 2]

An object with the following properties.

Required
array conditions

The conditions to compose using the specific logical operator.

A mixed array of the following types.

Required
object [conditions array, option 1]

An object with the following properties.

Required
boolean invert

A flag indicating whether to invert the boolean result of the condition.

object params

A map of key/value parameters for a built-in condition.

string condition

The identifier of a built-in condition.

Valid values: room_is_public, user_is_admin, user_is_guest, user_is_room_owner, message_matches, message_contains_link, message_sent_by_current_user, card_matches.

Required
object [conditions array, option 2]

An object with the following properties.

Required
array conditions

The conditions to compose using the specific logical operator.

A mixed array of the following types.

Required
object [conditions array, option 1]

An object with the following properties.

Required
boolean invert

A flag indicating whether to invert the boolean result of the condition.

object params

A map of key/value parameters for a built-in condition.

string condition

The identifier of a built-in condition.

Valid values: room_is_public, user_is_admin, user_is_guest, user_is_room_owner, message_matches, message_contains_link, message_sent_by_current_user, card_matches.

Required
string type

Defines what logical operator is used to evaluate the list of conditions.

Valid values: and, or, AND, OR.

Required
string type

Defines what logical operator is used to evaluate the list of conditions.

Valid values: and, or, AND, OR.

Required
object name

The display name of the action.

Required
string i18n

The optional localization key, used to look up the localized value.

Valid length range: 1 - 40.

string value

The default text.

Valid length range: 1 - 100.

Required
201 application/json
Type Property Description Required?
str | int id

The unique identifier for the created entity

Required
object links

An object with the following properties.

Required
string self Required