> For the complete documentation index, see [llms.txt](https://docs.prodegeads.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.prodegeads.com/publisher-apis/user-data-deletion-api.md).

# User Data Deletion API

Partner API for GDPR erasure requests. Deletes **profile-related MySQL data** for one offer-wall user.

***

### Endpoint

|                   |                                    |
| ----------------- | ---------------------------------- |
| **Method**        | `DELETE`                           |
| **Path**          | `/v1/user-data`                    |
| **Content type**  | Query parameters (no request body) |
| **Response type** | `application/json`                 |

**Full URL**

```
DELETE https://api.adgatemedia.com/v1/user-data
```

***

### Authentication

All three query parameters are required. There is no separate `aff_id`.

1. Caller sends `source` (offer wall source string, e.g. `vc-123`) and `api_key`.
2. Server parses `source` → wall id, loads the wall’s owning publisher.
3. `api_key` must match that publisher’s API key, and the publisher must be active.

Invalid or foreign keys return **401** (same message for wrong key, inactive publisher, or unknown wall).

***

### Parameters

All parameters are sent as **query string** values.

| Name      | Required | Type   | Description                                                  |
| --------- | -------- | ------ | ------------------------------------------------------------ |
| `source`  | Yes      | string | Offer wall source, format `vc-{wall_id}` (example: `vc-123`) |
| `user_id` | Yes      | string | Publisher member id (`vc_users.user_id`)                     |
| `api_key` | Yes      | string | Publisher API key for the wall’s owning publisher            |

***

### Example request

```bash
curl -X DELETE \
  "https://api.adgatemedia.com/v1/user-data?source=vc-123&user_id=member-456&api_key=YOUR_PUBLISHER_API_KEY"
```

Equivalent with explicit query args:

```bash
curl -X DELETE "https://api.adgatemedia.com/v1/user-data" \
  --get \
  --data-urlencode "source=vc-123" \
  --data-urlencode "user_id=member-456" \
  --data-urlencode "api_key=YOUR_PUBLISHER_API_KEY"
```

***

### Responses

#### 200 — Success (including unknown user)

Profile deleted, **or** no profile existed for that `(source, user_id)`.

Unknown users are treated as success on purpose (idempotent; avoids revealing whether a member exists).

```json
{
  "data": null
}
```

#### 401 — Unauthorized

Wrong `api_key`, key does not own the wall for `source`, wall missing, or publisher inactive.

```json
{
  "message": "Invalid source or api_key provided."
}
```

#### 422 — Validation error

Missing parameters or invalid `source` format (not parseable as a wall source).

```json
{
  "message": "Invalid source."
}
```

Missing field example (message lists validation errors):

```json
{
  "message": "The source field is required. The user_id field is required. The api_key field is required."
}
```

***

***
