NAV Navbar
shell
  • Introduction
  • Authentication
  • Errors
  • Pagination and Filters
  • Account
  • Alert
  • Broadcast
  • Event
  • Incident
  • Integration
  • Log
  • Notification
  • Schedule
  • Team
  • Token
  • User
  • Introduction

    The PagerTree API is organized around REST. Our API has predictable, resource-oriented URLs, and uses HTTP response code to indicate API errors. We use built-in HTTP features, like HTTP authentication and HTTP verbs which are understood by off-the-shelf http clients. We support cross-origin resource sharing, allowing you to interact securely with our API from a client-side web application. JSON is returned by all API responses, including errors.

    Authentication

    To authenticate, use this code:

    curl -H "Content-Type: application/json" \
      -X POST \
      -d '{"username":"<username>","password":"<password>"}' \
      https://api.pagertree.com/public/login
    

    Make sure to replace <username> and <password> with your credentials. The above command returns JSON structured like this:

    {
      "token": 1
    }
    

    PagerTree uses JSON Web Tokens (JWTs) to allow access to the API. You will need to login with your user credentials using the /public/login endpoint.

    Authorization: <token>

    Errors

    An example error message

    {
      "errors": [
        {
          "message": "'email' is a required parameter"
        }
      ],
    }
    

    PagerTree uses conventional HTTP response code to indicate the success or failure of an API request. In general: codes in the 2xx range indicate success. Codes in the 4xx range indicate an error that failed given the information provided (e.g., a required parameter was omitted, a wrongly formatted object, etc.). Codes in the 5xx range indicate an error with PagerTree's servers (these are rare).

    Most 4xx errors that could be handled programmatically (e.g. a bad format) include and error response that briefly explains the error.

    Error Code Meaning Description
    400 Bad Request The request was unacceptable, often due to a missing required parameter.
    401 Unauthorized A valid JSON token was not provided.
    403 Forbidden You don't have access to the resource requested.
    404 Not Found The resource does not exist.
    409 Conflict The request conflicts with another request (perhaps using the same id or key).
    429 Too Many Requests Too many request hit the API too quickly. We recommend an exponential backoff.
    500 Internal Server Error Something went wrong on PagerTree's servers. (These are rare.)

    Pagination and Filters

    All top-level API resources have support for bulk fetches via the "list" API methods. These list API methods share a common structure, taking at least these two parameters: limit and offset.

    Alternatively you may request pages by providing these two parameters: limit and page.

    Pagination Parameters

    Parameter Default Description
    limit 10 A limit on the number of objects to be returned, between 1 and 100
    offset 0 A cursor to use in pagination. The number of elements to skip.
    page 1 A cursor to use in pagination. Uses the limit to calculate current offset.

    Response Format

    Parameter Type Description
    data array The array of objects requested.
    has_more boolean Whether or not there are more elements available after this request. If false, this list comprises the end of the set.
    total_count number Number of total elements that exist.

    Filter Parameters

    For any resource you are querying via the top-level API you can pass any attributes of those objects to filter on.

    An example query url might look like the following:

    https://api.pagertree.com/user?name=austin

    You can also pass modifiers to modify the filters. The modifiers must be in the query parameter ops and have the format <attribute_name>:<operation>, where operation is any of the following:

    Operators

    Name Type Comparison
    equals === attribute === value
    ne !== attribute !== value
    lt < attribute < value
    lte <= attribute <= value
    gt > attribute > value
    gte >= attribute >= value
    beginsWith string begins with attribute.beginsWith(value)
    contains string or array contains attribute.contains(value)

    An example query url might look like the following:

    https://api.pagertree.com/user?name=austin&ops=name:beginsWith

    Account

    An account represents your company organization.

    The account object

    Parameter Type Description
    sid string Security identifier for the object.
    id string Unique identifier for the object.
    createdAt timestamp When this object was first created.
    updatedAt timestamp When this object last updated.
    active boolean Does the account have an active subscript (active or trialing).
    name string The name of the account.
    token_id string The unique identifier of the token to use for invites to join the account.
    hipaanotifications boolean Are HIPAA notification enabled?
    stripe_customer_id string The Stripe customer id
    stripe_subscription object The Stripe subscription object.
    stripe_customer object The Stripe customer object.

    Retrieve an account

    curl -H "Content-Type: application/json" \
      -H "Authorization: <token>" \
      https://api.pagertree.com/account/:id
    

    The above command returns JSON structured like this:

    {
      "sid": "acc_H1fh_yx6z",
      "id": "acc_H1fh_yx6z",
      "updatedAt": "2018-04-27T00:03:06.098Z",
      "createdAt": "2018-04-27T00:02:50.419Z",
      "name": "PagerTree LLC",
      "setup_complete": 1524787386,
      "token_id": "tkn_ByGE2ukxpf",
      "hipaanotifications": false,
      "active": true,
      "stripe_customer_id": "cus_CkpiEkrJ40EIJd",
      "stripe_customer": {...},
      "stripe_subscription": {...}
    }
    

    Definition

    GET https://api.pagertree.com/account/:id

    URL Parameters

    Parameter Description
    id The id of the account to retrieve

    Update an account

    Example Request

    curl -H "Content-Type: application/json" \
      -H "Authorization: <token>" \
      -d '{"hipaanotifications": true}'\
      -X PUT \
      https://api.pagertree.com/user/:id
    

    The above command returns JSON structured like this:

    {
      "sid": "acc_H1fh_yx6z",
      "id": "acc_H1fh_yx6z",
      "updatedAt": "2018-04-27T00:03:06.098Z",
      "createdAt": "2018-04-27T00:02:50.419Z",
      "name": "PagerTree LLC",
      "setup_complete": 1524787386,
      "token_id": "tkn_ByGE2ukxpf",
      "hipaanotifications": true,
      "active": true,
      "stripe_customer_id": "cus_CkpiEkrJ40EIJd",
      "stripe_customer": {...},
      "stripe_subscription": {...}
    }
    

    Definition

    PUT https://api.pagertree.com/account/:id

    URL Parameters

    Parameter Description
    id The id of the account to update

    See the account object for all parameters.

    Returns

    The newly updated user object if the request succeeded. Returns an error otherwise.

    Alert

    A alert represents a message that must be sent to the user.

    The alert object

    Example Response

    {
      "sid":"acc_H1fh_yx6z",
      "id":"alt_HJ3eGW-6M",
      "createdAt":"2018-04-27T20:02:59.778Z",
      "source_id":"inc_H1DxGWbpG",
      "user_id":"usr_r1mnuJg6z",
      "channels":["push","email"],
      "type":"incident",
      "template":"notify",
      "data":["inc_H1DxGWbpG"]
    }
    
    Parameter Type Description
    sid string Security identifier for the object.
    id string Unique identifier for the object.
    createdAt timestamp When this object was first created.
    source_id string The source that created this alert. Could be an incident, broadcast, user, or PagerTree self generated.
    user_id string The id of the user that needs to be notified.
    channels array An array of channels to notify this user on.
    type string The type of alert.
    template string The template to use.
    data array An array of data ids, specific to the type and template.

    Retrieve a alert

    Example Request

    curl -H "Content-Type: application/json" \
      -H "Authorization: <token>" \
      https://api.pagertree.com/alert/:id
    

    The above command returns JSON structured like this:

    {
      "sid":"acc_H1fh_yx6z",
      "id":"alt_HJ3eGW-6M",
      "createdAt":"2018-04-27T20:02:59.778Z",
      "source_id":"inc_H1DxGWbpG",
      "user_id":"usr_r1mnuJg6z",
      "channels":["push","email"],
      "type":"incident",
      "template":"notify",
      "data":["inc_H1DxGWbpG"]
    }
    

    Definition

    GET https://api.pagertree.com/alert/:id

    URL Parameters

    Parameter Description
    id The id of the alert to retrieve

    Returns

    Returns a alert if a valid alert id was provided. Returns an error otherwise.

    List all alerts

    Example Request

    curl -H "Content-Type: application/json" \
      -H "Authorization: <token>" \
      https://api.pagertree.com/alert
    

    The above command returns JSON structured like this:

    {
      "data": [
        {...},
        {...},
      ],
      "has_more": false,
      "total_count": 2
    }
    

    Definition

    GET https://api.pagertree.com/alert

    Returns

    A paginated response with a data array property. Each item in the array is a alert object.

    List all notifications for an lert

    Example Request

    curl -H "Content-Type: application/json" \
      -H "Authorization: <token>" \
      https://api.pagertree.com/alert/:id/notifications
    

    The above command returns JSON structured like this:

    [
      "data": [
        {...},
        {...},
      ],
      "has_more": false,
      "total_count": 2
    ]
    

    Definition

    GET https://api.pagertree.com/alert/:id/notifications

    URL Parameters

    Parameter Description
    id The id of the alert to get notifications for

    Returns

    A paginated response with a data array property. Each item in the array is a notification object.

    Broadcast

    A broadcast is mass alert that can be sent to users.

    The broadcast object

    Example Response

    {
      "sid":"acc_H1fh_yx6z",
      "message":"SEV 1 security infiltration. All hands on deck!",
      "source_id":"usr_r1mnuJg6z",
      "user_ids":["usr_t2fJunzAk"],
    }
    
    Parameter Type Description
    sid string Security identifier for the object.
    id string Unique identifier for the object.
    createdAt timestamp When this object was first created.
    message string The message to be sent.
    source_id string The source user id that created the broadcast.
    user_ids array An array of user ids that the broadcast will send to.

    Create a broadcast

    Example Request

    curl -H "Content-Type: application/json" \
      -H "Authorization: <token>" \
      -d '{"message":"SEV 1 security infiltration. All hands on deck!","source_id":"usr_r1mnuJg6z","user_ids":["usr_r1mnuJg6z"]}'\
      https://api.pagertree.com/broadcast
    

    The above command returns JSON structured like this:

    {
      "sid":"acc_H1fh_yx6z",
      "id":"brd_H1NCdG-TM",
      "createdAt":"2018-04-27T21:40:28.469Z",
      "message":"SEV 1 security infiltration. All hands on deck!",
      "source_id":"usr_r1mnuJg6z",
      "user_ids":["usr_r1mnuJg6z"]
    }
    

    Definition

    POST https://api.pagertree.com/broadcast

    Body Parameters

    Parameter Description
    message The message to be sent.
    source_id The source user id that created the broadcast.
    user_ids An array of user ids that the broadcast will send to.

    Returns

    The newly created broadcast object if the request succeeded. Returns an error otherwise.

    Retrieve a broadcast

    Example Request

    curl -H "Content-Type: application/json" \
      -H "Authorization: <token>" \
      https://api.pagertree.com/broadcast/:id
    

    The above command returns JSON structured like this:

    {
      "sid":"acc_H1fh_yx6z",
      "id":"brd_H1NCdG-TM",
      "createdAt":"2018-04-27T21:40:28.469Z",
      "message":"SEV 1 security infiltration. All hands on deck!",
      "source_id":"usr_r1mnuJg6z",
      "user_ids":["usr_r1mnuJg6z"]
    }
    

    Definition

    GET https://api.pagertree.com/broadcast/:id

    URL Parameters

    Parameter Description
    id The id of the broadcast to retrieve

    Returns

    Returns a broadcast if a valid broadcast id was provided. Returns an error otherwise.

    List all broadcasts

    Example Request

    curl -H "Content-Type: application/json" \
      -H "Authorization: <token>" \
      https://api.pagertree.com/broadcast
    

    The above command returns JSON structured like this:

    {
      "data": [
        {...},
        {...},
      ],
      "has_more": false,
      "total_count": 2
    }
    

    Definition

    GET https://api.pagertree.com/broadcast

    Returns

    A paginated response with a data array property. Each item in the array is a broadcast object.

    Event

    An event represents a calendar event. It can be one time or recurring.

    The event object

    Example Response

    {
      "sid":"acc_H1fh_yx6z",
      "id":"evt_rJ0XMGWTM",
      "createdAt":"2018-04-27T21:12:05.774Z",
      "updatedAt":"2018-04-27T21:22:47.927Z",
      "schedule_id":"skd_BJzQnuklaG",
      "user_id":"usr_r1mnuJg6z",
      "start":1524898800,
      "end":1524985200,
      "repeat":false,
      "layer":2,
      "dow":[0,1,2,3,4,5,6],
      "frequency":1,
      "exceptions":[]
    }
    
    Parameter Type Description
    sid string Security identifier for the object.
    id string Unique identifier for the object.
    createdAt timestamp When this object was first created.
    updatedAt timestamp When this object last updated.
    schedule_id string The schedule id that this event belongs to.
    user_id string The user id that this event belongs to.
    layer number The layer of this event.
    start number A unix timestamp of when the event starts.
    end number A unix timestamp of when the event ends.
    repeat boolean Flag indicating if this is a reoccurring event.
    repeatend number A unix timestamp of when the repeating event ends.
    p_event_id string If this event is recurring, and a modified occurrence, the parent event id of the repeating event.
    dow array Array of days of the week this event repeats on 0 (Sunday) - 6 (Saturday). Moment Day of Week
    frequency number Number of days between repeats.
    exceptions object An array of unix timestamps of the start date of the exceptions.

    Create a event

    Example Request

    curl -H "Content-Type: application/json" \
      -H "Authorization: <token>" \
      -d '{"schedule_id":"skd_BJzQnuklaG","user_id":"usr_r1mnuJg6z","start":1524898800,"end":1524985200}'\
      https://api.pagertree.com/event
    

    The above command returns JSON structured like this:

    {
      "sid":"acc_H1fh_yx6z",
      "id":"evt_rJ0XMGWTM",
      "createdAt":"2018-04-27T21:12:05.774Z",
      "schedule_id":"skd_BJzQnuklaG",
      "user_id":"usr_r1mnuJg6z",
      "layer":1,
      "start":1524898800,
      "end":1524985200,
      "repeat":false,
      "dow":[1,2,3,4,5,6,7],
      "frequency":1,
      "exceptions":[]
    }
    

    Definition

    POST https://api.pagertree.com/event

    Body Parameters

    Parameter Description
    schedule_id The id of the schedule that this event belongs to.
    user_id The id of the user that this event belongs to.
    start The start timestamp (unix) of the event.
    end The end timestamp (unix) of the event.

    See the event object for optional parameters.

    Returns

    The newly created event object if the request succeeded. Returns an error otherwise.

    Retrieve a event

    Example Request

    curl -H "Content-Type: application/json" \
      -H "Authorization: <token>" \
      https://api.pagertree.com/event/:id
    

    The above command returns JSON structured like this:

    {
      "sid":"acc_H1fh_yx6z",
      "id":"evt_S1mmhd1gaM",
      "createdAt":"2018-04-27T00:02:51.374Z",
      "updatedAt":"2018-04-27T21:30:46.258Z",
      "schedule_id":"skd_BJzQnuklaG",
      "repeat":true,
      "user_id":"usr_r1mnuJg6z",
      "layer":1,
      "start":1524726000,
      "end":1524812400,
      "dow":[1,2,3,4,5,6,7],
      "frequency":1,
      "exceptions": [
        {
          "start":1526022000,
          "event_id":null
        }
      ]
    }
    

    Definition

    GET https://api.pagertree.com/event/:id

    URL Parameters

    Parameter Description
    id The id of the event to retrieve

    Returns

    Returns a event if a valid event id was provided. Returns an error otherwise.

    Update a event

    Example Request

    curl -H "Content-Type: application/json" \
      -H "Authorization: <token>" \
      -d '{"layer": 2}'\
      -X PUT \
      https://api.pagertree.com/event/:id
    

    The above command returns JSON structured like this:

    {
      "sid":"acc_H1fh_yx6z",
      "id":"evt_rJ0XMGWTM",
      "createdAt":"2018-04-27T21:12:05.774Z",
      "updatedAt":"2018-04-27T21:22:47.927Z",
      "schedule_id":"skd_BJzQnuklaG",
      "user_id":"usr_r1mnuJg6z",
      "start":1524898800,
      "end":1524985200,
      "repeat":false,
      "layer":2,
      "dow":[1,2,3,4,5,6,7],
      "frequency":1,
      "exceptions":[]
    }
    

    Definition

    PUT https://api.pagertree.com/event/:id

    URL Parameters

    Parameter Description
    id The id of the event to update

    See the event object for all parameters.

    Returns

    The newly updated event object if the request succeeded. Returns an error otherwise.

    Delete a event

    Example Request

    curl -H "Content-Type: application/json" \
      -H "Authorization: <token>" \
      -X DELETE \
      https://api.pagertree.com/event/:id
    

    Definition

    DELETE https://api.pagertree.com/event/:id

    URL Parameters

    Parameter Description
    id The id of the event to delete

    Returns

    A 204 - NO CONTENT on success or 404 - NOT FOUND on failure.

    List all events

    Example Request

    curl -H "Content-Type: application/json" \
      -H "Authorization: <token>" \
      https://api.pagertree.com/event
    

    The above command returns JSON structured like this:

    {
      "data": [
        {...},
        {...},
      ],
      "has_more": false,
      "total_count": 2
    }
    

    Definition

    GET https://api.pagertree.com/event

    Returns

    A paginated response with a data array property. Each item in the array is a event object.

    Incident

    A incident represents outage, event, or occurrence.

    The incident object

    Example Response

    {
      "sid":"acc_H1fh_yx6z",
      "id":"inc_H1DxGWbpG",
      "createdAt":"2018-04-27T20:02:55.098Z",
      "updatedAt":"2018-04-27T20:04:47.949Z",
      "title":"CPU usage over 95%",
      "description":"PROD APP 1 CPU load over 95% for 5 minutes.",
      "created":1524859374,
      "acknowledged":1524859483,
      "resolved":1524859487,
      "source_id":"usr_r1mnuJg6z",
      "d_team_id":"tem_ByxQ3ukgTM",
      "d_user_id":"usr_r1mnuJg6z",
      "urgency":"critical",
      "status":"resolved",
      "workflows":[{...}],
    }
    
    Parameter Type Description
    sid string Security identifier for the object.
    id string Unique identifier for the object.
    createdAt timestamp When this object was first created.
    updatedAt timestamp When this object last updated.
    lastlogin number A unix timestamp of the last login.
    title string The title of the incident.
    description string The description of the incident.
    created number The unix timestamp of when the incident was created.
    acknowledged number The unix timestamp of when the incident was acknowledged.
    resolved number The unix timestamp of when the incident was resolved.
    source_id string The id of the user or integration that created this incident.
    d_team_id string The team id of the team that the incident is assigned to.
    d_user_id string The user id of the user that acknowledged this incident.
    urgency string The urgency of the incident.
    status string The status of the incident.
    workflows array Of workflow object indicating rejects, timeouts, and acknowledged for an incident workflow.

    Create a incident

    Example Request

    curl -H "Content-Type: application/json" \
      -H "Authorization: <token>" \
      -d '{"title":"CPU usage over 95%","description":"PROD APP 1 CPU load over 95% for 5 minutes.","urgency":"critical", "d_team_id":"tem_ByxQ3ukgTM"}'\
      https://api.pagertree.com/incident
    

    The above command returns JSON structured like this:

    {
      "sid":"acc_H1fh_yx6z",
      "id":"inc_H1DxGWbpG",
      "createdAt":"2018-04-27T20:02:55.098Z",
      "title":"CPU usage over 95%",
      "description":"PROD APP 1 CPU load over 95% for 5 minutes.",
      "created":1524859374,
      "source_id":"usr_r1mnuJg6z",
      "d_team_id":"tem_ByxQ3ukgTM",
      "urgency":"critical",
      "status":"open"
    }
    

    Definition

    POST https://api.pagertree.com/incident

    Body Parameters

    Parameter Description
    title The title of the incident.
    description The description of the incident.
    d_team_id The destination team id of the incident.

    See the incident object for optional parameters.

    Returns

    The newly created incident object if the request succeeded. Returns an error otherwise.

    Retrieve a incident

    Example Request

    curl -H "Content-Type: application/json" \
      -H "Authorization: <token>" \
      https://api.pagertree.com/incident/:id
    

    The above command returns JSON structured like this:

    {
      "sid":"acc_H1fh_yx6z",
      "id":"inc_H1DxGWbpG",
      "createdAt":"2018-04-27T20:02:55.098Z",
      "updatedAt":"2018-04-27T20:04:47.949Z",
      "title":"CPU usage over 95%",
      "description":"PROD APP 1 CPU load over 95% for 5 minutes.",
      "created":1524859374,
      "acknowledged":1524859483,
      "resolved":1524859487,
      "source_id":"usr_r1mnuJg6z",
      "d_team_id":"tem_ByxQ3ukgTM",
      "d_user_id":"usr_r1mnuJg6z",
      "urgency":"critical",
      "status":"resolved",
      "workflows":[{...}]
    }
    

    Definition

    GET https://api.pagertree.com/incident/:id

    URL Parameters

    Parameter Description
    id The id of the incident to retrieve

    Returns

    Returns a incident if a valid incident id was provided. Returns an error otherwise.

    Update a incident

    Example Request

    curl -H "Content-Type: application/json" \
      -H "Authorization: <token>" \
      -d '{"urgency": "high"}'\
      -X PUT \
      https://api.pagertree.com/incident/:id
    

    The above command returns JSON structured like this:

    {
      "sid":"acc_H1fh_yx6z",
      "id":"inc_H1DxGWbpG",
      "createdAt":"2018-04-27T20:02:55.098Z",
      "updatedAt":"2018-04-27T20:04:47.949Z",
      "title":"CPU usage over 95%",
      "description":"PROD APP 1 CPU load over 95% for 5 minutes.",
      "created":1524859374,
      "acknowledged":1524859483,
      "resolved":1524859487,
      "source_id":"usr_r1mnuJg6z",
      "d_team_id":"tem_ByxQ3ukgTM",
      "d_user_id":"usr_r1mnuJg6z",
      "urgency":"high",
      "status":"resolved",
      "workflows":[{...}]
    }
    

    Definition

    PUT https://api.pagertree.com/incident/:id

    URL Parameters

    Parameter Description
    id The id of the incident to update

    See the incident object for all parameters.

    Returns

    The newly updated incident object if the request succeeded. Returns an error otherwise.

    Delete a incident

    Example Request

    curl -H "Content-Type: application/json" \
      -H "Authorization: <token>" \
      -X DELETE \
      https://api.pagertree.com/incident/:id
    

    Definition

    DELETE https://api.pagertree.com/incident/:id

    URL Parameters

    Parameter Description
    id The id of the incident to delete

    Returns

    A 204 - NO CONTENT on success or 404 - NOT FOUND on failure.

    List all incidents

    Example Request

    curl -H "Content-Type: application/json" \
      -H "Authorization: <token>" \
      https://api.pagertree.com/incident
    

    The above command returns JSON structured like this:

    {
      "data": [
        {...},
        {...},
      ],
      "has_more": false,
      "total_count": 2
    }
    

    Definition

    GET https://api.pagertree.com/incident

    Returns

    A paginated response with a data array property. Each item in the array is a incident object.

    Acknowledge an incident

    Example Request

    curl -H "Content-Type: application/json" \
      -H "Authorization: <token>" \
      -X POST
      https://api.pagertree.com/incident/:id/acknowledge
    

    The above command returns JSON structured like this:

    {
      "sid":"acc_H1fh_yx6z",
      "id":"inc_H1DxGWbpG",
      "createdAt":"2018-04-27T20:02:55.098Z",
      "updatedAt":"2018-04-27T20:04:47.949Z",
      "title":"CPU usage over 95%",
      "description":"PROD APP 1 CPU load over 95% for 5 minutes.",
      "created":1524859374,
      "acknowledged":1524859483,
      "source_id":"usr_r1mnuJg6z",
      "d_team_id":"tem_ByxQ3ukgTM",
      "d_user_id":"usr_r1mnuJg6z",
      "urgency":"critical",
      "status":"acknowledged",
      "workflows":[{...}]
    }
    

    Definition

    POST https://api.pagertree.com/incident/:id/acknowledge

    URL Parameters

    Parameter Description
    id The id of the incident to acknowledge

    Returns

    The newly acknowledged incident object if the request succeeded. Returns an error otherwise.

    Resolve an incident

    Example Request

    curl -H "Content-Type: application/json" \
      -H "Authorization: <token>" \
      -X POST
      https://api.pagertree.com/incident/:id/resolve
    

    The above command returns JSON structured like this:

    {
      "sid":"acc_H1fh_yx6z",
      "id":"inc_H1DxGWbpG",
      "createdAt":"2018-04-27T20:02:55.098Z",
      "updatedAt":"2018-04-27T20:04:47.949Z",
      "title":"CPU usage over 95%",
      "description":"PROD APP 1 CPU load over 95% for 5 minutes.",
      "created":1524859374,
      "acknowledged":1524859483,
      "resolved":1524859487,
      "source_id":"usr_r1mnuJg6z",
      "d_team_id":"tem_ByxQ3ukgTM",
      "d_user_id":"usr_r1mnuJg6z",
      "urgency":"high",
      "status":"resolved",
      "workflows":[{...}]
    }
    

    Definition

    POST https://api.pagertree.com/incident/:id/resolve

    URL Parameters

    Parameter Description
    id The id of the incident to resolve

    Returns

    The newly resolve incident object if the request succeeded. Returns an error otherwise.

    Integration

    A integration connects PagerTree to 3rd party applications.

    The integration object

    Example Response

    {
      "sid":"acc_H1fh_yx6z",
      "id":"int_Skbm3OJe6f",
      "createdAt":"2018-04-27T00:02:51.011Z",
      "updatedAt":"2018-04-27T19:38:47.220Z",
      "name":"Devops Email",
      "type":"email",
      "d_team_id":"tem_ByxQ3ukgTM",
      "urgency":"medium",
      "enabled":true
    }
    
    Parameter Type Description
    sid string Security identifier for the object.
    id string Unique identifier for the object.
    createdAt timestamp When this object was first created.
    updatedAt timestamp When this object last updated.
    name string The name of the integration.
    type string The type of the integration.
    d_team_id string The destination team id for any incident created from this integration.
    urgency string The urgency of the incident to be created.
    enabled boolean If enabled the integration will create incidents, if not it will ignore incoming requests.

    Create a integration

    Example Request

    curl -H "Content-Type: application/json" \
      -H "Authorization: <token>" \
      -d '{"sid":"acc_H1fh_yx6z","enabled":true,"name":"Apex Ping Integration","type":"apexping","urgency":"critical","d_team_id":"tem_ByxQ3ukgTM"}'\
      https://api.pagertree.com/integration
    

    The above command returns JSON structured like this:

    {
      "sid":"acc_H1fh_yx6z",
      "id":"int_BJOG0gZpz",
      "createdAt":"2018-04-27T19:46:24.394Z",
      "name":"Apex Ping Integration",
      "type":"apexping",
      "urgency":"critical",
      "d_team_id":"tem_ByxQ3ukgTM",
      "enabled": true
    }
    

    Definition

    POST https://api.pagertree.com/integration

    Body Parameters

    Parameter Description
    name The name of the integration.
    type The type of the integration.
    d_team_id The destination team id for any incident created from this integration.

    See the integration object for optional parameters.

    Returns

    The newly created integration object if the request succeeded. Returns an error otherwise.

    Retrieve a integration

    Example Request

    curl -H "Content-Type: application/json" \
      -H "Authorization: <token>" \
      https://api.pagertree.com/integration/:id
    

    The above command returns JSON structured like this:

    {
      "sid":"acc_H1fh_yx6z",
      "id":"int_BJOG0gZpz",
      "createdAt":"2018-04-27T19:46:24.394Z",
      "updatedAt":"2018-04-27T19:50:29.785Z",
      "name":"Apex Ping Integration",
      "type":"apexping",
      "urgency":"critical",
      "d_team_id":"tem_ByxQ3ukgTM",
      "enabled": true
    }
    

    Definition

    GET https://api.pagertree.com/integration/:id

    URL Parameters

    Parameter Description
    id The id of the integration to retrieve

    Returns

    Returns a integration if a valid integration id was provided. Returns an error otherwise.

    Update a integration

    Example Request

    curl -H "Content-Type: application/json" \
      -H "Authorization: <token>" \
      -d '{"enabled": "false"}'\
      -X PUT \
      https://api.pagertree.com/integration/:id
    

    The above command returns JSON structured like this:

    {
      "sid":"acc_H1fh_yx6z",
      "id":"int_BJOG0gZpz",
      "createdAt":"2018-04-27T19:46:24.394Z",
      "updatedAt":"2018-04-27T19:50:29.785Z",
      "name":"Apex Ping Integration",
      "type":"apexping",
      "urgency":"critical",
      "d_team_id":"tem_ByxQ3ukgTM",
      "enabled": false
    }
    

    Definition

    PUT https://api.pagertree.com/integration/:id

    URL Parameters

    Parameter Description
    id The id of the integration to update

    See the integration object for all parameters.

    Returns

    The newly updated integration object if the request succeeded. Returns an error otherwise.

    Delete a integration

    Example Request

    curl -H "Content-Type: application/json" \
      -H "Authorization: <token>" \
      -X DELETE \
      https://api.pagertree.com/integration/:id
    

    Definition

    DELETE https://api.pagertree.com/integration/:id

    URL Parameters

    Parameter Description
    id The id of the integration to delete

    Returns

    A 204 - NO CONTENT on success or 404 - NOT FOUND on failure.

    List all integrations

    Example Request

    curl -H "Content-Type: application/json" \
      -H "Authorization: <token>" \
      https://api.pagertree.com/integration
    

    The above command returns JSON structured like this:

    {
      "data": [
        {...},
        {...},
      ],
      "has_more": false,
      "total_count": 2
    }
    

    Definition

    GET https://api.pagertree.com/integration

    Returns

    A paginated response with a data array property. Each item in the array is a integration object.

    Log

    A log message associated with a resource.

    The log object

    Example Response

    {
      "sid":"acc_H1fh_yx6z",
      "id":"log_ByFxMWWpM",
      "createdAt":"2018-04-27T20:02:57.110Z",
      "owner_id":"inc_H1DxGWbpG",
      "content":"Created by usr_r1mnuJg6z"
    }
    
    Parameter Type Description
    sid string Security identifier for the object.
    id string Unique identifier for the object.
    createdAt timestamp When this object was first created.
    owner_id string The resource that owns this log.
    source_id string The resource that created this log.
    content string A message or data.

    Create a log

    Example Request

    curl -H "Content-Type: application/json" \
      -H "Authorization: <token>" \
      -d '{"owner_id":"inc_H1DxGWbpG","source_id":"usr_r1mnuJg6z","content":"Working on a resolution now."}'\
      https://api.pagertree.com/log
    

    The above command returns JSON structured like this:

    {
      "sid":"acc_H1fh_yx6z",
      "id":"log_Skrc0zbaG",
      "createdAt":"2018-04-27T22:05:00.610Z",
      "owner_id":"inc_H1DxGWbpG",
      "source_id":"usr_r1mnuJg6z",
      "content":"Working on a resolution now."
    }
    

    Definition

    POST https://api.pagertree.com/log

    Body Parameters

    Parameter Description
    owner_id The resource that owns this log.
    content A message or data.

    See the log object for optional parameters.

    Returns

    The newly created user object if the request succeeded. Returns an error otherwise.

    Retrieve a log

    Example Request

    curl -H "Content-Type: application/json" \
      -H "Authorization: <token>" \
      https://api.pagertree.com/log/:id
    

    The above command returns JSON structured like this:

    {
      "sid":"acc_H1fh_yx6z",
      "id":"log_Skrc0zbaG",
      "createdAt":"2018-04-27T22:05:00.610Z",
      "owner_id":"inc_H1DxGWbpG",
      "source_id":"usr_r1mnuJg6z",
      "content":"Working on a resolution now."
    }
    

    Definition

    GET https://api.pagertree.com/log/:id

    URL Parameters

    Parameter Description
    id The id of the log to retrieve

    Returns

    Returns a log if a valid log id was provided. Returns an error otherwise.

    List all logs

    Example Request

    curl -H "Content-Type: application/json" \
      -H "Authorization: <token>" \
      https://api.pagertree.com/log
    

    The above command returns JSON structured like this:

    {
      "data": [
        {...},
        {...},
      ],
      "has_more": false,
      "total_count": 2
    }
    

    Definition

    GET https://api.pagertree.com/log

    Returns

    A paginated response with a data array property. Each item in the array is a log object.

    Notification

    A notification represents a message that was sent to a user on a specific channel.

    The notification object

    Example Response

    {
      "sid":"acc_H1fh_yx6z",
      "id":"ntf_BJTgzZZpf",
      "createdAt":"2018-04-27T20:03:00.736Z",
      "subject":"Incident inc_H1DxGWbpG",
      "message":"CPU usage over 95%\r\n",
      "channel":"push",
      "status":"sent",
    
      "alert_id":"alt_HJ3eGW-6M",
      "user_id":"usr_r1mnuJg6z",
      "from":"PagerTree Push Service",
      "to":"usr_r1mnuJg6z",
      "sent":1524859380,
      "thirdparty_id":"6187714295308613000",
      "repeated":false,
    }
    
    Parameter Type Description
    sid string Security identifier for the object.
    id string Unique identifier for the object.
    createdAt timestamp When this object was first created.
    updatedAt timestamp When this object last updated.
    subject string The subject that will be used for Email and Push notifications.
    message string The body of the messsage.
    channel string The channel this notification was sent on.
    status string The status of the notification.
    alert_id string The alert that triggered this notification.
    user_id string The user this alert was sent to.
    to string The email, phone, slack user, or user id this notification was sent to.
    from string The email, phone, slack bot, or service this notification was sent from.
    sent number A unix timestamp of when the notification sent from PagerTree.
    delivered number A unix timestamp of when the notification was delivered. (if supported)
    repeated boolean For voice notifications, flag indicating if the notification has been repeated.

    Retrieve a notification

    Example Request

    curl -H "Content-Type: application/json" \
      -H "Authorization: <token>" \
      https://api.pagertree.com/notification/:id
    

    The above command returns JSON structured like this:

    {
      "sid":"acc_H1fh_yx6z",
      "id":"ntf_BJTgzZZpf",
      "createdAt":"2018-04-27T20:03:00.736Z",
      "subject":"Incident inc_H1DxGWbpG",
      "message":"CPU usage over 95%\r\n",
      "channel":"push",
      "status":"sent",
    
      "alert_id":"alt_HJ3eGW-6M",
      "user_id":"usr_r1mnuJg6z",
      "from":"PagerTree Push Service",
      "to":"usr_r1mnuJg6z",
      "sent":1524859380,
      "thirdparty_id":"6187714295308613000",
      "repeated":false,
    }
    

    Definition

    GET https://api.pagertree.com/notification/:id

    URL Parameters

    Parameter Description
    id The id of the notification to retrieve

    Returns

    Returns a notification if a valid notification id was provided. Returns an error otherwise.

    Schedule

    A schedule represents an on-call schedule for a team. It defines escalation rules and repetitions. Events and [Teams][#the-team-object] point to a schedule.

    The schedule object

    Example Response

    {
      "sid":"acc_H1fh_yx6z",
      "id":"skd_HJ-awlxZ6M",
      "createdAt":"2018-04-27T18:48:04.614Z",
      "updatedAt":"2018-04-27T19:23:34.631Z",
      "repeat":0,
      "rules":[
        {
          "layer":1,
          "timeout":5
        },{
          "layer":2,
          "timeout":10
        },{
          "layer":3,
          "timeout":15
        }
      ],
    }
    
    Parameter Type Description
    sid string Security identifier for the object.
    id string Unique identifier for the object.
    createdAt timestamp When this object was first created.
    updatedAt timestamp When this object last updated.
    repeat number Number of repetitions to repeat the escalation layers before dropping an incident.
    rules array An array of objects comprised of layer and timeout (in minutes).

    Retrieve a schedule

    Example Request

    curl -H "Content-Type: application/json" \
      -H "Authorization: <token>" \
      https://api.pagertree.com/schedule/:id
    

    The above command returns JSON structured like this:

    {
      "sid":"acc_H1fh_yx6z",
      "id":"skd_HJ-awlxZ6M",
      "createdAt":"2018-04-27T18:48:04.614Z",
      "updatedAt":"2018-04-27T19:23:34.631Z",
      "repeat":0,
      "rules":[
        {
          "layer":1,
          "timeout":5
        },{
          "layer":2,
          "timeout":10
        },{
          "layer":3,
          "timeout":15
        }
      ],
    }
    

    Definition

    GET https://api.pagertree.com/schedule/:id

    URL Parameters

    Parameter Description
    id The id of the schedule to retrieve

    Returns

    Returns a schedule if a valid schedule id was provided. Returns an error otherwise.

    Update a schedule

    Example Request

    curl -H "Content-Type: application/json" \
      -H "Authorization: <token>" \
      -d '{"rules":[{"layer":1,"timeout":"6"},{"layer":2,"timeout":7},{"layer":3,"timeout":8}]}'\
      -X PUT \
      https://api.pagertree.com/schedule/:id
    

    The above command returns JSON structured like this:

    {
      "sid":"acc_H1fh_yx6z",
      "id":"skd_HJ-awlxZ6M",
      "createdAt":"2018-04-27T18:48:04.614Z",
      "updatedAt":"2018-04-27T19:23:34.631Z",
      "repeat":0,
      "rules":[
        {
          "layer":1,
          "timeout":6
        },{
          "layer":2,
          "timeout":7
        },{
          "layer":3,
          "timeout":8
        }
      ],
    }
    

    Definition

    PUT https://api.pagertree.com/schedule/:id

    URL Parameters

    Parameter Description
    id The id of the schedule to update

    See the schedule object for all parameters.

    Returns

    The newly updated schedule object if the request succeeded. Returns an error otherwise.

    List all current events for a schedule

    Example Request

    curl -H "Content-Type: application/json" \
      -H "Authorization: <token>" \
      https://api.pagertree.com/schedule/:id/currentevents
    

    The above command returns JSON structured like this:

    [
      {
        "sid":"acc_H1fh_yx6z",
        "id":"evt_rJ0XMGWTM",
        "createdAt":"2018-04-27T21:12:05.774Z",
        "updatedAt":"2018-04-27T21:22:47.927Z",
        "schedule_id":"skd_BJzQnuklaG",
        "user_id":"usr_r1mnuJg6z",
        "start":1524898800,
        "end":1524985200,
        "repeat":false,
        "layer":2,
        "dow":[1,2,3,4,5,6,7],
        "frequency":1,
        "exceptions":[]
      }
    ]
    

    Definition

    GET https://api.pagertree.com/schedule/:id/currentevents

    URL Parameters

    Parameter Description
    id The id of the schedule to get current events for

    Returns

    An array of any events in which the schedule is currently on-call. Each item in the array is a event object.

    Team

    A team represents an actual or logical team within your organization. It is comprised of users that are called team members.

    The team object

    Example Response

    {
      "sid":"acc_H1fh_yx6z",
      "id":"tem_ByxQ3ukgTM",
      "createdAt":"2018-04-27T00:02:51.010Z",
      "updatedAt":"2018-04-27T00:03:25.867Z",
      "name":"Devops",
      "member_user_ids":["usr_r1mnuJg6z"],
      "schedule_id":"skd_BJzQnuklaG"
    }
    
    Parameter Type Description
    sid string Security identifier for the object.
    id string Unique identifier for the object.
    createdAt timestamp When this object was first created.
    updatedAt timestamp When this object last updated.
    name string The name of the team.
    description string The description of the of the team.
    member_user_ids array An array of user ids that are the team members of this team.
    schedule_id string The on-call schedule id that belongs to this team.

    Create a team

    Example Request

    curl -H "Content-Type: application/json" \
      -H "Authorization: <token>" \
      -d '{"name": "DevOps"}'\
      https://api.pagertree.com/team
    

    The above command returns JSON structured like this:

    {
      "sid":"acc_H1fh_yx6z",
      "id":"tem_ByxQ3ukgTM",
      "createdAt":"2018-04-27T00:02:51.010Z",
      "name":"Devops",
      "member_user_ids":[],
      "schedule_id":"skd_BJzQnuklaG"
    }
    

    Definition

    POST https://api.pagertree.com/team

    Body Parameters

    Parameter Description
    name The name of the team.

    See the team object for optional parameters.

    Returns

    The newly created team object if the request succeeded. Returns an error otherwise.

    Retrieve a team

    Example Request

    curl -H "Content-Type: application/json" \
      -H "Authorization: <token>" \
      https://api.pagertree.com/team/:id
    

    The above command returns JSON structured like this:

    {
      "id":"tem_ByTvll-6M",
      "sid":"acc_H1fh_yx6z",
      "createdAt":"2018-04-27T18:48:04.610Z",
      "updatedAt":"2018-04-27T18:56:30.794Z",
      "name":"Devops",
      "member_user_ids":["usr_r1mnuJg6z"],
      "schedule_id":"skd_HJ-awlxZ6M"
    }
    

    Definition

    GET https://api.pagertree.com/team/:id

    URL Parameters

    Parameter Description
    id The id of the team to retrieve

    Returns

    Returns a team if a valid team id was provided. Returns an error otherwise.

    Update a team

    Example Request

    curl -H "Content-Type: application/json" \
      -H "Authorization: <token>" \
      -d '{"member_user_ids": ["usr_r1mnuJg6z"]}'\
      -X PUT \
      https://api.pagertree.com/team/:id
    

    The above command returns JSON structured like this:

    {
      "id":"tem_ByTvll-6M",
      "sid":"acc_H1fh_yx6z",
      "createdAt":"2018-04-27T18:48:04.610Z",
      "updatedAt":"2018-04-27T18:56:30.794Z",
      "name":"Devops",
      "member_user_ids":["usr_r1mnuJg6z"],
      "schedule_id":"skd_HJ-awlxZ6M"
    }
    

    Definition

    PUT https://api.pagertree.com/team/:id

    URL Parameters

    Parameter Description
    id The id of the team to update

    See the team object for all parameters.

    Returns

    The newly updated team object if the request succeeded. Returns an error otherwise.

    Delete a team

    Example Request

    curl -H "Content-Type: application/json" \
      -H "Authorization: <token>" \
      -X DELETE \
      https://api.pagertree.com/team/:id
    

    Definition

    DELETE https://api.pagertree.com/team/:id

    URL Parameters

    Parameter Description
    id The id of the team to delete

    Returns

    A 204 - NO CONTENT on success or 404 - NOT FOUND on failure.

    List all teams

    Example Request

    curl -H "Content-Type: application/json" \
      -H "Authorization: <token>" \
      https://api.pagertree.com/team
    

    The above command returns JSON structured like this:

    {
      "data": [
        {...},
        {...},
      ],
      "has_more": false,
      "total_count": 2
    }
    

    Definition

    GET https://api.pagertree.com/team

    Returns

    A paginated response with a data array property. Each item in the array is a team object.

    Token

    A token is a security feature that allows anonymous access to resources.

    The token object

    Example Response

    {
      "sid":"acc_H1fh_yx6z",
      "id":"tkn_ByGE2ukxpf",
      "createdAt":"2018-04-27T00:02:51.863Z",
      "resource_id":"acc_H1fh_yx6z",
      "sequence":"17475d2c-eed3-44ee-9c82-db594721d303"
    }
    
    Parameter Type Description
    sid string Security identifier for the object.
    id string Unique identifier for the object.
    createdAt timestamp When this object was first created.
    resource_id string The resource access has been granted to.
    sequence string A UUID that grants the access.

    Retrieve a token

    Example Request

    curl -H "Content-Type: application/json" \
      -H "Authorization: <token>" \
      https://api.pagertree.com/token/:id
    

    The above command returns JSON structured like this:

    {
      "sid":"acc_H1fh_yx6z",
      "id":"tkn_ByGE2ukxpf",
      "createdAt":"2018-04-27T00:02:51.863Z",
      "resource_id":"acc_H1fh_yx6z",
      "sequence":"17475d2c-eed3-44ee-9c82-db594721d303"
    }
    

    Definition

    GET https://api.pagertree.com/token/:id

    URL Parameters

    Parameter Description
    id The id of the token to retrieve

    Returns

    Returns a token if a valid token id was provided. Returns an error otherwise.

    User

    A user represents an actual person in your organization.

    The user object

    Example Response

    {
      "sid": "acc_H1fh_yx6z",
      "id": "usr_r1mnuJg6z",
      "createdAt": "2018-04-27T00:02:50.662Z",
      "updatedAt": "2018-04-27T15:35:41.139Z",
      "lastlogin": 1524787371,
      "name": "Austin",
      "email": "austinrmiller1991@gmail.com",
      "preferences": {
          "alert_slack": false,
          "alert_email": true,
          "alert_voice": false,
          "report_performance": true,
          "report_oncall": true,
          "timezone": "America/Los_Angeles",
          "wizard_dragdrop": true,
          "alert_push": true,
          "alert_sms": false,
          "wizard_quickcreate": true
      },
       "roles": {
           "broadcast": true,
           "admin": true,
           "admin_billing": true
       }
    }
    
    Parameter Type Description
    sid string Security identifier for the object.
    id string Unique identifier for the object.
    createdAt timestamp When this object was first created.
    updatedAt timestamp When this object last updated.
    lastlogin number A unix timestamp of the last login.
    name string The name of the user.
    email string The email of the user.
    email_verfied number A unix timestamp of when the user verified their email.
    email_blocked boolean Flag indicating if PagerTree blocked this users email because of a spam or bounce response.
    phone string The phone number of the user
    phone_verified number A unix timestamp of when the user verified their phone.
    phone_blocked boolean Flag indicating if PagerTree blocked this users phone because of a misuse.
    preferences object A hash of user preferences
    roles object A hash of user roles

    Create a user

    Example Request

    curl -H "Content-Type: application/json" \
      -H "Authorization: <token>" \
      -d '{"name": "Austin", "email": "austinrmiller1991@gmail.com"}'\
      https://api.pagertree.com/user
    

    The above command returns JSON structured like this:

    {
      "sid": "acc_H1fh_yx6z",
      "id": "usr_r1mnuJg6z",
      "createdAt": "2018-04-27T00:02:50.662Z",
      "name": "Austin",
      "email": "austinrmiller1991@gmail.com",
      "preferences": {
          "alert_push": true,
          "alert_email": true,
          "alert_email": true,
          "alert_voice": false,
          "alert_slack": false,
          "report_performance": true,
          "report_oncall": true,
      },
       "roles": {}
    }
    

    Definition

    POST https://api.pagertree.com/user

    Body Parameters

    Parameter Description
    name The name of the user.
    email The email of the user.

    See the user object for optional parameters.

    Returns

    The newly created user object if the request succeeded. Returns an error otherwise.

    Retrieve a user

    Example Request

    curl -H "Content-Type: application/json" \
      -H "Authorization: <token>" \
      https://api.pagertree.com/user/:id
    

    The above command returns JSON structured like this:

    {
      "sid": "acc_H1fh_yx6z",
      "id": "usr_r1mnuJg6z",
      "createdAt": "2018-04-27T00:02:50.662Z",
      "updatedAt": "2018-04-27T15:35:41.139Z",
      "lastlogin": 1524787371,
      "name": "Austin",
      "email": "austinrmiller1991@gmail.com",
      "preferences": {
          "alert_slack": false,
          "alert_email": true,
          "alert_voice": false,
          "report_performance": true,
          "report_oncall": true,
          "timezone": "America/Los_Angeles",
          "wizard_dragdrop": true,
          "alert_push": true,
          "alert_sms": false,
          "wizard_quickcreate": true
      },
       "roles": {
           "broadcast": true,
           "admin": true,
           "admin_billing": true
       }
    }
    

    Definition

    GET https://api.pagertree.com/user/:id

    URL Parameters

    Parameter Description
    id The id of the user to retrieve

    Returns

    Returns a user if a valid user id was provided. Returns an error otherwise.

    Update a user

    Example Request

    curl -H "Content-Type: application/json" \
      -H "Authorization: <token>" \
      -d '{"name": "Austin Miller"}'\
      -X PUT \
      https://api.pagertree.com/user/:id
    

    The above command returns JSON structured like this:

    {
      "sid": "acc_H1fh_yx6z",
      "id": "usr_r1mnuJg6z",
      "createdAt": "2018-04-27T00:02:50.662Z",
      "updatedAt": "2018-04-27T15:35:41.139Z",
      "name": "Austin Miller",
      "email": "austinrmiller1991@gmail.com",
      "preferences": {
          "alert_slack": false,
          "alert_email": true,
          "alert_voice": false,
          "report_performance": true,
          "report_oncall": true,
          "timezone": "America/Los_Angeles",
          "wizard_dragdrop": true,
          "alert_push": true,
          "alert_sms": false,
          "wizard_quickcreate": true
      },
       "roles": {
           "broadcast": true,
           "admin": true,
           "admin_billing": true
       }
    }
    

    Definition

    PUT https://api.pagertree.com/user/:id

    URL Parameters

    Parameter Description
    id The id of the user to update

    See the user object for all parameters.

    Returns

    The newly updated user object if the request succeeded. Returns an error otherwise.

    Delete a user

    Example Request

    curl -H "Content-Type: application/json" \
      -H "Authorization: <token>" \
      -X DELETE \
      https://api.pagertree.com/user/:id
    

    Definition

    DELETE https://api.pagertree.com/user/:id

    URL Parameters

    Parameter Description
    id The id of the user to delete

    Returns

    A 204 - NO CONTENT on success or 404 - NOT FOUND on failure.

    List all users

    Example Request

    curl -H "Content-Type: application/json" \
      -H "Authorization: <token>" \
      https://api.pagertree.com/user
    

    The above command returns JSON structured like this:

    {
      "data": [
        {...},
        {...},
      ],
      "has_more": false,
      "total_count": 2
    }
    

    Definition

    GET https://api.pagertree.com/user

    Returns

    A paginated response with a data array property. Each item in the array is a user object.

    List all current events for a user

    Example Request

    curl -H "Content-Type: application/json" \
      -H "Authorization: <token>" \
      https://api.pagertree.com/user/:id/currentevents
    

    The above command returns JSON structured like this:

    [
      {
        "sid":"acc_H1fh_yx6z",
        "id":"evt_rJ0XMGWTM",
        "createdAt":"2018-04-27T21:12:05.774Z",
        "updatedAt":"2018-04-27T21:22:47.927Z",
        "schedule_id":"skd_BJzQnuklaG",
        "user_id":"usr_r1mnuJg6z",
        "start":1524898800,
        "end":1524985200,
        "repeat":false,
        "layer":2,
        "dow":[1,2,3,4,5,6,7],
        "frequency":1,
        "exceptions":[]
      }
    ]
    

    Definition

    GET https://api.pagertree.com/user/:id/currentevents

    URL Parameters

    Parameter Description
    id The id of the user to get current events for

    Returns

    An array of any events in which the user is currently on-call for. Each item in the array is a event object.