# Loom Events

Here you will find a list of the Loom Events provided by the directory.

# directory.revoked_access_token

This event will be triggered every time an access token is revoked (e.g. because the user was banned). You must maintain this token in a list of revoked access tokens (for at least 1 hour).

Example event:

{
  "id": "62abcc92-e17e-4db0-b78e-13369251474b",
  "name": "directory.revoked_access_token",
  "subject": "Org/2b271d51-e447-4a16-810f-5abdc596700a", // could also be a Per
  "timestamp": "2019-11-26T10:58:09.664Z",
  "version": "1.0",
  "payload": {
    "access_token_id":"b1a2eaa9-11ba-4cab-8580-40f091e37742" // Access Token ID (JTI) that was revoked
  },
  "received_at": "2019-11-26T10:58:09.664Z"
}

# directory.established_connection

This event will be triggered every time an organization or person establishes a connection with your app, that did not have an active connection before. This event is only sent to your app.

The subject contains the subject to which the connection was established. It can be a person or an organization.

Example event:

{
  "id": "62abcc92-e17e-4db0-b78e-13369251474b",
  "name": "directory.established_connection",
  "subject": "Org/2b271d51-e447-4a16-810f-5abdc596700a", // could also be a Per
  "timestamp": "2019-11-26T10:58:09.664Z",
  "version": "1.0",
  "received_at": "2019-11-26T10:58:09.664Z"
}

# directory.revoked_connection

This event will be triggered every time an organization or person revoked a connection with your app, that did have an active connection before. This event is only sent to your app.

The subject contains the subject to which the connection was originally established. It can be a person or an organization.

Example event:

{
  "id": "62abcc92-e17e-4db0-b78e-13369251474b",
  "name": "directory.established_connection",
  "subject": "Org/2b271d51-e447-4a16-810f-5abdc596700a", // could also be a Per
  "timestamp": "2019-11-26T10:58:09.664Z",
  "version": "1.0",
  "received_at": "2019-11-26T10:58:09.664Z"
}

# directory.organization_details_changed

This event will be triggered every time organization details such as logo, kind or name changed.

Example event:

{
  "id": "62abcc92-e17e-4db0-b78e-13369251474b",
  "name": "directory.organization_details_changed",
  "subject": "Org/2b271d51-e447-4a16-810f-5abdc596700a",
  "timestamp": "2019-11-26T10:58:09.664Z",
  "version": "1.0",
  "received_at": "2019-11-26T10:58:09.664Z",
  "link": "https://hub.sandbox.zaikio/api/v1/organization"
}

# directory.person_details_changed

This event will be triggered every time a person's profile changed (such as name, language, avatar, ...). This event is triggered with a Person subject. If you want to listen to this event for an organization use member_details_changed.

Example event:

{
  "id": "62abcc92-e17e-4db0-b78e-13369251474b",
  "name": "directory.person_details_changed",
  "subject": "Per/dee4c43d-6a61-4b79-99fd-0035ddd6b887",
  "timestamp": "2019-11-26T10:58:09.664Z",
  "version": "1.0",
  "received_at": "2019-11-26T10:58:09.664Z",
  "link": "https://hub.sandbox.zaikio/api/v1/person"
}

# directory.subscription_*

We offer 5 events for subscriptions: created, plan_changed, payment_failed, payment_issues_resolved and canceled.

# directory.subscription_created

This event will be triggered every time a subscription was created for your app. This event is not fired, if a plan was upgraded or downgraded (instead it will fire directory.subscription_plan_changed).

Example event:

{
  "id": "62abcc92-e17e-4db0-b78e-13369251474b",
  "name": "directory.subscription_created",
  "subject": "Org/2b271d51-e447-4a16-810f-5abdc596700a",
  "timestamp": "2019-11-26T10:58:09.664Z",
  "version": "1.0",
  "received_at": "2019-11-26T10:58:09.664Z",
  "payload": {
    "plan": "advanced"
  },
  "link": "https://hub.sandbox.zaikio/api/v1/subscriptions/Organization-2b271d51-e447-4a16-810f-5abdc596700a"
}

# directory.subscription_plan_changed

This event will be triggered every time an existing subscription changed its plan. This subscription has to be provisioned again.

