The Event Hooks API provides operations to manage event hooks for your organization.
For general information on event hooks and how to create and use them, see Event hooks. The following documentation is only for the management API, which provides a CRUD interface for registering event hooks.
For a step-by-step guide on implementing an example event hook, see the Event hook guide.
When you create an event hook, you need to specify which events you want to subscribe to. To see the list of event types currently eligible for use in event hooks, use the Event Types catalog and search with the parameter event-hook-eligible
.
okta.eventHooks.read
Lists all event hooks
Success
Forbidden
Too Many Requests
[- {
- "id": "who8tsqyrhCdmetzx135",
- "status": "ACTIVE",
- "verificationStatus": "VERIFIED",
- "name": "Event Hook Test",
- "description": null,
- "created": "2023-07-07T17:41:56.000Z",
- "createdBy": "00u7xut94qEWYx5ss1e5",
- "lastUpdated": "2023-07-07T17:43:03.000Z",
- "events": {
- "type": "EVENT_TYPE",
- "items": [
- "user.lifecycle.deactivate",
- "user.lifecycle.activate"
], - "filter": null
}, - "channel": {
- "type": "HTTP",
- "version": "1.0.0",
- "config": {
- "headers": [ ],
- "method": "POST",
- "authScheme": {
- "type": "HEADER",
- "key": "authorization"
}
}
}, - "_links": {
- "verify": {
- "hints": {
- "allow": [
- "POST"
]
}
}, - "deactivate": {
- "hints": {
- "allow": [
- "POST"
]
}
}
}
}, - {
- "id": "who8vt36qfNpCGz9H1e6",
- "status": "ACTIVE",
- "verificationStatus": "VERIFIED",
- "name": "Event Hook with Filter",
- "description": "An event hook using an Okta Expression Language filter",
- "created": "2023-07-07T13:41:56.000Z",
- "createdBy": "00u7xut94qEWYx5ss1e5",
- "lastUpdated": "2023-07-07T13:43:03.000Z",
- "events": {
- "type": "EVENT_TYPE",
- "items": [
- "group.user_membership.add"
], - "filter": {
- "type": "EXPRESSION_LANGUAGE",
- "eventFilterMap": [
- {
- "event": "group.user_membership.add",
- "condition": {
- "version": null,
- "expression": "event.target.?[type eq 'UserGroup'].size()>0 && event.target.?[displayName eq 'Sales'].size()>0"
}
}
]
}
}, - "channel": {
- "type": "HTTP",
- "version": "1.0.0",
- "config": {
- "headers": [ ],
- "method": "POST",
- "authScheme": {
- "type": "HEADER",
- "key": "authorization"
}
}
}, - "_links": {
- "verify": {
- "hints": {
- "allow": [
- "POST"
]
}
}, - "deactivate": {
- "hints": {
- "allow": [
- "POST"
]
}
}
}
}
]
okta.eventHooks.manage
Creates a new event hook for your organization in ACTIVE
status. You pass an event hook object in the JSON payload
of your request. That object represents the set of required information about the event hook you're registering, including:
The URI of your external service
The events in Okta you want to subscribe to
An optional event hook filter that can reduce the number of event hook calls. This is a self-service Early Access (EA) feature. See Create an event hook filter.
Additionally, you can specify a secret API key for Okta to pass to your external service endpoint for security verification. Note that the API key you set here is unrelated to the Okta API token
you must supply when making calls to Okta APIs. Optionally, you can specify extra headers that Okta passes to your external service with each call. Your external service must use a valid HTTPS endpoint.
name required | string Display name for the event hook | ||||||||||
required | object (EventSubscriptions) | ||||||||||
| |||||||||||
required | object (EventHookChannel) | ||||||||||
description | string or null Description of the event hook |
Success
Bad Request
Forbidden
Too Many Requests
{- "name": "Event Hook Test",
- "events": {
- "type": "EVENT_TYPE",
- "items": [
- "group.user_membership.add"
]
}, - "channel": {
- "type": "HTTP",
- "version": "1.0.0",
- "config": {
- "headers": [
- {
- "key": "X-Other-Header",
- "value": "my-header-value"
}
], - "authScheme": {
- "type": "HEADER",
- "key": "Authorization",
- "value": "my-shared-secret"
}
}
}
}
{- "id": "who8vt36qfNpCGz9H1e6",
- "status": "ACTIVE",
- "verificationStatus": "VERIFIED",
- "name": "Event Hook Test",
- "description": null,
- "created": "2023-07-07T13:41:56.000Z",
- "createdBy": "00u7xut94qEWYx5ss1e5",
- "lastUpdated": "2023-07-07T13:43:03.000Z",
- "events": {
- "type": "EVENT_TYPE",
- "items": [
- "group.user_membership.add"
], - "filter": null
}, - "channel": {
- "type": "HTTP",
- "version": "1.0.0",
- "config": {
- "headers": [
- {
- "key": "X-Other-Header",
- "value": "my-header-value"
}
], - "method": "POST",
- "authScheme": {
- "type": "HEADER",
- "key": "authorization"
}
}
}, - "_links": {
- "verify": {
- "hints": {
- "allow": [
- "POST"
]
}
}, - "deactivate": {
- "hints": {
- "allow": [
- "POST"
]
}
}
}
}
okta.eventHooks.read
Retrieves an event hook
Success
Forbidden
Not Found
Too Many Requests
{- "id": "who8vt36qfNpCGz9H1e6",
- "status": "ACTIVE",
- "verificationStatus": "VERIFIED",
- "name": "Event Hook Test",
- "description": null,
- "created": "2023-07-07T13:41:56.000Z",
- "createdBy": "00u7xut94qEWYx5ss1e5",
- "lastUpdated": "2023-07-07T13:43:03.000Z",
- "events": {
- "type": "EVENT_TYPE",
- "items": [
- "group.user_membership.add"
], - "filter": null
}, - "channel": {
- "type": "HTTP",
- "version": "1.0.0",
- "config": {
- "headers": [
- {
- "key": "X-Other-Header",
- "value": "my-header-value"
}
], - "method": "POST",
- "authScheme": {
- "type": "HEADER",
- "key": "authorization"
}
}
}, - "_links": {
- "verify": {
- "hints": {
- "allow": [
- "POST"
]
}
}, - "deactivate": {
- "hints": {
- "allow": [
- "POST"
]
}
}
}
}
okta.eventHooks.manage
Replaces an event hook. Okta validates the new properties before replacing the existing values. Some event hook properties are immutable and can't be updated. Refer to the parameter description in the request body schema.
Note: Updating the
channel
property requires you to verify the hook again.
name required | string Display name for the event hook | ||||||||||||||
required | object (EventSubscriptions) | ||||||||||||||
| |||||||||||||||
required | object (EventHookChannel) | ||||||||||||||
| |||||||||||||||
description | string or null Description of the event hook |
Success
Bad Request
Forbidden
Not Found
Too Many Requests
{- "name": "Event Hook with Filter",
- "description": "An event hook using an Okta Expression Language filter",
- "events": {
- "type": "EVENT_TYPE",
- "items": [
- "group.user_membership.add"
], - "filter": {
- "type": "EXPRESSION_LANGUAGE",
- "eventFilterMap": [
- {
- "event": "group.user_membership.add",
- "condition": {
- "expression": "event.target.?[type eq 'UserGroup'].size()>0 && event.target.?[displayName eq 'Sales'].size()>0"
}
}
]
}
}, - "channel": {
- "type": "HTTP",
- "version": "1.0.0",
- "config": {
- "authScheme": {
- "type": "HEADER",
- "key": "Authorization",
- "value": "my-shared-secret"
}
}
}
}
{- "id": "who8vt36qfNpCGz9H1e6",
- "status": "ACTIVE",
- "verificationStatus": "VERIFIED",
- "name": "Event Hook with Filter",
- "description": "An event hook using an Okta Expression Language filter",
- "created": "2023-07-07T13:41:56.000Z",
- "createdBy": "00u7xut94qEWYx5ss1e5",
- "lastUpdated": "2023-07-07T13:43:03.000Z",
- "events": {
- "type": "EVENT_TYPE",
- "items": [
- "group.user_membership.add"
], - "filter": {
- "type": "EXPRESSION_LANGUAGE",
- "eventFilterMap": [
- {
- "event": "group.user_membership.add",
- "condition": {
- "version": null,
- "expression": "event.target.?[type eq 'UserGroup'].size()>0 && event.target.?[displayName eq 'Sales'].size()>0"
}
}
]
}
}, - "channel": {
- "type": "HTTP",
- "version": "1.0.0",
- "config": {
- "method": "POST",
- "authScheme": {
- "type": "HEADER",
- "key": "authorization"
}
}
}, - "_links": {
- "hints": {
- "allow": [
- "POST"
]
}, - "deactivate": {
- "hints": {
- "allow": [
- "POST"
]
}
}
}
}
okta.eventHooks.manage
Deletes the event hook that matches the provided id
. After deletion, the event hook is unrecoverable.
As a safety precaution, you can only delete event hooks with a status of INACTIVE
.
No Content
Forbidden
Not Found
Too Many Requests
{- "errorCode": "E0000006",
- "errorSummary": "You do not have permission to perform the requested action",
- "errorLink": "E0000006",
- "errorId": "sampleNUSD_8fdkFd8fs8SDBK",
- "errorCauses": [ ]
}
okta.eventHooks.manage
Activates the event hook that matches the provided id
Success
Forbidden
Not Found
Too Many Requests
{- "id": "who8vt36qfNpCGz9H1e6",
- "status": "ACTIVE",
- "verificationStatus": "VERIFIED",
- "name": "Event Hook Test",
- "description": null,
- "created": "2023-07-07T13:41:56.000Z",
- "createdBy": "00u7xut94qEWYx5ss1e5",
- "lastUpdated": "2023-07-07T13:43:03.000Z",
- "events": {
- "type": "EVENT_TYPE",
- "items": [
- "group.user_membership.add"
], - "filter": null
}, - "channel": {
- "type": "HTTP",
- "version": "1.0.0",
- "config": {
- "headers": [
- {
- "key": "X-Other-Header",
- "value": "my-header-value"
}
], - "method": "POST",
- "authScheme": {
- "type": "HEADER",
- "key": "authorization"
}
}
}, - "_links": {
- "verify": {
- "hints": {
- "allow": [
- "POST"
]
}
}, - "deactivate": {
- "hints": {
- "allow": [
- "POST"
]
}
}
}
}
okta.eventHooks.manage
Deactivates the event hook that matches the provided id
Success
Forbidden
Not Found
Too Many Requests
{- "id": "who8vt36qfNpCGz9H1e6",
- "status": "INACTIVE",
- "verificationStatus": "VERIFIED",
- "name": "Event Hook Test",
- "description": null,
- "created": "2023-07-07T13:41:56.000Z",
- "createdBy": "00u7xut94qEWYx5ss1e5",
- "lastUpdated": "2023-07-07T13:43:03.000Z",
- "events": {
- "type": "EVENT_TYPE",
- "items": [
- "group.user_membership.add"
], - "filter": null
}, - "channel": {
- "type": "HTTP",
- "version": "1.0.0",
- "config": {
- "headers": [
- {
- "key": "X-Other-Header",
- "value": "my-header-value"
}
], - "method": "POST",
- "authScheme": {
- "type": "HEADER",
- "key": "authorization"
}
}
}, - "_links": {
- "verify": {
- "hints": {
- "allow": [
- "POST"
]
}
}, - "deactivate": {
- "hints": {
- "allow": [
- "POST"
]
}
}
}
}
okta.eventHooks.manage
Verifies that the event hook matches the provided eventHookId
. To verify ownership, your endpoint must send information back to Okta in JSON format. See Event hooks.
Only ACTIVE
and VERIFIED
event hooks can receive events from Okta.
If a response is not received within 3 seconds, the outbound request times out. One retry is attempted after a timeout or error response. If a successful response still isn't received, this operation returns a 400 error with more information about the failure.
Success
Bad Request
Forbidden
Not Found
Too Many Requests
{- "id": "who8vt36qfNpCGz9H1e6",
- "status": "ACTIVE",
- "verificationStatus": "VERIFIED",
- "name": "Event Hook Test",
- "description": null,
- "created": "2023-07-07T13:41:56.000Z",
- "createdBy": "00u7xut94qEWYx5ss1e5",
- "lastUpdated": "2023-07-07T13:43:03.000Z",
- "events": {
- "type": "EVENT_TYPE",
- "items": [
- "group.user_membership.add"
], - "filter": null
}, - "channel": {
- "type": "HTTP",
- "version": "1.0.0",
- "config": {
- "headers": [
- {
- "key": "X-Other-Header",
- "value": "my-header-value"
}
], - "method": "POST",
- "authScheme": {
- "type": "HEADER",
- "key": "authorization"
}
}
}, - "_links": {
- "verify": {
- "hints": {
- "allow": [
- "POST"
]
}
}, - "deactivate": {
- "hints": {
- "allow": [
- "POST"
]
}
}
}
}