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

# Purge Visitors

> The Purge Visitors API helps teams comply with end-user bulk data deletion requests mandated by laws like GDPR and CCPA. This endpoint will delete users and all related user data identified by a set of emails, visitor IDs, or user IDs. Purge requests default to being processed 10 days after submission, however this delay can be configured via the delaySeconds parameter. The endpoint is limited to 100 visitor deletions per request. One of email, userId, or visitorId parameter is required to identify the user for data deletion.



## OpenAPI

````yaml reference/sprig-api.json POST /v2/purge/visitors
openapi: 3.1.0
info:
  contact:
    email: support@sprig.com
    name: Support
  description: >-
    Sprig is a continuous product research tool that helps you automatically
    capture the user insights you need to consistently improve your product,
    user experience, marketing, and more.


    While traditional studies are slow, difficult to target, and lack context,
    Sprig studies are delivered automatically to specific users at specific
    moments throughout the customer journey — all within the product experience.


    This API provides tools to manage users and studies. User management is used
    if you are segmenting your samples between visitors that will be tracked
    with an ID and unregistered visitors. Study export tools will allow you to
    take results data and send it to another data store or format results for
    presentation in other applications
  title: Sprig API
  version: 2.2.1
servers:
  - url: https://api.sprig.com
security: []
tags:
  - description: Operations allowing export of survey data
    name: V1
  - description: Operations allowing export of survey data
    name: V1
  - description: All operations pertaining to the user object
    name: users
  - description: All operations pertaining to the user events
    name: events
  - description: Operations allowing export of survey data
    name: V1
paths:
  /v2/purge/visitors:
    post:
      tags:
        - V2
      summary: Purge Visitors
      description: >-
        The Purge Visitors API helps teams comply with end-user bulk data
        deletion requests mandated by laws like GDPR and CCPA. This endpoint
        will delete users and all related user data identified by a set of
        emails, visitor IDs, or user IDs.


        Purge requests default to being processed 10 days after submission,
        however this delay can be configured via the delaySeconds parameter. The
        endpoint is limited to 100 visitor deletions per request.


        One of email, userId, or visitorId parameter is required to identify the
        user for data deletion.
      operationId: post-v2-purge-visitors
      parameters:
        - description: Bearer YOUR_API_KEY
          in: header
          name: Authorization
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            examples:
              example-1:
                value:
                  delaySeconds: 86400
                  emails:
                    - freddy@sprig.com
                    - gustavo@sprig.com
                  userIds:
                    - '123456789'
                  visitorIds:
                    - 8cd04391-fc36-4e9d-a9ac-bc77cd507ee0
            schema:
              properties:
                delaySeconds:
                  description: >-
                    Seconds to wait before starting visitor data purging. This
                    can be used as a safety measure in case the request needs to
                    be canceled.
                  type: integer
                emails:
                  description: List of emails for which visitor data will be purged.
                  items:
                    type: string
                  type: array
                userIds:
                  description: >-
                    List of user IDs (external user IDs) for which visitor data
                    will be purged.
                  items:
                    type: string
                  type: array
                visitorIds:
                  description: List of visitor IDs for which visitor data will be purged.
                  items:
                    type: string
                  type: array
              type: object
        description: >-
          At least one of “emails”, “visitorIds” or “userIds” needs to be
          non-empty in the request body. Only visitors that exist in the
          environment for which the API key is in the authorization header can
          be purged.
      responses:
        '200':
          content:
            application/json:
              examples:
                Successful Response:
                  value:
                    requestId: “b9570865-0840-497d-9016-8b66575c9683”
              schema:
                properties:
                  requestId:
                    type: string
                type: object
          description: OK
        '400':
          $ref: '#/components/responses/400'
        '403':
          $ref: '#/components/responses/403'
        '404':
          $ref: '#/components/responses/404'
        '429':
          $ref: '#/components/responses/429'
        '500':
          $ref: '#/components/responses/500'
components:
  responses:
    '400':
      content:
        application/json:
          schema:
            properties:
              error:
                type: string
      description: Bad Request
    '403':
      description: >-
        You may have an invalid or missing API key and you should check your
        authorization header. There is no message with this status code.
    '404':
      description: Not Found
    '429':
      description: Your application has made too many requests in too short a time.
    '500':
      description: Something went wrong on Sprig's side. These are very rare :)

````