# Delete saved verification results in bulk

POST /api/v1/citations/delete deletes up to 100 saved verification results in one call and lists which ids were deleted and which were not found. Free.

Documentation index: https://webcite.co/llms.txt
Canonical page: https://webcite.co/api-docs/delete-citations
API origin: https://api.webcite.co
Authentication: x-api-key header. Keep keys on your server.

## When to use it

Send between 1 and 100 verification result ids in `ids`. Each result is deleted as [single delete](/api-docs/delete-citation) deletes it, in one transaction for the whole call. An id from another account is reported in `not_found` and left untouched.

## Response example

Built from the response schema in the [OpenAPI file](/api-docs/openapi.json); identifiers are placeholders.

```json
{
  "deleted": [
    "00000000-0000-4000-8000-000000000031"
  ],
  "not_found": [
    "00000000-0000-4000-8000-000000000032"
  ]
}
```

## Request

POST /api/v1/citations/delete

Free. Deleting verification results costs 0 credits.

### curl

```curl
curl --fail-with-body -X POST 'https://api.webcite.co/api/v1/citations/delete' \
  -H "x-api-key: $WEBCITE_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "ids": [
    "00000000-0000-4000-8000-000000000031",
    "00000000-0000-4000-8000-000000000032"
  ]
}'
```

### Node.js

```javascript
const response = await fetch("https://api.webcite.co/api/v1/citations/delete", {
  method: "POST",
  headers: {
    "x-api-key": process.env.WEBCITE_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
  "ids": [
    "00000000-0000-4000-8000-000000000031",
    "00000000-0000-4000-8000-000000000032"
  ]
}),
});
if (!response.ok) throw new Error(`HTTP ${response.status}: ${await response.text()}`);
console.log(await response.json());
```

### python

```python
import os
import json
import requests

payload = json.loads("{\n  \"ids\": [\n    \"00000000-0000-4000-8000-000000000031\",\n    \"00000000-0000-4000-8000-000000000032\"\n  ]\n}")
response = requests.post(
    "https://api.webcite.co/api/v1/citations/delete",
    headers={"x-api-key": os.environ["WEBCITE_API_KEY"]},
    json=payload,
    timeout=(10, 300),
)
response.raise_for_status()
print(response.json())
```

## Response

HTTP 200 returns `deleted`, the ids removed, and `not_found`, the ids that do not exist or that another account owns. Repeated ids count once.

## Errors

400: `ids` is missing, empty or longer than 100 entries, an id is longer than 191 characters, or an id is not a UUID (`Invalid citation id`); nothing is deleted. 401: missing or invalid key. 403: app keys cannot use this endpoint.

## OpenAPI operation

```json
{
  "path": "/api/v1/citations/delete",
  "method": "POST",
  "operation": {
    "description": "Deletes up to 100 verification results. Free.",
    "operationId": "DataDeletionController_deleteCitations",
    "parameters": [],
    "requestBody": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/BulkDeleteDto"
          }
        }
      },
      "required": true
    },
    "responses": {
      "200": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/BulkDeletedDto"
            }
          }
        },
        "description": ""
      }
    },
    "security": [
      {
        "x-api-key": []
      },
      {
        "bearer": []
      }
    ],
    "summary": "Delete verification results in bulk",
    "tags": [
      "Saved citations"
    ]
  },
  "schemas": {
    "BulkDeleteDto": {
      "properties": {
        "ids": {
          "description": "Ids to delete (1 to 100).",
          "items": {
            "type": "string"
          },
          "maxItems": 100,
          "minItems": 1,
          "type": "array"
        }
      },
      "required": [
        "ids"
      ],
      "type": "object"
    },
    "BulkDeletedDto": {
      "properties": {
        "deleted": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "in_progress": {
          "description": "Reviews still running; delete them after they finish.",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "not_found": {
          "description": "Ids this account does not own or that do not exist.",
          "items": {
            "type": "string"
          },
          "type": "array"
        }
      },
      "required": [
        "deleted",
        "not_found"
      ],
      "type": "object"
    }
  }
}
```
