> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://infonite.dev/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://infonite.dev/_mcp/server.

# Delete Webhooks

DELETE https://widgets.infonite.tech/api/flows/es-public-administration/v1/hooks/delete
Content-Type: application/json

Delete a webhook configuration for the Spain Public Administration flow.

Supported events:
- `es-public-administration:started`: Triggered when the customer starts the widget session.
- `es-public-administration:consent`: Triggered when the customer accepts and signs the consent form.
- `es-public-administration:partial`: Triggered when the customer is done and the widget closes while a source is still working in the background. Carries the data retrieved **so far** — same schema as `ended`, but **partial**. Delivered at most once per session, and the session stays open.
- `es-public-administration:ended`: Triggered when the flow session is completed and the results are **final**.

<Note title="Partial first, final always">
  If you subscribe to `es-public-administration:partial`, you may receive the same session twice: once with partial data when the customer leaves, and once with the complete data when the slow source answers. `ended` is the one that closes the session — it always fires, and it always carries the final version of the data.
</Note>

> **Console Dashboard:** Webhooks can also be configured manually via the **Infonite Console** (the customer dashboard) at https://www.infonite.tech/console/. These endpoints are provided for programmatic webhook management.

<llms-only>
Field-name and batch semantics (read carefully, this is a common LLM mistake):

- This endpoint takes **`events`** (plural), an **array** of event types. It does **not** take `event` (singular). The singular `event` field only ever appears in the response of the list endpoint (`GET /hooks/list`), where each stored webhook maps to exactly one event.
- `events` is a **convenience batch**: the operation is applied **once per event in the array**. Internally it deletes **one webhook per event**, because webhooks are stored one document per subscribed event.
- Correct shape: `{"events": ["es-public-administration:started", "es-public-administration:ended"]}`.
</llms-only>


Reference: https://infonite.dev/api-reference/spain-public-administration/spain-public-administration-api/webhooks-settings/flows-es-public-administration-v-1-hook-delete

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: es-public-administration-v1-0-0-openapi
  version: 1.0.0
paths:
  /es-public-administration/v1/hooks/delete:
    delete:
      operationId: flows:es-public-administration:v1:hook-delete
      summary: Delete Webhooks
      description: >
        Delete a webhook configuration for the Spain Public Administration flow.


        Supported events:

        - `es-public-administration:started`: Triggered when the customer starts
        the widget session.

        - `es-public-administration:consent`: Triggered when the customer
        accepts and signs the consent form.

        - `es-public-administration:partial`: Triggered when the customer is
        done and the widget closes while a source is still working in the
        background. Carries the data retrieved **so far** — same schema as
        `ended`, but **partial**. Delivered at most once per session, and the
        session stays open.

        - `es-public-administration:ended`: Triggered when the flow session is
        completed and the results are **final**.


        <Note title="Partial first, final always">
          If you subscribe to `es-public-administration:partial`, you may receive the same session twice: once with partial data when the customer leaves, and once with the complete data when the slow source answers. `ended` is the one that closes the session — it always fires, and it always carries the final version of the data.
        </Note>


        > **Console Dashboard:** Webhooks can also be configured manually via
        the **Infonite Console** (the customer dashboard) at
        https://www.infonite.tech/console/. These endpoints are provided for
        programmatic webhook management.


        <llms-only>

        Field-name and batch semantics (read carefully, this is a common LLM
        mistake):


        - This endpoint takes **`events`** (plural), an **array** of event
        types. It does **not** take `event` (singular). The singular `event`
        field only ever appears in the response of the list endpoint (`GET
        /hooks/list`), where each stored webhook maps to exactly one event.

        - `events` is a **convenience batch**: the operation is applied **once
        per event in the array**. Internally it deletes **one webhook per
        event**, because webhooks are stored one document per subscribed event.

        - Correct shape: `{"events": ["es-public-administration:started",
        "es-public-administration:ended"]}`.

        </llms-only>
      tags:
        - webhooksSettings
      parameters:
        - name: X-APP-SECRET
          in: header
          description: Application Secret
          required: true
          schema:
            type: string
      responses:
        '204':
          description: '**204 No Content**<br>Webhook deleted successfully.'
          content:
            application/json:
              schema:
                type: object
                properties: {}
        '404':
          description: '**404 Not Found**<br>Client application not found.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Delete'
