---
agentTools:
  projectIndex: https://asset-management-for-jira.readme.io/llms.txt
---

# Events API

[block:api-header]
{
  "title": "Using the Events API"
}
[/block]

The Events API is a streamlined, easy way to build apps that respond to activities in Asset Management for Jira. All you need is a secure place for us to send your events.

## Benefits of using the Events API

* No need to poll continuously.
* Receive events that you care about.

## Event loop

Apps that are built using the Events API will follow the same abstract event-driven sequence:

1. A user creates a circumstance that triggers an event subscription to your application
2. Your server receives a payload of JSON describing that event
3. Your server acknowledges receipt of the event
4. Your business logic decides what to do about that event
5. Your server carries out that decision

## Subscribing to event types

To begin working with the Events API, you need to to Settings Page and Enable Events from the Events tab.

[block:image]
{
  "images": [
    {
      "image": [
        "https://files.readme.io/32276ba-Screen_Shot_2022-11-11_at_3.32.47_PM.png",
        "Screen Shot 2022-11-11 at 3.32.47 PM.png",
        1912,
        682,
        "#000000"
      ]
    }
  ]
}
[/block]

### Events Request URL

Your Events API Request URL is the target location where all the events your application is subscribed to will be delivered.

Your Request URL will receive JSON-based payloads containing wrapped event types. The volume of events will vary depending on the events you subscribe to.

[block:callout]
{
  "type": "info",
  "body": "Your Request URL might receive many events and requests. Consider decoupling your ingestion of events from the processing and reaction to them.",
  "title": "Best Practice"
}
[/block]

### Choosing event subscriptions

We currently offer the following event subscriptions:

* **asset.create**: A new asset was created
* **asset.update**: An existing asset was updated
* **asset.delete**: An existing asset was deleted

## Receiving Events

Your Request URL will receive a request for each event matching your subscriptions. One request, one event.

The event will be in the `Content-Type: application/json` format. The schema of the event will be as follows:

[block:parameters]
{
  "data": {
    "h-0": "Field Name",
    "h-1": "Type",
    "h-2": "Description",
    "0-0": "event_type",
    "0-1": "string",
    "0-2": "Subscription that triggered event (asset.create, asset.update, asset.delete)",
    "1-0": "name",
    "1-1": "string",
    "1-2": "Name of asset",
    "2-0": "assettype",
    "2-1": "dict",
    "2-2": "Contains id and name of asset type associated with asset",
    "3-0": "location",
    "3-1": "dict",
    "3-2": "Contains id and name of location associated with asset",
    "4-0": "loanee",
    "4-1": "dict",
    "4-2": "Contains id and name of loanee associated with asset",
    "5-0": "field_values",
    "5-1": "array",
    "5-2": "Details about the custom asset fields associated with the asset"
  },
  "cols": 3,
  "rows": 6
}
[/block]

[block:code]
{
  "codes": [
    {
      "code": "{\n  \"field_values\": [\n    {\n      ...\n    }\n  ],\n  \"created_at\": \"2022-09-14 03:03:44.456537\",\n  \"id\": 675,\n  \"location\": {\n    \"id\": 50,\n    \"name\": \"My IT Office\"\n  },\n  \"name\": \"Spare-02\",\n  \"assettype\": {\n    \"id\": 86,\n    \"name\": \"2 in 3 Laptop\"\n  },\n  \"loanee\": {\n    \"id\": 142,\n    \"name\": \"John Do\"\n  },\n  \"updated_at\": \"2022-11-11 05:05:07.302773\",\n  \"event_type\": \"asset.update\"\n}",
      "language": "json"
    }
  ]
}
[/block]

## Responding to Events

Your app should respond to the event request with an HTTP 2xx within three seconds. If it does not, we'll consider the event delivery attempt failed. After a failure, we'll retry three times, backing off exponentially.

If 3 consecutive events fail to get a successful response, we will automatically disable delivery of any future events.

### Resuming event deliveries

You can manually re-enable event subscriptions by visiting your application's settings.