Example event:

{
  "id": "62abcc92-e17e-4db0-b78e-13369251474b",
  "name": "directory.subscription_plan_changed",
  "subject": "Org/2b271d51-e447-4a16-810f-5abdc596700a",
  "timestamp": "2019-11-26T10:58:09.664Z",
  "version": "1.0",
  "received_at": "2019-11-26T10:58:09.664Z",
  "payload": {
    "plan": "professional"
  },
  "link": "https://hub.sandbox.zaikio/api/v1/subscriptions/Organization-2b271d51-e447-4a16-810f-5abdc596700a"
}

# directory.subscription_payment_failed

This event will be triggered when an invoice for a subscription was not paid within 1 week. You might forbid the organization access to premium features of your app.

Example event:

{
  "id": "62abcc92-e17e-4db0-b78e-13369251474b",
  "name": "directory.subscription_payment_failed",
  "subject": "Org/2b271d51-e447-4a16-810f-5abdc596700a",
  "timestamp": "2019-11-26T10:58:09.664Z",
  "version": "1.0",
  "received_at": "2019-11-26T10:58:09.664Z",
  "payload": {
    "plan": "professional"
  },
  "link": "https://hub.sandbox.zaikio/api/v1/subscriptions/Organization-2b271d51-e447-4a16-810f-5abdc596700a"
}

# directory.subscription_payment_issues_resolved

This event will be triggered after a directory.subscription_payment_failed was triggered before but the subscription's payment went back to normal. You should give the organization access to premium features of your app again.

Example event:

{
  "id": "62abcc92-e17e-4db0-b78e-13369251474b",
  "name": "directory.subscription_payment_issues_resolved",
  "subject": "Org/2b271d51-e447-4a16-810f-5abdc596700a",
  "timestamp": "2019-11-26T10:58:09.664Z",
  "version": "1.0",
  "received_at": "2019-11-26T10:58:09.664Z",
  "payload": {
    "plan": "professional"
  },
  "link": "https://hub.sandbox.zaikio/api/v1/subscriptions/Organization-2b271d51-e447-4a16-810f-5abdc596700a"
}

# directory.subscription_canceled

This event will be triggered when a susbcription was canceled by the user. You should disable all premium features of your app for this organization.

Example event:

{
  "id": "62abcc92-e17e-4db0-b78e-13369251474b",
  "name": "directory.subscription_canceled",
  "subject": "Org/2b271d51-e447-4a16-810f-5abdc596700a",
  "timestamp": "2019-11-26T10:58:09.664Z",
  "version": "1.0",
  "received_at": "2019-11-26T10:58:09.664Z",
  "payload": {
    "plan": "professional"
  }
}

# directory.machine_*

We offer 4 events for machines: added, site_changed, details_changed and removed.

# directory.machine_added

This event will be triggered every time a machine was assigned to an organization.

Example event:

{
  "id": "62abcc92-e17e-4db0-b78e-13369251474b",
  "name": "directory.machine_added",
  "subject": "Org/2b271d51-e447-4a16-810f-5abdc596700a",
  "timestamp": "2019-11-26T10:58:09.664Z",
  "version": "1.0",
  "received_at": "2019-11-26T10:58:09.664Z",
  "payload": {
    "machine_id": "9709f0f1-d00b-48fa-bb01-8c52bbd7296e",
    "site_id": "80ef6969-0b4d-4959-8833-875d601f0922" // can be null
  },
  "link": "https://hub.sandbox.zaikio/api/v1/machines/9709f0f1-d00b-48fa-bb01-8c52bbd7296e"
}

# directory.machine_details_changed

This event will be triggered every time the details such as kind, manufacturer or specification of a machine were updated.

Example event:

{
  "id": "62abcc92-e17e-4db0-b78e-13369251474b",
  "name": "directory.machine_details_changed",
  "subject": "Org/2b271d51-e447-4a16-810f-5abdc596700a",
  "timestamp": "2019-11-26T10:58:09.664Z",
  "version": "1.0",
  "received_at": "2019-11-26T10:58:09.664Z",
  "payload": {
    "machine_id": "9709f0f1-d00b-48fa-bb01-8c52bbd7296e",
    "site_id": "80ef6969-0b4d-4959-8833-875d601f0922" // can be null
  },
  "link": "https://hub.sandbox.zaikio/api/v1/machines/9709f0f1-d00b-48fa-bb01-8c52bbd7296e"
}

