Skip to content
Aller au contenu
Charitips

API reference · Webhooks

Create a webhook

POST/v1/webhooks

No description in the spec yet.

Requires a Bearer access token.

Body

CreateWebhookDto

1 of 8 fields has no description in the spec.

  • target#stringrequiredURL

    Full url including protocol of the endpoint which will receive the webhooks.

  • events#string[]requiredone of donation_create, donation_update, vote_create, vote_update, recurringdonation_create, recurringdonation_update, campaign_create, campaign_update, charitiesselection_create, charitiesselection_update, paymentmethod_create, charity_publish, charityprofile_update, fiscalreceipt_generated, charity_profile_update, file_generated

    List of events to subscribe to.

    donation_createdonation_updatevote_createvote_updaterecurringdonation_createrecurringdonation_updatecampaign_createcampaign_updatecharitiesselection_createcharitiesselection_updatepaymentmethod_createcharity_publishcharityprofile_updatefiscalreceipt_generatedcharity_profile_updatefile_generated

  • authenticationStrategy#stringrequired

    Authentication scheme to be used when sending the webhooks to the provided endpoint.

    BASICBEARER

  • username#string

    Required for Basic authentication.

  • password#string

    Required for Basic authentication.

  • accessToken#string

    Required for Bearer authentication.

  • accountId#stringUUID

    Only required to create the webhook on a child account instead of the current one. Webhooks of a parent account already receive the events of its child accounts.

  • name#stringrequired2 to 100 characters

Response

201 · Webhook

No field is described in the spec.

  • webhookId#stringalways returned

  • name#stringalways returned

  • target#stringalways returned

  • events#string[]always returned

  • authenticationStrategy#WebhookAuthenticationStrategyalways returned

    BASICBEARER

  • accessToken#stringalways returned

  • signingKey#string

  • accountId#stringalways returned

  • createdAt#string (date-time)always returned

  • updatedAt#string (date-time)always returned

Errors

  • 400Both username and password are required for Basic authentication
    {
      "statusCode": 400,
      "message": "Both username and password are required for Basic authentication",
      "error": "Bad Request"
    }
  • 400accessToken is required for Bearer authentication
    {
      "statusCode": 400,
      "message": "accessToken is required for Bearer authentication",
      "error": "Bad Request"
    }
  • 400Invalid authenticationStrategy
    {
      "statusCode": 400,
      "message": "Invalid authenticationStrategy",
      "error": "Bad Request"
    }
  • 400A field is missing, has the wrong type, or is not part of the request schema.

    Every request with a body or query is validated.

    {
      "statusCode": 400,
      "message": [
        "amount must not be less than 1",
        "property foo should not exist"
      ],
      "error": "Bad Request"
    }
  • 401Unauthorized

    Missing, expired or invalid access token.

    {
      "statusCode": 401,
      "message": "Unauthorized"
    }
  • 402Plan upgrade required
    {
      "statusCode": 402,
      "message": "Plan upgrade required"
    }
  • 403Account closed
    {
      "message": "Account closed",
      "code": "ACCOUNT_CLOSED"
    }
POST /v1/webhooks
curl -X POST https://api.sandbox.charitips.com/v1/webhooks \  -H "Authorization: Bearer $CHARITIPS_TOKEN" \  -H "Content-Type: application/json" \  -d '{    "target": "https://example.com/charitips/webhooks",    "events": [      "donation_update"    ],    "authenticationStrategy": "BEARER",    "name": "Donations",    "accessToken": "<endpointToken>"  }'
Built from the spec and the API code

Request bodies are written for this docs and checked against the API's validation; ids in angle brackets are placeholders. Response values are placeholders built from the schema.