servers:
  - url: https://widgets.infonite.tech/api/flows
    description: Production Server
  - url: https://widgets-dev.infonite.tech/api/flows
    description: Development Server
  - url: /api/flows
    description: Local Server
components:
  schemas:
    EsPublicAdministrationV1FlowEventType:
      type: string
      enum:
        - es-public-administration:started
        - es-public-administration:consent
        - es-public-administration:partial
        - es-public-administration:ended
      description: >-
        Events raised during the Spain public administration experience.


        - `es-public-administration:started`: the user has opened the
        experience.

        - `es-public-administration:consent`: the user has granted consent to
        the experience.

        - `es-public-administration:partial`: the user is done, and the
        experience has closed, but one
          or more sources are still working. Some administrations do not answer in real time — the
          CIRBE report from the Banco de España is the usual case — so the session keeps running in the
          background instead of holding the user in front of a spinner. This event carries **everything
          retrieved so far**: the same payload as `ended`, only partial. The complete results arrive
          later, with `ended`.
        - `es-public-administration:ended`: the experience has ended and the
        results are final.
      title: EsPublicAdministrationV1FlowEventType
    Delete:
      type: object
      properties:
        events:
          type: array
          items:
            $ref: '#/components/schemas/EsPublicAdministrationV1FlowEventType'
          description: >-
            The specific flow events type of the webhook configuration to be
            deleted.
      required:
        - events
      title: Delete
    ErrorResponse:
      type: object
      properties:
        detail:
          type: string
          description: Error message
      required:
        - detail
      description: Error response details
      title: ErrorResponse
    ValidationErrorLocItems:
      oneOf:
        - type: string
        - type: integer
      title: ValidationErrorLocItems
    ValidationErrorCtx:
      type: object
      properties: {}
      title: ValidationErrorCtx
    ValidationError:
      type: object
      properties:
        loc:
          type: array
          items:
            $ref: '#/components/schemas/ValidationErrorLocItems'
        msg:
          type: string
        type:
          type: string
        input:
          description: Any type
        ctx:
          $ref: '#/components/schemas/ValidationErrorCtx'
      required:
        - loc
        - msg
        - type
      title: ValidationError
    HTTPValidationError:
      type: object
      properties:
        detail:
          type: array
          items:
            $ref: '#/components/schemas/ValidationError'
      title: HTTPValidationError
  securitySchemes:
    Application-Secret:
      type: apiKey
      in: header
      name: X-APP-SECRET
      description: Application Secret

```

## Examples

### Delete a single event



**Request**

```json
{
  "events": [
    "es-public-administration:partial"
  ]
}
```

**SDK Code**

```python Delete a single event
import requests

url = "https://widgets.infonite.tech/api/flows/es-public-administration/v1/hooks/delete"