# directory.machine_site_changed

This event will be triggered every time the site of a machine was changed.

Example event:

{
  "id": "62abcc92-e17e-4db0-b78e-13369251474b",
  "name": "directory.machine_site_changed",
  "subject": "Org/2b271d51-e447-4a16-810f-5abdc596700a",
  "timestamp": "2019-11-26T10:58:09.664Z",
  "version": "1.0",
  "received_at": "2019-11-26T10:58:09.664Z",
  "payload": {
    "machine_id": "9709f0f1-d00b-48fa-bb01-8c52bbd7296e",
    "site_id": "80ef6969-0b4d-4959-8833-875d601f0922" // can be null
  },
  "link": "https://hub.sandbox.zaikio/api/v1/machines/9709f0f1-d00b-48fa-bb01-8c52bbd7296e"
}

# directory.machine_removed

This event will be triggered every time a machine was removed from an organization.

Example event:

{
  "id": "62abcc92-e17e-4db0-b78e-13369251474b",
  "name": "directory.machine_removed",
  "subject": "Org/2b271d51-e447-4a16-810f-5abdc596700a",
  "timestamp": "2019-11-26T10:58:09.664Z",
  "version": "1.0",
  "received_at": "2019-11-26T10:58:09.664Z",
  "payload": {
    "machine_id": "9709f0f1-d00b-48fa-bb01-8c52bbd7296e",
    "site_id": "80ef6969-0b4d-4959-8833-875d601f0922" // can be null
  }
}

# directory.software_*

We offer 4 events for software assets: added, site_changed, details_changed and removed.

# directory.software_added

This event will be triggered every time a software was assigned to an organization.

Example event:

{
  "id": "62abcc92-e17e-4db0-b78e-13369251474b",
  "name": "directory.software_added",
  "subject": "Org/2b271d51-e447-4a16-810f-5abdc596700a",
  "timestamp": "2019-11-26T10:58:09.664Z",
  "version": "1.0",
  "received_at": "2019-11-26T10:58:09.664Z",
  "payload": {
    "software_id": "9709f0f1-d00b-48fa-bb01-8c52bbd7296e",
    "site_id": "80ef6969-0b4d-4959-8833-875d601f0922" // can be null
  },
  "link": "https://hub.sandbox.zaikio/api/v1/software/9709f0f1-d00b-48fa-bb01-8c52bbd7296e"
}

# directory.software_details_changed

This event will be triggered every time the details such as kind, vendor or specification of a software asset were updated.

Example event:

{
  "id": "62abcc92-e17e-4db0-b78e-13369251474b",
  "name": "directory.software_details_changed",
  "subject": "Org/2b271d51-e447-4a16-810f-5abdc596700a",
  "timestamp": "2019-11-26T10:58:09.664Z",
  "version": "1.0",
  "received_at": "2019-11-26T10:58:09.664Z",
  "payload": {
    "software_id": "9709f0f1-d00b-48fa-bb01-8c52bbd7296e",
    "site_id": "80ef6969-0b4d-4959-8833-875d601f0922" // can be null
  },
  "link": "https://hub.sandbox.zaikio/api/v1/software/9709f0f1-d00b-48fa-bb01-8c52bbd7296e"
}

# directory.software_site_changed

This event will be triggered every time the site of a software was changed.

Example event:

{
  "id": "62abcc92-e17e-4db0-b78e-13369251474b",
  "name": "directory.software_site_changed",
  "subject": "Org/2b271d51-e447-4a16-810f-5abdc596700a",
  "timestamp": "2019-11-26T10:58:09.664Z",
  "version": "1.0",
  "received_at": "2019-11-26T10:58:09.664Z",
  "payload": {
    "software_id": "9709f0f1-d00b-48fa-bb01-8c52bbd7296e",
    "site_id": "80ef6969-0b4d-4959-8833-875d601f0922" // can be null
  },
  "link": "https://hub.sandbox.zaikio/api/v1/software/9709f0f1-d00b-48fa-bb01-8c52bbd7296e"
}

