# Delete submitted form data

Source: https://govform.com/resources/documentation/article/33-06-api-delete-submitted-form-data
Topic: Govform API & MCP

**API units: 25.** Each accepted bulk deletion request uses 25 units.

This endpoint archives and then removes submitted data for one or more submission IDs. It removes user-entered data and action data for the selected submissions.

## Endpoint and parameters

```
POST /api/submitted-data/{libraryId}/{serviceId}/delete
```

| Parameter | Description | Required |
| --- | --- | --- |
| `libraryId` | ID of the library that owns the service. | Yes |
| `serviceId` | ID of the service containing the submissions. | Yes |

## Request

Send the API key in the `Authorization` header and JSON in the request body.

| Header | Value |
| --- | --- |
| `Authorization` | `GovformsApiKey {keyId}:{keySecret}` |
| `Content-Type` | `application/json` |

```
{
  "submissionIds": [
    "1234-ABCD-ABCD",
    "5678-EFGH-EFGH"
  ]
}
```

`submissionIds` must be a non-empty array. A request can contain at most 1000 IDs.

## Successful response

```
{
  "requestedCount": 2,
  "deletedCount": 1,
  "deletedSubmissionIds": ["1234-ABCD-ABCD"],
  "notFoundSubmissionIds": ["5678-EFGH-EFGH"]
}
```

| Field | Meaning |
| --- | --- |
| `requestedCount` | Number of non-empty submission IDs accepted from the request. |
| `deletedCount` | Number of submitted-data records deleted. |
| `deletedSubmissionIds` | IDs found and deleted. |
| `notFoundSubmissionIds` | IDs not found for this library and service. |

## Errors

| Status | Reason |
| --- | --- |
| 400 | Missing parameters, or `submissionIds` is missing, empty or not an array. |
| 403 | The key is invalid, lacks permission for this endpoint, or the request IP is not allowed. |
| 404 | The service was not found. |
| 413 | More than 1000 submission IDs were supplied. |
| 500 | Server error. |
