Vai al contenuto principale

Webhook configs

Pubblicato il 26 giugno 2019· Aggiornato il 23 gennaio 2023

Cover image for: Webhook configs

The webhook config resource is used by the API to send events to your webhook receiver.

An organisation can have a default webook config which is used by all keys within that organisation that don't specify a webhook config of their own.

Attributes

nametypedescription
idwebhook config IDResource identifier.
resourcestring, always webhook_configResource type specifier.
organisationorganisation IDThe organisation the resource belongs to.
urlstringThe url to target when sending events.
secretstringThe shared secret used to verify event signatures.
statestringOne of: new, valid, invalid, deactivated.
date_createddatetimeWhen the resource was created.

Secret

When a webhook config is created, a secret will be generated alongside it that will be used to sign events sent by the API. It is highly recommended that you implement your webhook receiver to verify the signature of incoming events using this secret. For more details on the signature verification procedure see the webhook configuration docs.

States

  • new has just been created or recently updated but not yet tested.
  • valid has passed validation and is ready to be used. An organisation must have at least one webhook config in this state in order to be useable.
  • invalid has failed the validation test. Must be updated or retested.
  • deactivated has been turned off by the owning organisation.

Create POST /configs/webhook

This action will create a webhook_config.test task in order to validate the endpoint details. If the webhook receiver is not yet setup, this test will likely fail and set the config to the invalid state. However, the config can always be re-tested using the test action.

Parameters

nametypedescription
urlrequiredThe URL of your webhook receiver.

Using cURL

curl https://ricloud-api.reincubate.com/configs/webhook \
  -X POST \
  -H 'Authorization: Token <your key_token>' \
  -H 'Content-Type: application/json' \
  -d '{
  "url": "https://www.mywebhook.com/webhooks/"
}'

Using ricloud-py

import ricloud

webhook_config = ricloud.WebhookConfig.create(url='https://www.mywebhook.com/webhooks/')

Retrieve GET /configs/webhook/{webhook_config ID}

Using cURL

curl https://ricloud-api.reincubate.com/configs/webhook/<webhook_config ID> \
  -H 'Authorization: Token <your key_token>'

Using ricloud-py

import ricloud

webhook_config = ricloud.WebhookConfig.retrieve(<webhook_config ID>)

List GET /configs/webhook

Webhook configs in the deactivated state are hidden by default and can only be listed by explicit filtering.

Parameters

nametypedescription
statestringFilter webhook configs by their state.
date_createddatetime filterFilter by resource creation date.

Update POST /configs/webhook/{webhook_config ID}

This action will create a webhook_confg.test task in the background to validate any changes made to the config.

The state attribute can only be changed to deactivated in the case you are essentially retiring a config.

Parameters

nametypedescription
urlstringUpdate the URL.
statestringOnly to new or deactivated.

Using cURL

curl https://ricloud-api.reincubate.com/configs/webhook/<webhook_config ID> \
  -X POST \
  -H 'Authorization: Token <your key_token>' \
  -H 'Content-Type: application/json' \
  -d '{
    "url": "https://www.myupdatedwebhook.com/webhooks/",
}'

Using ricloud-py

import ricloud

webhook_config = ricloud.WebhookConfig.update_with_id(
  <webhook_config ID>,
  url='https://www.myupdatedwebhook.com/webhooks/'
)

# OR

webhook_config = ricloud.WebhookConfig.retrieve(<webhook_config ID>)

webhook_config.update(url='https://www.myupdatedwebhook.com/webhooks/')

Test POST /configs/webhook/{webhook_config ID}/test

This action creates a webhook_config.test task which sends a test event using the specified configuration. The outcome of the test will update the state attribute of the webook configuration accordingly.

Using cURL

curl https://ricloud-api.reincubate.com/configs/webhook/<webhook_config ID>/test \
  -H 'Authorization: Token <your key_token>'

Using ricloud-py

import ricloud

test_task = ricloud.WebhookConfig.test_with_id(<webhook_config ID>)

# OR

webhook_config = ricloud.WebhookConfig.retrieve(<webhook_config ID>)

test_task = webhook_config.test()

Articoli correlati

Hai bisogno di aiuto?

Cerchiamo di rispondere a tutti i messaggi entro un giorno lavorativo.

support@reincubate.com
Logo del King's Award for Enterprise

King's Award for Enterprise: Reincubate ha vinto quattro volte la più alta onorificenza aziendale ufficiale del Regno Unito, l'ultima in riconoscimento della straordinaria crescita dell'azienda negli ultimi tre anni.

Le nostre relazioni con utenti e partner sono al centro dei nostri valori e dei prodotti che creiamo. Consulta le nostre recensioni per scoprire cosa dicono di noi.

Certificazione ISO 27001 rilasciata dal Centre for Assessment, accreditato UKAS

© 2008-2026 Reincubate Ltd. Tutti i diritti riservati. Registrata in Inghilterra e Galles con il n. 5189175, P. IVA GB151788978. Camo®, Streamlight® e Reincubate® sono marchi registrati. Brevetti in corso di registrazione.

Assistenza