SocredDocs

    Delete Webhook

    This API allows you to permanently delete a webhook. Once deleted, the webhook will no longer receive notifications, and the operation cannot be undone. Make sure you have the correct webhook ID before proceeding.

    DELETEhttps://api.socredsa.com.br/v3/accounts/api/webhooks/{webhook_id}
    curl --request DELETE \
      --url 'https://api.socredsa.com.br/v3/accounts/api/webhooks/{webhook_id}' \
      --header 'Authorization: Bearer <ACCESS_TOKEN>'
    Response200
    {
      "message": "Webhook deleted successfully"
    }

    Endpoint

    DELETE /v3/accounts/api/webhooks/{webhook_id}

    Headers

    ParameterTypeDescriptionExample
    AuthorizationStringBearer + Access_tokenBearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNzEzMzAwOTMxLCJpYXQiOjE3MTMyOTczMzEsImp0aSI6Ijc2ZWI4ZTE5ZjM4YjQ4NmZiODdmNzNjNTdkMWVmNDJhIiwidXNlcl9pZCI6MjQ2fQ.5zekMa7CUj9p-MvNHns5ke4ZPhYV3Y1CLOsYL7hDUUo

    Path Parameters

    ParameterTypeDescriptionExample
    webhook_idIntegerThe ID of the webhook to delete. This is the ID returned when the webhook was created.789

    Request Example

    DELETE /v3/accounts/api/webhooks/789
    Authorization: Bearer <access_token>

    Response Details

    {
      "message": "Webhook deleted successfully"
    }
    FieldDescription
    messageConfirmation message indicating the webhook was successfully deleted

    Error Responses

    HTTP CodeError MessageDescription
    400Account is closedThe webhook's associated account is closed. Cannot delete webhooks for closed accounts.
    401UnauthorizedInvalid or missing authentication token. Ensure you are sending a valid Bearer token.
    404Webhook not foundThe webhook with the specified ID was not found or you do not have access to it.

    Business Rules

    Authentication:

    • Requires valid authentication token
    • User must be authenticated and have access to the webhook

    Validations:

    • Webhook must exist and be accessible by the authenticated user
    • Account cannot be closed

    Deletion Behavior:

    • Deletion is permanent and cannot be undone
    • Once deleted, the webhook will immediately stop receiving notifications
    • The webhook ID cannot be reused
    • After deletion, you can create a new webhook with the same URL and type if needed

    Best Practices:

    • Before deleting, verify the webhook ID using the List Webhooks endpoint
    • Document the reason for deletion in your change logs
    • After successful deletion, the webhook will not appear in List Webhooks results