Use this API to interact with banners and notifications displayed in the UI. For more information, see broadcast messages.

GET requests do not require authentication. All other broadcast message API endpoints are accessible only to administrators. Non-GET requests by:

  • Unauthenticated users result in 401 Unauthorized.
  • Authenticated non-administrators result in 403 Forbidden.

List all broadcast messages

GET /api/v4/broadcast_messages

Lists all broadcast messages for the instance.

Parameters

NameTypeDescription
page
Query
IntegerPage number of results to retrieve
Default: 1
Example: 1
per_page
Query
IntegerNumber of items to list per page
Default: 20
Example: 20

Responses

CodeDescriptionSchema
200OKAPIEntitiesSystemBroadcastMessage
400Bad Request—

Create a broadcast message

POST /api/v4/broadcast_messages

Creates a broadcast message.

Request body (application/json)

PropertyTypeDescription
broadcast_typeStringAppearance type of the broadcast message
Allowed values: banner, notification
Default: banner
colorStringBackground color hex code. Deprecated. Use theme instead
dismissableBooleanIf true, the user can dismiss the message
ends_atString (date-time)Ending time, in UTC. When creating a message, defaults to one hour after the current time
fontStringForeground color hex code. Deprecated. Use theme instead
message
Required
StringMessage to display
starts_atString (date-time)Starting time, in UTC. When creating a message, defaults to the current time
target_access_levelsArray of integersTarget access levels (roles) of the broadcast message
target_pathStringTarget path of the broadcast message
themeStringColor theme for the broadcast message. Applies only to banners
Allowed values: indigo, light-indigo, blue, light-blue, green, light-green, red, light-red, dark, light

Responses

CodeDescriptionSchema
201CreatedAPIEntitiesSystemBroadcastMessage
400Bad Request—

Retrieve a broadcast message

GET /api/v4/broadcast_messages/{id}

Retrieves a specified broadcast message.

Parameters

NameTypeDescription
id
Path, required
IntegerID of the broadcast message

Responses

CodeDescriptionSchema
200OKAPIEntitiesSystemBroadcastMessage
400Bad Request—
404Not Found—

Update a broadcast message

PUT /api/v4/broadcast_messages/{id}

Updates a specified broadcast message.

Parameters

NameTypeDescription
id
Path, required
IntegerID of the broadcast message

Request body (application/json)

PropertyTypeDescription
broadcast_typeStringAppearance type of the broadcast message
Allowed values: banner, notification
colorStringBackground color hex code. Deprecated. Use theme instead
dismissableBooleanIf true, the user can dismiss the message
ends_atString (date-time)Ending time, in UTC. When creating a message, defaults to one hour after the current time
fontStringForeground color hex code. Deprecated. Use theme instead
messageStringMessage to display
starts_atString (date-time)Starting time, in UTC. When creating a message, defaults to the current time
target_access_levelsArray of integersTarget access levels (roles) of the broadcast message
target_pathStringTarget path of the broadcast message
themeStringColor theme for the broadcast message. Applies only to banners
Allowed values: indigo, light-indigo, blue, light-blue, green, light-green, red, light-red, dark, light

Responses

CodeDescriptionSchema
200OKAPIEntitiesSystemBroadcastMessage
400Bad Request—
404Not Found—

Delete a broadcast message

DELETE /api/v4/broadcast_messages/{id}

Deletes a specified broadcast message.

Parameters

NameTypeDescription
id
Path, required
IntegerID of the broadcast message

Responses

CodeDescriptionSchema
200OKAPIEntitiesSystemBroadcastMessage
400Bad Request—
404Not Found—

Schemas

Objects returned by the operations above and objects nested in their request bodies.

APIEntitiesSystemBroadcastMessage

PropertyTypeDescription
activeBoolean—
broadcast_typeStringExample: banner
colorStringExample: #E75E40
dismissableBoolean—
ends_atString (date-time)Example: 2016-01-06T15:39:55.570Z
fontStringExample: #FFFFFF
idInteger (int64)—
messageStringExample: Example broadcast message
starts_atString (date-time)Example: 2016-01-04T15:39:55.570Z
target_access_levelsArrayExample: [10,30]
target_pathStringExample: */welcome
themeStringExample: indigo