Ready for webhooks?
Currently, webhooks are only available for paid users and partners. Please contact us to get webhooks set up for your account.
Overview
In addition the above resources, we also allow users to set up webhooks and subscribe to Events that occur as your Samples and Analyses are processed by the platform. Events are a record of webhook payloads that have been delivered to relevant subscriptions and only exist if webhooks are configured (i.e., an account without webhooks turned on will have no events). By default, up to 30 days worth of events are available via the v1 API.
Subscribing to webhooks
Currently, it is possible to subscribe to individual event types or subscribe to all events (*
). Webhooks POST to a specified http
or https
endpoint without authentication and are individually signed and timestamped so that you can verify that the webhooks were sent by One Codex and not a third party (see Checking Signatures). Please contact us in order to get started with webhooks for your account.
Event types
Currently the following event types exist:
sample.uploaded
: When a sample is successfully uploaded or imported into the One Platform. This event means we have successfully received your data and started to process it.analysis.succeeded
: When an analysis finishes successfully. Successful analyses have asuccess: true
property and their results may be retrieved via the API (see Retrieve Analysis Results).analysis.failed
: When an analysis finishes but is unsuccessful. Failed analyses will have/results
that result in a404
error and asuccess: false
property. Note that ananalysis.failed
event may fire multiple times for the same analysis if it is retried by One Codex's processing (it may alsosucceed
in the future if the failure was due, e.g., to hardware or other unexpected processing issues).
Note that the default "wildcard" subscriptions (*
) may include additional event types in the future. When requesting that webhook setup for your account, please specify if you would like the subscription(s) to listen to all events or only select events.
The Event resource
The event resource contains the following fields:
Property | Description |
---|---|
$uri | The event ID encoded as an addressable URI |
payload | The webhook payload (as documented below). Note that webhooks will be delivered for a specific API version and that version is noted in the payload via the |
status | An enum with one of the following 4 values:
|
The Webhook payload format
The webhook payload delivered by our system consists of 5 fields:
api_version | The API version used in generating the representation of the relevant |
---|---|
event_type | A string with the event type. Note webhooks may be configured to listen to all or only specific event types. |
object | A representation of the core object for which the |
object_type | A string representation of the object type. Currently |
triggered_at | Timestamp for when the event was triggered, encoded as a RFC 3339 timestamp. Note: The |
In production settings, we strongly recommend checking the signatures of any received webhooks to ensure that they originate from One Codex and not a malicious third party. See the following section for details.