Added

Implement the accounts.added webhook to know when a user connects via Argyle Link.

accounts.added is triggered the moment a user initiates a new connection via Argyle Link by submitting their login credentials.

After an account is created, either the accounts.connected or the accounts.failed event is triggered.

accounts.connected signifies that an account was successfully authenticated with the correct credentials and a new account object was created.

accounts.failed indicates that authentication failed when linking the account and that it was created with a failed authentication state.

Event

accounts.added

Configuration

AttributeTypeDescription
include_resourceboolean optionalIf set to true in the webhook subscription configuration, the webhook payload returns the full account object as resource. Defaults to false.

Payload

AttributeTypeDescription
accountstring uuidID of the added payroll account.
userstring uuidID of the user associated with the account.
resourceobjectThe full account object is returned if the webhook subscription contains "include_resource": true in the configuration.

Examples

curl -X POST https://api.argyle.com/v1/webhooks \
  -u api_key_id:api_key_secret \
  -H "Content-Type: application/json" \
  -d '{"events": ["accounts.added"],
       "secret": "<secret for signature verification>",
         "name": "accounts.added",
       "config": { "include_resource": true },
          "url": "https://webhook.site/url"}'
{
    "event": "accounts.added",
    "name": "An account was created",
    "data": {
        "account": "ada143be-3c90-4534-b7ea-9899674dc6e0",
        "user": "3823026e-a964-45f6-b201-6b8c096b30d3",
        "resource": {
            "id": "ada143be-3c90-4534-b7ea-9899674dc6e0",
            "user": "3823026e-a964-45f6-b201-6b8c096b30d3",
            "employers": [
                "homedepot"
            ],
            "..."
        }
    }
}