Event APIs

Event APIs allow you to curate your event data together into packages that you can share with others to use to build new applications. Only shared events can be part of an event API. For more information, see Events.

You can share event APIs using an Async API document. You can also add event APIs to Event API Products.

This section includes the following tasks:

You can also create custom attributes for event APIs. For more information, see Using Custom Attributes

Creating an Event API

You create event APIs within application domains. Events must be shared to add them to an event API, even if they are in the same application domain.

To create an event API in Designer, perform these steps:

  1. On the Application Domains page, click the name of the application domain where you want to create the event API.
  2. Select the Event APIs tab, then click Create Event API.

    Screenshot showing the settings described in the surrounding steps.

  3. Enter a Name for the event API.
  4. Select the Broker Type. You can't change the broker type after you save the event API.
  5. If you want the event API to be available in other application domains or you want to add it to an Event API Product, select Allow Event API to be shared across application domains.
  6. In the Version field, specify a semantic version value for the event API in the format major.minor.patch. The default is 0.1.0.
  7. (Optional) Enter a Version Name for the initial version of the event API.
  8. (Optional) Enter a Description for the event API. The Description field supports Markdown. Click toggle preview to preview the rendered text.
  9. (Optional) Add values for any custom attributes that have been set up in your organization.
  10. To select events to include in the event API, perform these steps:
    1. Click Manage Events.
    2. In the Application Domain list, select the application domain for an event that you want to add to the event API. By default, the list shows shared events in the current application domain. If you select a different application domain, the list shows shared events in the selected application domain. If you remove the filter, the list shows shared events in all application domains that you have access to.
    3. Expand an event to see the list of versions.
    4. To allow an external application to subscribe to a version of an event, select Sub for the event version.
    5. To allow an external application to publish a version of an event, select Pub for the event version.
    6. When you are finished selecting events, click Close .
  11. Click Save Event API.

Downloading an AsyncAPI Document for an Event API

An AsyncAPI document is a a JSON or YAML file generated according to the AsyncAPI Specification that describes the contents of your event API. For more information, see the AsyncAPI Initiative. You can give the AsyncAPI document to developers to help them create the actual applications and events that are part of your event mesh.

You can download an AsyncAPI document for an event API in two ways:

  • Download a basic AsyncAPI document from the event API page.
  • Download a more comprehensive AsyncAPI document that includes service plan details and the server details and operation bindings for any event brokers that are associated with an Event API Product that the event API is part of. For more information, see Downloading an Async API Document with Event API Product Information

To download a basic AsyncAPI document for your event API, perform these steps:

  1. On the Application Domains page, click the name of the application domain that contains the event API.
  2. Select the Event APIs tab.
  3. In the list of event APIs, click the name of the event API.
  4. In the Versions list, select the version that you want to download the AsyncAPI document for.
  5. In the version details, click More Actions and select Download Async API.
  6. Select JSON or YAML file format.
  7. Click Download File.

Updating an Event API

When you update an event API, you can update an existing version or create a new version of the event API. Versions allow you to work on updates and test new versions while the stable version remains in production. Each version also has a lifecycle state. You can only edit versions that are in Draft state. For more information, see Object Versions and Lifecycle States.

The version number uses semantic versioning in the format major.minor.patch. When you update an event API, you have three options:

  • If the event API version is in Draft state, you can update an existing version and retain the version number
  • If the event API version is in Released, Deprecated, or Retired state, you can duplicate a version and increment the version number to create a new Draft version.
  • If the event API version is in Released, Deprecated, or Retired state, you can create a new version of the event API from scratch

If you want to update a version that is not in Draft state it is best practice to create a new version rather than returning the version to Draft state.

When you include an event in the event API, you select the version of the event that you want to include. If a new version of an event is created, you can choose when to update the event API to include the new version.

To update an event API, perform these steps:

  1. On the Application Domains page, click the name of the application domain that contains the event API you want to update.
  2. Select the Event APIs tab.
  3. In the list of event APIs, click the name of the event API.
  4. Perform one of the following actions:
    • In the Versions list, click More Actionsfor the version that you want to update and select Edit. Any changes you make update that version of the event API. You can edit an event API version only if it is in Draft state.
    • In the Versions list, click More Actionsfor the version that you want to update and select Duplicate. All properties of the existing version are copied into a new version. By default, the new version number is incremented by 0.0.1. You can change the version number to any number not already in use.
    • Above the Versions list, click Addto create a new version of the event API without duplicating an existing version. By default, the new version number is the next unused major version. You can change the version number to any number not already in use.
  5. Update the event API version as necessary.
  6. Click Save Version or Save & Close.

Changing the State of an Event API Version

When you create a new version of an event API, the version is in Draft state. When the version is ready, you can change the version state to Released. When you release a new version of an event API, you may also want to change older versions of the event API to Deprecated or Retired. You must have an Event Portal Manager or Administrator role to change the version state. For more information about version states, see Object Versions and Lifecycle States

You can only change an event API version from Draft to Released state if the event API references at least one event version and if no referenced event versions are still in draft state

To change the state of an event API version, perform these steps:

  1. On the Application Domains page, click the name of the application domain that contains the event API you want to update.
  2. Select the Event APIs tab.
  3. In the list of event APIs, click the name of the event API.
  4. Select the version that you want to change the state of then click Change State.
  5. Select the new state and click Change State.