>  Switch To Link 5 and API v2 Documentation

Webhooks

Learn about the /webhooks endpoint.

  • Webhooks provide a way for Argyle to communicate to your servers when specific events happen, such as when an account was successfully connected, new payouts were added, etc.
  • To start receiving webhooks, you need to build a web application, with a publicly accessible URL. Use that URL to create a webhook subscription.
  • After subscribing to a webhook, you receive a POST request with the event payload that contains information about the event that has been triggered.

For more information, refer to our Webhooks Reference.

#The webhook object

Attributes
  • #
    idstring (uuid)

    Unique ID of the webhook.

  • #
    eventsarray of strings

    An array of Argyle's webhook event types—for example, activities.added. Refer to our Webhooks Overview for a full list of available event types.

  • #
    urlstring

    The endpoint that is invoked when the specified event occurs.

  • #
    configobject

    Configuration options of the webhook. Refer to our Webhooks Reference to learn more about available configuration parameters.

  • #
    namestring

    An arbitrary name that is sent back to your system in the webhook payload.

  • #
    secretstring

    The key that will be used to generate HMAC-SHA512 hex digest value in the X-Argyle-Signature header.

  • #
    created_atstring (timestamp)

    Time at which the webhook was created. Timestamps follow the ISO 8601 standard.

  • #
    updated_atstring (timestamp)

    Time at which the webhook was last updated. Timestamps follow the ISO 8601 standard.



Example
1{
2  "id": "580dca76-c024-4458-bb10-a2111ad4063e",
3  "created_at": "2019-11-27T15:54:59.440004Z",
4  "updated_at": "2019-11-27T15:54:59.440056Z",
5  "events": [
6    "*"
7  ],
8  "name": "All webhooks",
9  "secret": null,
10  "url": "https://webhooks-backend.com/argyle",
11  "config": null
12}

#Create a webhook

post/v1/webhooks
  • Create a new webhook.
  • This request returns the created webhook object.
Request body
  • #
    namestring
    required

    An arbitrary name that is sent back to your system in the webhook payload.

  • #
    eventsarray of strings
    required

    An array of Argyle webhook event types. Specify ['*'] to subscribe to all webhook events.

  • #
    urlstring
    required

    The backend website where you want to receive the webhook.

  • #
    configobject
    optional

    { "include_resource": true } to receive the webhook's payload.

    Can only be applied individually to certain webhooks.

  • #
    secretstring
    optional

    If provided, the secret is used as a key in the HMAC-SHA512 algorithm to generate a hex digest, which is then included in the X-Argyle-Signature header in every webhook request to your system.

Example Request
1curl --request POST \
2     --url https://api.argyle.com/v1/webhooks \
3     --header 'accept: application/json' \
4     --header 'content-type: application/json' \
5     --data '{
6        "events": ["accounts.connected", "accounts.updated"],
7        "name": "name-for-the-webhook-subscription",
8        "url": "https://your-webhook-backend.com",
9        "config": { "include_resource": true },
10        "secret": "optional-secret"
11     }'
Example Response
1{
2  "id": "018050ec-522f-1725-0906-320116f36aa6",
3  "name": "name-for-the-webhook-subscription",
4  "events": [
5    "accounts.connected",
6    "accounts.updated"
7  ],
8  "config": {},
9  "secret": null,
10  "url": "https://your-webhook-backend.com",
11  "created_at": "2022-04-22T10:58:26.480241Z",
12  "updated_at": "2022-04-22T10:58:26.480285Z"
13}

#Retrieve a webhook

get/v1/webhooks/{id}
  • Retrieve a webhook object with the supplied ID.
  • This request returns a webhook object if you provided a valid identifier.
Path parameters
  • #
    idstring (uuid)
    required

    ID of the webhook.

Example Request
1curl --request GET \
2     --url https://api.argyle.com/v1/webhooks/{id} \
3     --header 'accept: application/json' \
4     --header 'content-type: application/json'
Example Response
1{
2  "id": "018050c5-9af3-4009-14d1-745fd94049c3",
3  "name": "Account added",
4  "events": [
5    "accounts.added"
6  ],
7  "config": {
8    "include_resource": true
9  },
10  "secret": null,
11  "url": "https://webhook.site/#!/251acbda-9bd7-445d-9ae3-17c8d2f0f238",
12  "created_at": "2022-04-22T10:16:09.204507Z",
13  "updated_at": "2022-04-22T10:54:17.524603Z"
14}

#List webhooks

get/v1/webhooks
  • List all webhooks.
  • This request returns an object with a results property that contains an array of up to limit webhook objects.
Query parameters
  • #
    from_created_at_datestring
    optional

    Filter for webhooks created on or after this timestamp (ISO 8601).

  • #
    to_created_at_datestring
    optional

    Filter for webhooks created on or before this timestamp (ISO 8601).

  • #
    orderingstring (enum)
    optional

    Order the results. Possible values: id or created_at

  • #
    limitinteger
    optional

    Number of results returned per page. Default is 10. Maximum is 200.

Example Request
1curl --request GET \
2     --url https://api.argyle.com/v1/webhooks?limit=2 \
3     --header 'accept: application/json' \
4     --header 'content-type: application/json'
Example Response
1[
2  {
3    "id": "018050c5-9af3-4009-14d1-745fd94049c3",
4    "name": "Account added",
5    "events": [
6      "accounts.added"
7    ],
8    "config": {
9      "include_resource": true
10    },
11    "secret": null,
12    "url": "https://webhook.site/#!/251acbda-9bd7-445d-9ae3-17c8d2f0f238",
13    "created_at": "2022-04-22T10:16:09.204507Z",
14    "updated_at": "2022-04-22T10:54:17.524603Z"
15  },
16  {
17    "id": "017efe13-4336-be71-0f32-529ba362f787",
18    "name": "Account updated",
19    "events": [
20      "accounts.updated"
21    ],
22    "config": {
23      "include_resource": true
24    },
25    "secret": "8500588670cf4e4d83a9a68259429733",
26    "url": "https://eo7fvts7a5ivh78.m.pipedream.net",
27    "created_at": "2022-02-15T15:49:42.327499Z",
28    "updated_at": "2022-04-19T22:49:13.761672Z"
29  }
30]

#Delete a webhook

delete/v1/webhooks/{id}
  • Remove a webhook and unsubscribe your system from the events in the deleted webhook.
  • This request returns an empty response body.
Path parameters
  • #
    idstring (uuid)
    required

    ID of the webhook to be deleted.

Example Request
1curl --request DELETE \
2     --url https://api.argyle.com/v1/webhooks/{id} \
3     --header 'accept: application/json' \
4     --header 'content-type: application/json'
Example Response
1"204 status code: No content."
Updating Argyle status...
© 2024 Argyle Systems Inc.argyle.com