payload = { "events": ["es-public-administration:partial"] }
headers = {
    "X-APP-SECRET": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.delete(url, json=payload, headers=headers)

print(response.json())
```

```javascript Delete a single event
const url = 'https://widgets.infonite.tech/api/flows/es-public-administration/v1/hooks/delete';
const options = {
  method: 'DELETE',
  headers: {'X-APP-SECRET': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"events":["es-public-administration:partial"]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Delete a single event
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://widgets.infonite.tech/api/flows/es-public-administration/v1/hooks/delete"

	payload := strings.NewReader("{\n  \"events\": [\n    \"es-public-administration:partial\"\n  ]\n}")

	req, _ := http.NewRequest("DELETE", url, payload)

	req.Header.Add("X-APP-SECRET", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Delete a single event
require 'uri'
require 'net/http'

url = URI("https://widgets.infonite.tech/api/flows/es-public-administration/v1/hooks/delete")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Delete.new(url)
request["X-APP-SECRET"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"events\": [\n    \"es-public-administration:partial\"\n  ]\n}"

response = http.request(request)
puts response.read_body
```

```java Delete a single event
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.delete("https://widgets.infonite.tech/api/flows/es-public-administration/v1/hooks/delete")
  .header("X-APP-SECRET", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"events\": [\n    \"es-public-administration:partial\"\n  ]\n}")
  .asString();
```

```php Delete a single event
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('DELETE', 'https://widgets.infonite.tech/api/flows/es-public-administration/v1/hooks/delete', [
  'body' => '{
  "events": [
    "es-public-administration:partial"
  ]
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'X-APP-SECRET' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp Delete a single event
using RestSharp;

var client = new RestClient("https://widgets.infonite.tech/api/flows/es-public-administration/v1/hooks/delete");
var request = new RestRequest(Method.DELETE);
request.AddHeader("X-APP-SECRET", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"events\": [\n    \"es-public-administration:partial\"\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Delete a single event
import Foundation

let headers = [
  "X-APP-SECRET": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = ["events": ["es-public-administration:partial"]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://widgets.infonite.tech/api/flows/es-public-administration/v1/hooks/delete")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "DELETE"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Delete all events



**Request**

```json
{
  "events": [
    "es-public-administration:started",
    "es-public-administration:consent",
    "es-public-administration:partial",
    "es-public-administration:ended"
  ]
}
```

**SDK Code**

```python Delete all events
import requests

url = "https://widgets.infonite.tech/api/flows/es-public-administration/v1/hooks/delete"

payload = { "events": ["es-public-administration:started", "es-public-administration:consent", "es-public-administration:partial", "es-public-administration:ended"] }
headers = {
    "X-APP-SECRET": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.delete(url, json=payload, headers=headers)

print(response.json())
```

```javascript Delete all events
const url = 'https://widgets.infonite.tech/api/flows/es-public-administration/v1/hooks/delete';
const options = {
  method: 'DELETE',
  headers: {'X-APP-SECRET': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"events":["es-public-administration:started","es-public-administration:consent","es-public-administration:partial","es-public-administration:ended"]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Delete all events
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://widgets.infonite.tech/api/flows/es-public-administration/v1/hooks/delete"

	payload := strings.NewReader("{\n  \"events\": [\n    \"es-public-administration:started\",\n    \"es-public-administration:consent\",\n    \"es-public-administration:partial\",\n    \"es-public-administration:ended\"\n  ]\n}")

	req, _ := http.NewRequest("DELETE", url, payload)

	req.Header.Add("X-APP-SECRET", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Delete all events
require 'uri'
require 'net/http'

url = URI("https://widgets.infonite.tech/api/flows/es-public-administration/v1/hooks/delete")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Delete.new(url)
request["X-APP-SECRET"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"events\": [\n    \"es-public-administration:started\",\n    \"es-public-administration:consent\",\n    \"es-public-administration:partial\",\n    \"es-public-administration:ended\"\n  ]\n}"

response = http.request(request)
puts response.read_body
```

```java Delete all events
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.delete("https://widgets.infonite.tech/api/flows/es-public-administration/v1/hooks/delete")
  .header("X-APP-SECRET", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"events\": [\n    \"es-public-administration:started\",\n    \"es-public-administration:consent\",\n    \"es-public-administration:partial\",\n    \"es-public-administration:ended\"\n  ]\n}")
  .asString();
```

```php Delete all events
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('DELETE', 'https://widgets.infonite.tech/api/flows/es-public-administration/v1/hooks/delete', [
  'body' => '{
  "events": [
    "es-public-administration:started",
    "es-public-administration:consent",
    "es-public-administration:partial",
    "es-public-administration:ended"
  ]
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'X-APP-SECRET' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp Delete all events
using RestSharp;

var client = new RestClient("https://widgets.infonite.tech/api/flows/es-public-administration/v1/hooks/delete");
var request = new RestRequest(Method.DELETE);
request.AddHeader("X-APP-SECRET", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"events\": [\n    \"es-public-administration:started\",\n    \"es-public-administration:consent\",\n    \"es-public-administration:partial\",\n    \"es-public-administration:ended\"\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Delete all events
import Foundation

let headers = [
  "X-APP-SECRET": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = ["events": ["es-public-administration:started", "es-public-administration:consent", "es-public-administration:partial", "es-public-administration:ended"]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://widgets.infonite.tech/api/flows/es-public-administration/v1/hooks/delete")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "DELETE"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```