Create

This method allows you to create new events that will display on the timeline.

Method URL
POST /api/v1/events.json

Parameters

Param Type Required Notes
sub_category string Yes The subcategory of the event. E.g.: Build Process NB: Category is set on backend
action_taken string Yes The action of the event. E.g.: Started or Failure
status integer No An optional status indicator for the event. Must be 0, 1, or 2
source string No Optional. Allows you to specify from the list below the source of the timeline event.
duration integer No Optional. By specifying the duration of the event in minutes (such as after a build process has completed) the start time will be automatically calculated. End time is at the event creation timestamp.
extra string No Optional. This will be displayed like a description for the event
icon_url string No Optional. The URL of an image to use as the icon for the event on the timeline
url string No Optional. Allows the event to link out to something event-appropriate from the timeline

Status Codes

The status parameter must be one of the following:

Code Description
0 ERROR
1 WARNING
2 OK

Source Values

The source parameter must be one of the following:

Value Description
ansible IT Automation Tool
jira Issue and Project Tracking
jenkins Continuous Integration
teamcity Continuous Integration
servicenow Service Management

Using one these predefined values allows you to make sure of our built-in event timeline icons. Custom images can be uploaded using the icon_url parameter. Icons must be 32x32 pixel images.

Example Submitted Payload

{
  "event":
          {
           "sub_category": "build process",
           "action_taken": "started",
           "status": 2,
           "source": "jira",
           "duration": 15,
           "extra": "Process started successfully"
          }
}

Example Response

Code Status
201 Created

Example Bash Script

The following examples demonstrate how to create an event on the timeline via the API. Events are intended to be created (or triggered) after a CI/CD tool has completed a given task, such as building and deploying an artifact to production after a master code commit. Most CI/CD tools allow for custom shell scripts to be specified and executed as part of a post-deploy process.

Show

This method returns details of the event, specified by the ID given in the URL.

Method URL
GET /api/v1/event/[event_id].json

Example Response

Code Status
200 OK

Response JSON

{
    "organisation_id": 123,
    "sub_category": "build process",
    "action_taken": "started",
    "status": 2,
    "extra": "Process started successfully"    
}
Tags: events