> ## Documentation Index
> Fetch the complete documentation index at: https://docs.theswarm.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Data Subject Requests

> Automate profile data erasure requests using The Swarm DSR API.

The Data Subject Requests (DSR) API enables you to process erasure (deletion) requests for user profile data. When called, this endpoint removes profile data from The Swarm system entirely and ensures it won't be re-imported during future data refreshes.

## Authentication

DSR API requests require a dedicated secret key, separate from your standard API key. Include it in the request header:

```text theme={null}
X-DSR-SECRET: your_dsr_secret_key
```

Contact [support@theswarm.com](mailto:support@theswarm.com) to obtain your DSR secret key.

## Delete profile data

Remove a profile from The Swarm by providing email addresses and/or LinkedIn URL.

### Request

```bash theme={null}
curl --request POST \
  --url https://integrations.theswarm.com/dsr/profiles \
  --header 'Content-Type: application/json' \
  --header 'X-DSR-SECRET: <API key>' \
  --data '{
    "emails": ["user@example.com"],
    "linkedin_url": "https://linkedin.com/in/username"
  }'
```

### Parameters

| Parameter      | Type   | Required | Description                                         |
| -------------- | ------ | -------- | --------------------------------------------------- |
| `emails`       | array  | No       | List of email addresses associated with the profile |
| `linkedin_url` | string | No       | LinkedIn profile URL                                |

<Note>
  At least one of `emails` or `linkedin_url` must be provided.
</Note>

### Responses

<Tabs>
  <Tab title="200 Success">
    ```json theme={null}
    {
      "message": "Requested processed"
    }
    ```
  </Tab>

  <Tab title="400 Validation Error">
    ```json theme={null}
    {
      "status": 400,
      "title": "Validation failed",
      "errors": [
        {
          "path": "<field>",
          "violation": "<error message>"
        }
      ]
    }
    ```
  </Tab>

  <Tab title="500 Server Error">
    ```json theme={null}
    {
      "status": 500
    }
    ```
  </Tab>
</Tabs>

## How it works

1. **Immediate removal** - The profile data is deleted from all Swarm databases upon a successful request
2. **Permanent exclusion** - The profile is added to an exclusion list, preventing re-import during future data refreshes
3. **Audit trail** - All DSR requests are logged for compliance purposes

## Best practices

* Process DSR requests within your required compliance timeframe (e.g., GDPR requires 30 days)
* Maintain records of DSR requests for compliance audits
* Test with non-production data before implementing in your workflow
