Dev GuideAPI Reference
Dev GuideAPI ReferenceUser GuideGitHubNuGetDev CommunitySubmit a ticketLog In
GitHubNuGetDev CommunitySubmit a ticket

Library events

asset_added

An asset (article, image, video, raw file, or structured content) was added to the library for reasons including, but not limited to, uploading assets, completing a task, and so on.

Payload

KeyTypeDescription
event_namestringName of the event. The value is asset_added.
dataobjectData of the event.
data[asset]objectData of the asset associated with the event.
data[asset][id]stringUnique identifier of the asset.
data[asset][owner_organization_id]stringOwner organization ID of the asset.
data[asset][type]stringType of the asset. Value can be article, image, video, raw_file, or structured_content.
data[asset][source]objectSource of the asset.
data[asset][source][id]string or nullIdentifier of the source. Sends the ID of a task if the asset is added by completing the task.
data[asset][source][type]string or nullType of the source. Sends task as the value, if the asset is added by completing the task.
data[asset][source][links]objectLinks related to the asset source.
data[asset][source][links][self]string or nullURL to fetch the source details through the CMP Open API. Sends the URL of the task API if the asset is added by completing the task.
data[asset][links]objectLinks related to the asset.
data[asset][links][self]stringURL to fetch the asset's details through the CMP Open API.

Example

{
  "event_name": "asset_added",
  "data": {
    "asset": {
      "id": "019a86405de737b4ec3e616a4aeff981",
      "owner_organization_id": "5108c3a9becac35915111191",
      "type": "image",
      "source": {
          "id": "656893caea057917c5796f2e",
          "type": "task",
          "links": {
            "self": "https://api.cmp.optimizely.com/v3/tasks/656893caea057917c5796f2e",
          }
      },
      "links": {
        "self": "https://api.cmp.optimizely.com/v3/images/019a86405de737b4ec3e616a4aeff981"
      }
    }
  }
}

asset_removed

An asset (article, image, video, raw file, or structured content) was removed from the library for reasons including, but not limited to, deleting assets.

Payload

KeyTypeDescription
event_namestringName of the event. The value is asset_removed.
dataobjectData of the event.
data[asset]objectData of the asset associated with the event.
data[asset][id]stringUnique identifier of the asset.
data[asset][owner_organization_id]stringOwner organization ID of the asset.
data[asset][type]stringType of the asset. Value can be article, image, video, raw_file, or structured_content.

Example

{
  "event_name": "asset_removed",
  "data": {
    "asset": {
      "id": "870825113a12950a7eeeb64a64236d49",
      "owner_organization_id": "5108c3a9becac35915111191",
      "type": "article"
    }
  }
}

asset_modified

An asset (article, image, video, raw file, or structured content) was modified in the library.

The event is triggered when specific attributes of a file type change, as listed below.

  • article – title, labels, file location, expires_at, tags, owner_id, url, is_archived
  • image & video – title, description, labels, file location, versions, alt_text, expires_at, tags, attribution_text, owner_id, url, is_archived
  • raw file – title, description, labels, file location, versions, expires_at, tags, attribution_text, owner_id, url, is_archived
  • structured content – file location, tags, owner_id, is_archived

Payload

KeyTypeDescription
event_namestringName of the event. The value is asset_modified.
dataobjectData of the event.
data[asset]objectData of the asset associated with the event.
data[asset][id]stringUnique identifier of the asset.
data[asset][owner_organization_id]stringOwner organization ID of the asset.
data[asset][type]stringType of the asset. Value can be article, image, video, raw_file, or structured_content.
data[asset][source]objectSource of the asset.
data[asset][source][id]string or nullIdentifier of the source. Sends the ID of a task if the asset is modified by completing the task.
data[asset][source][type]string or nullType of the source. Sends task as the value, if the asset is modified by completing the task.
data[asset][source][links]objectLinks related to the asset source.
data[asset][source][links][self]string or nullURL to fetch the source details through the CMP Open API. Sends the URL of the task API if the asset is added by completing the task.
data[asset][links]objectLinks related to the asset.
data[asset][links][self]stringURL to fetch the asset's details through the CMP Open API.
data[attributes_changed]arrayList of attributes that trigger the webhook

Example

{
  "event_name": "asset_modified",
  "data": {
    "asset": {
      "id": "019a86405de737b4ec3e616a4aeff951",
      "owner_organization_id": "5108c3a9becac35915111191",
      "type": "image",
      "source": {
          "id": "656893caea057917c5796f2e",
          "type": "task",
          "links": {
            "self": "https://api.cmp.optimizely.com/v3/tasks/656893caea057917c5796f2e",
          }
      },
      "links": {
        "self": "https://api.cmp.optimizely.com/v3/images/019a86405de737b4ec3e616a4aeff951"
      }
    },
    "attributes_changed": ["title", "description", "expires_at"]
  }
}