# directory.software_removed

This event will be triggered every time a software asset was removed from an organization.

Example event:

{
  "id": "62abcc92-e17e-4db0-b78e-13369251474b",
  "name": "directory.software_removed",
  "subject": "Org/2b271d51-e447-4a16-810f-5abdc596700a",
  "timestamp": "2019-11-26T10:58:09.664Z",
  "version": "1.0",
  "received_at": "2019-11-26T10:58:09.664Z",
  "payload": {
    "software_id": "9709f0f1-d00b-48fa-bb01-8c52bbd7296e",
    "site_id": "80ef6969-0b4d-4959-8833-875d601f0922" // can be null
  }
}

# directory.specialist_*

We offer 4 events for specialist assets: added, site_changed, details_changed and removed.

# directory.specialist_added

This event will be triggered every time a specialist was assigned to an organization.

Example event:

{
  "id": "62abcc92-e17e-4db0-b78e-13369251474b",
  "name": "directory.specialist_added",
  "subject": "Org/2b271d51-e447-4a16-810f-5abdc596700a",
  "timestamp": "2019-11-26T10:58:09.664Z",
  "version": "1.0",
  "received_at": "2019-11-26T10:58:09.664Z",
  "payload": {
    "specialist_id": "9709f0f1-d00b-48fa-bb01-8c52bbd7296e",
    "site_id": "80ef6969-0b4d-4959-8833-875d601f0922" // can be null
  },
  "link": "https://hub.sandbox.zaikio/api/v1/specialists/9709f0f1-d00b-48fa-bb01-8c52bbd7296e"
}

# directory.specialist_details_changed

This event will be triggered every time the details such as kind, vendor or specification of a specialist asset were updated.

Example event:

{
  "id": "62abcc92-e17e-4db0-b78e-13369251474b",
  "name": "directory.specialist_details_changed",
  "subject": "Org/2b271d51-e447-4a16-810f-5abdc596700a",
  "timestamp": "2019-11-26T10:58:09.664Z",
  "version": "1.0",
  "received_at": "2019-11-26T10:58:09.664Z",
  "payload": {
    "specialist_id": "9709f0f1-d00b-48fa-bb01-8c52bbd7296e",
    "site_id": "80ef6969-0b4d-4959-8833-875d601f0922" // can be null
  },
  "link": "https://hub.sandbox.zaikio/api/v1/specialists/9709f0f1-d00b-48fa-bb01-8c52bbd7296e"
}

# directory.specialist_site_changed

This event will be triggered every time the site of a specialist was changed.

Example event:

{
  "id": "62abcc92-e17e-4db0-b78e-13369251474b",
  "name": "directory.specialist_site_changed",
  "subject": "Org/2b271d51-e447-4a16-810f-5abdc596700a",
  "timestamp": "2019-11-26T10:58:09.664Z",
  "version": "1.0",
  "received_at": "2019-11-26T10:58:09.664Z",
  "payload": {
    "specialist_id": "9709f0f1-d00b-48fa-bb01-8c52bbd7296e",
    "site_id": "80ef6969-0b4d-4959-8833-875d601f0922" // can be null
  },
  "link": "https://hub.sandbox.zaikio/api/v1/specialists/9709f0f1-d00b-48fa-bb01-8c52bbd7296e"
}

# directory.specialist_removed

This event will be triggered every time a specialist asset was removed from an organization.

Example event:

{
  "id": "62abcc92-e17e-4db0-b78e-13369251474b",
  "name": "directory.specialist_removed",
  "subject": "Org/2b271d51-e447-4a16-810f-5abdc596700a",
  "timestamp": "2019-11-26T10:58:09.664Z",
  "version": "1.0",
  "received_at": "2019-11-26T10:58:09.664Z",
  "payload": {
    "specialist_id": "9709f0f1-d00b-48fa-bb01-8c52bbd7296e",
    "site_id": "80ef6969-0b4d-4959-8833-875d601f0922" // can be null
  }
}

# directory.member_*

We offer 4 events for organization members: joined, roles_updated, member_details_changed and left.

# directory.member_joined

This event will be triggered every time a person was added to an organization.

Example event:

