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
IntegerCurrent page number
Default: 1
Example: 1
per_page
Query
IntegerNumber of items 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_typeStringBroadcast type. Defaults to banner
Allowed values: banner, notification
Default: banner
colorStringBackground color (Deprecated. Use “theme” instead.)
dismissableBooleanIs dismissable
ends_atString (date-time)Ending time
fontStringForeground color (Deprecated. Use “theme” instead.)
message
Required
StringMessage to display
starts_atString (date-time)Starting time
target_access_levelsArray of integersTarget user roles
target_pathStringTarget path
themeStringThe theme for the message
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
IntegerBroadcast message ID

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
IntegerBroadcast message ID

Request body (application/json)

PropertyTypeDescription
broadcast_typeStringBroadcast Type
Allowed values: banner, notification
colorStringBackground color (Deprecated. Use “theme” instead.)
dismissableBooleanIs dismissable
ends_atString (date-time)Ending time
fontStringForeground color (Deprecated. Use “theme” instead.)
messageStringMessage to display
starts_atString (date-time)Starting time
target_access_levelsArray of integersTarget user roles
target_pathStringTarget path
themeStringThe theme for the message
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
IntegerBroadcast message ID

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