Notification objects have a polymorphic structure. They can be of various types and each type has a certain set of actions that describe the notification further.
Notification content (specifically resource
and context
fields) varies based on the value of type field. These variations and their details are described in the table below.
Type | Actions | Context | Resource | Description |
---|---|---|---|---|
workspace.project | activated archived deleted ownership_transferred | - | Project (extra: { name, platform }) | Used for changes related to projects in a workspace. |
workspace.styleguide | activated archived deleted ownership_transferred | - | Styleguide (extra: { name, platform }) | Used for changes related to styleguides in a workspace. |
workspace.organization.member | role_updated invited | Organization (extra: { name }) | OrganizationMember (extra: { role }) | Used for changes related to members of a workspace. |
project.screen | created version_created deleted | Project (extra: { name, platform }) ScreenVersion (extra: { image_url, thumbnails, width, height }) | Screen (extra: { name }) | Used for changes related to screens in a project. |
project.screen.note | created mentioned | Project (extra: { name, platform }) Screen (extra: { name }) ScreenNoteComment (extra: { content }) | Screen (extra: { order, color, status }) | Used for changes related to notes. |
project.screen.note.comment | created mentioned | Project (extra: { name, platform }) Screen (extra: { name }) Screen (extra: { order, color, status }) | ScreenNoteComment (extra: { content }) | Used for changes related to note comments. |
project.color | created updated deleted | Project (extra: { name, platform }) | Color (extra: { name, r, g, b, a }) | Used for changes related to colors in a project. |
project.text_style | created updated deleted | Project (extra: { name, platform }) | TextStyle (extra: { name }) | Used for changes related to text styles in a project. |
project.component | created version_created deleted | Project (extra: { name, platform }) | Component (extra: { name }) | Used for changes related to components in a project. |
project.spacing_token | created updated deleted | Project (extra: { name, platform }) | SpacingToken (extra: { name, value }) | Used for changes related to spacing tokens in a project. |
project.member | joined | Project (extra: { name, platform }) | Used for changes related to members of a project. | |
project.extension | added removed | Project (extra: { name, platform }) | Extension (extra: { name }) | Used for changes related to extensions in a project. |
project.slack_integration | added | Project (extra: { name, platform }) | SlackIntegration (extra: { channel }) | Used for changes related to slack intgrations in a project. |
project.jira_attachment | added removed | Project (extra: { name, platform }) | JiraIntegration (extra: { issue }) | Used for changes related to jira attachments in a project. |
project.screen.jira_attachment | added removed | Project (extra: { name, platform }) Screen (extra: { name }) | JiraIntegration (extra: { issue }) | Used for changes related to jira attachments in a screen. |
project.screen_section.jira_attachment | added removed | Project (extra: { name, platform }) ScreenSection (extra: { name }) | JiraIntegration (extra: { issue }) | Used for changes related to jira attachments in a screen section. |
project.flow_board | added | Project (extra: { name, platform }) | FlowBoard (extra: {}) | Used for changes related to flow boards in a project. |
styleguide.color | created updated deleted | Styleguide (extra: { name, platform }) | Color (extra: { name, r, g, b, a }) | Used for changes related to colors in a styleguide. |
styleguide.text_style | created updated deleted | Styleguide (extra: { name, platform }) | TextStyle (extra: { name }) | Used for changes related to text styles in a styleguide. |
styleguide.component | created version_created deleted | Styleguide (extra: { name, platform }) | Component (extra: { name }) | Used for changes related to components in a styleguide. |
styleguide.spacing_token | created updated deleted | Styleguide (extra: { name, platform }) | SpacingToken (extra: { name, value }) | Used for changes related to spacing tokens in a styleguide. |
styleguide.member | joined | Styleguide (extra: { name, platform }) | User (extra: { username }) | Used for changes related to members of a styleguide. |
styleguide.extension | added removed | Styleguide (extra: { name, platform }) | Extension (extra: { name }) | Used for changes related to extensions in a styleguide. |
styleguide.slack_integration | added | Styleguide (extra: { name, platform }) | SlackIntegration (extra: { channel }) | Used for changes related to slack intgrations in a styleguide. |
user.project_membership | invited role_updated removed | - | Project (extra: { name, platform }) | Used for changes related to notified user's membership to projects. |
user.styleguide_membership | invited role_updated removed | - | Styleguide (extra: { name, platform }) | Used for changes related to notified user's membership to styleguides. |
Type: object
Attribute | Type | Description |
---|---|---|
id | string | The unique id of the notification |
type | Notification Type | Type of the notification |
is_read | boolean | Whether the notification is read or not |
action | string | Action that causes the notification |
created | integer | The unix timestamp when the screen was created |
updated | integer | The unix timestamp when the screen was updated |
resource | Notification Resource (Optional) | - |
context | object | Additional objects which are related to the main resource object. The content of this object changes depending on the type field (e.g. { project: { ... }, screen: { ... } } for a screen related notification). |
actor | Notification Actor | - |
Example
{
"id": "5fbe387f8c72ef23659fb500",
"timestamp": 1586852836,
"type": "project.color",
"action": "created",
"is_read": false,
"resource": {
"id": "5dbad85a76ea51c1f35b6f69",
"type": "Color",
"extra": {
"name": "baby poop green",
"r": 143,
"g": 152,
"b": 5,
"a": 1
}
},
"context": {
"project": {
"id": "5db81e73e1e36ee19f138c1a",
"type": "Project",
"extra": {
"name": "HAL 9000",
"platform": "web"
}
}
},
"actor": {
"user": {
"id": "5d9caaecb4a3fa9bc9718686",
"email": "[email protected]",
"username": "zozo",
"emotar": "🍎",
"avatar": "http://placekitten.com/200/300",
"last_seen": 1616739240
}
}
}