{
  "id": "62abcc92-e17e-4db0-b78e-13369251474b",
  "name": "directory.member_joined",
  "subject": "Org/2b271d51-e447-4a16-810f-5abdc596700a",
  "timestamp": "2019-11-26T10:58:09.664Z",
  "version": "1.0",
  "received_at": "2019-11-26T10:58:09.664Z",
  "payload": {
    "organization_membership_id": "9709f0f1-d00b-48fa-bb01-8c52bbd7296e",
    "person_id": "80ef6969-0b4d-4959-8833-875d601f0922",
    "roles": 1 // roles defined as a bitfield, see: https://docs.zaikio.com/guide/oauth/client-credentials.html#on-behalf-of-person
  },
  "link": "https://hub.sandbox.zaikio/api/v1/organization/memberships/9709f0f1-d00b-48fa-bb01-8c52bbd7296e"
}

# directory.member_roles_updated

This event will be triggered every time the roles of a member changed.

Example event:

{
  "id": "62abcc92-e17e-4db0-b78e-13369251474b",
  "name": "directory.member_roles_updated",
  "subject": "Org/2b271d51-e447-4a16-810f-5abdc596700a",
  "timestamp": "2019-11-26T10:58:09.664Z",
  "version": "1.0",
  "received_at": "2019-11-26T10:58:09.664Z",
  "payload": {
    "organization_membership_id": "9709f0f1-d00b-48fa-bb01-8c52bbd7296e",
    "person_id": "80ef6969-0b4d-4959-8833-875d601f0922",
    "roles": 1 // new roles defined as a bitfield, see: https://docs.zaikio.com/guide/oauth/client-credentials.html#on-behalf-of-person
  },
  "link": "https://hub.sandbox.zaikio/api/v1/organization/memberships/9709f0f1-d00b-48fa-bb01-8c52bbd7296e"
}

# directory.member_details_changed

This event will be triggered every time a member's profile changed (such as name, language, avatar, ...)

Example event:

{
  "id": "62abcc92-e17e-4db0-b78e-13369251474b",
  "name": "directory.member_details_changed",
  "subject": "Org/2b271d51-e447-4a16-810f-5abdc596700a",
  "timestamp": "2019-11-26T10:58:09.664Z",
  "version": "1.0",
  "received_at": "2019-11-26T10:58:09.664Z",
  "payload": {
    "organization_membership_id": "9709f0f1-d00b-48fa-bb01-8c52bbd7296e",
    "person_id": "80ef6969-0b4d-4959-8833-875d601f0922"
  },
  "link": "https://hub.sandbox.zaikio/api/v1/organization/memberships/9709f0f1-d00b-48fa-bb01-8c52bbd7296e"
}

# directory.member_left

This event will be triggered every time a person was removed from an organization.

Example event:

{
  "id": "62abcc92-e17e-4db0-b78e-13369251474b",
  "name": "directory.member_left",
  "subject": "Org/2b271d51-e447-4a16-810f-5abdc596700a",
  "timestamp": "2019-11-26T10:58:09.664Z",
  "version": "1.0",
  "received_at": "2019-11-26T10:58:09.664Z",
  "payload": {
    "organization_membership_id": "9709f0f1-d00b-48fa-bb01-8c52bbd7296e",
    "person_id": "80ef6969-0b4d-4959-8833-875d601f0922"
  }
}

# directory.site_*

We offer 4 events for sites: added, details_changed, address_changed and removed.

# directory.site_added

This event will be triggered every time a site was added to an organization.

Example event:

{
  "id": "62abcc92-e17e-4db0-b78e-13369251474b",
  "name": "directory.site_added",
  "subject": "Org/2b271d51-e447-4a16-810f-5abdc596700a",
  "timestamp": "2019-11-26T10:58:09.664Z",
  "version": "1.0",
  "received_at": "2019-11-26T10:58:09.664Z",
  "payload": {
    "site_id": "386725c0-b9b7-4d91-827f-0a4969904311"
  },
  "link": "https://hub.sandbox.zaikio/api/v1/sites/9709f0f1-d00b-48fa-bb01-8c52bbd7296e"
}

# directory.site_details_changed

This event will be triggered every time a site name was updated.

Example event:

