When creating an integration you have specified a webhook url. The webhook url is used for notifying you once some asynchronous task, like a file analysis, has been completed. Your webhook address must be public facing to the internet. Furthermore, there should be no redirects. All requests to your webhook will be aborted if it's duration exceeds three seconds.
You can find an example webhook integration here: Cyanite Integration Example on Github
Cyanite.ai will send a
POST method request with
The request body always has the following structure:
Signature header of the request includes a
HMAC based on the Webhook secret set during the integration creation process.
You should use this signature in order to verify the request body.
A webhook should return the status code
200, otherwise, the call will be treated as unsuccessful (and retried at a later point in time).
Furthermore, the webhook does (in contrast to the GraphQL API), for security reasons, only include the necessary data. In most cases, this means only the id of the processed entity.
Available Event Types
All requests will use the
POST method and the
|Event Type||Example Body|
InDepthAnalysis and SpotifyTrackAnalysis
For a finished or failed analysis of a library or spotify track the Cyanite.ai API sends the
FastMusicalAnalysis and FullScaleAnalysis
FullScaleAnalysis use the new webhook event payload schema. Instead of using the event type as an identifier for the resource and the status it utilizes a more flexible nested structure that is more resource oriented.
FastMusicalAnalysis and the
FullScaleAnalysis are enqueued for spotify tracks and library tracks (InDepthAnalysis records). The status of those analyses is reported with a webhook containing the following payload:
Verifying the Request Signature
Example implementation of verifying the request signature in Node.js.