{
  "id": "62abcc92-e17e-4db0-b78e-13369251474b",
  "name": "directory.site_details_changed",
  "subject": "Org/2b271d51-e447-4a16-810f-5abdc596700a",
  "timestamp": "2019-11-26T10:58:09.664Z",
  "version": "1.0",
  "received_at": "2019-11-26T10:58:09.664Z",
  "payload": {
    "site_id": "386725c0-b9b7-4d91-827f-0a4969904311"
  },
  "link": "https://hub.sandbox.zaikio/api/v1/sites/9709f0f1-d00b-48fa-bb01-8c52bbd7296e"
}

# directory.site_address_changed

This event will be triggered every time an address of a site was updated.

Example event:

{
  "id": "62abcc92-e17e-4db0-b78e-13369251474b",
  "name": "directory.site_address_changed",
  "subject": "Org/2b271d51-e447-4a16-810f-5abdc596700a",
  "timestamp": "2019-11-26T10:58:09.664Z",
  "version": "1.0",
  "received_at": "2019-11-26T10:58:09.664Z",
  "payload": {
    "site_id": "386725c0-b9b7-4d91-827f-0a4969904311"
  },
  "link": "https://hub.sandbox.zaikio/api/v1/sites/9709f0f1-d00b-48fa-bb01-8c52bbd7296e"
}

# directory.site_removed

This event will be triggered every time a site was removed.

Example event:

{
  "id": "62abcc92-e17e-4db0-b78e-13369251474b",
  "name": "directory.site_removed",
  "subject": "Org/2b271d51-e447-4a16-810f-5abdc596700a",
  "timestamp": "2019-11-26T10:58:09.664Z",
  "version": "1.0",
  "received_at": "2019-11-26T10:58:09.664Z",
  "payload": {
    "site_id": "386725c0-b9b7-4d91-827f-0a4969904311"
  }
}

# directory.business_relationship_*

We offer 3 events for sites: added, changed and removed.

# directory.business_relationship_added

This event will be triggered every time a business relationship was added to an owner organization.

Example event:

{
  "id": "62abcc92-e17e-4db0-b78e-13369251474b",
  "name": "directory.business_relationship_added",
  "subject": "Org/2b271d51-e447-4a16-810f-5abdc596700a",
  "timestamp": "2019-11-26T10:58:09.664Z",
  "version": "1.0",
  "received_at": "2019-11-26T10:58:09.664Z",
  "payload": {
    "business_relationship_id": "386725c0-b9b7-4d91-827f-0a4969904311",
    "target_id": "5c169904-f0fd-482e-86cf-9d9ab47faae7"
  },
  "link": "https://hub.sandbox.zaikio/api/v1/organization/business_relationships/9709f0f1-d00b-48fa-bb01-8c52bbd7296e"
}

# directory.business_relationship_changed

This event will be triggered every time a business relationship name was updated.

Example event:

{
  "id": "62abcc92-e17e-4db0-b78e-13369251474b",
  "name": "directory.business_relationship_changed",
  "subject": "Org/2b271d51-e447-4a16-810f-5abdc596700a",
  "timestamp": "2019-11-26T10:58:09.664Z",
  "version": "1.0",
  "received_at": "2019-11-26T10:58:09.664Z",
  "payload": {
    "business_relationship_id": "386725c0-b9b7-4d91-827f-0a4969904311",
    "target_id": "5c169904-f0fd-482e-86cf-9d9ab47faae7"
  },
  "link": "https://hub.sandbox.zaikio/api/v1/organization/business_relationships/9709f0f1-d00b-48fa-bb01-8c52bbd7296e"
}

# directory.business_relationship_removed

This event will be triggered every time a business relationship was removed.

Example event:

{
  "id": "62abcc92-e17e-4db0-b78e-13369251474b",
  "name": "directory.business_relationship_removed",
  "subject": "Org/2b271d51-e447-4a16-810f-5abdc596700a",
  "timestamp": "2019-11-26T10:58:09.664Z",
  "version": "1.0",
  "received_at": "2019-11-26T10:58:09.664Z",
  "payload": {
    "business_relationship_id": "386725c0-b9b7-4d91-827f-0a4969904311",
    "target_id": "5c169904-f0fd-482e-86cf-9d9ab47faae7"
  }
}