---
updatedAt: 2026-03-30T09:15:46.000Z
---

# Submit a stub batch of OpenDSR requests

Same contract as the production batch endpoint but processed in stub mode for integration testing.

# OpenAPI definition

```json
{
  "openapi": "3.0.1",
  "info": {
    "title": "OpenDSR API",
    "version": "1.0",
    "description": "AppsFlyer OpenDSR Requests API\n\nUse the OpenDSR Requests API as described in this section to implement DSR compliance. \n\n- **OpenDSR Request**: Perform one of the above request types: access, portability, erasure, rectification.\n- **Status Request**: Query the current status of an OpenDSR request.\n- **Discovery Request**: Inquire as to the supported API version and Data Format.\n- **Cancellation**: Cancel an OpenDSR request during its pending phase\n"
  },
  "servers": [
    {
      "url": "https://hq1.appsflyer.com/",
      "description": "Production server"
    }
  ],
  "security": [
    {
      "BearerAuth": []
    }
  ],
  "paths": {
    "/api/gdpr/v1/stub/batch": {
      "post": {
        "tags": [
          "Stub & Testing"
        ],
        "summary": "Submit a stub batch of OpenDSR requests",
        "operationId": "create-stub-batch-opendsr-requests",
        "description": "Same contract as the production batch endpoint but processed in stub mode for integration testing.",
        "requestBody": {
          "description": "Batch request payload for stub processing is an array of OpenDSR request payloads, all shared parameters in the request object will be overridden by the parameters in the meta object. All requests in the batch must belong to the same property ID.\n",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BatchRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Batch submission result (batch_id, encoded_request, responses, errors), encoded_request will be provided only in the root of the response body, not in the responses array.\n",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateBatchResponse"
                }
              }
            }
          },
          "400": {
            "description": "Validation or authorization failure",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIErrorData"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/APIErrorData"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "For API authorization, use the same V2 API token as for Pull API. \nAn admin user can retrieve the token from the API token page in the dashboard.\nAdd the token into the request header as follows: `Authorization: Bearer <V2_API_Token>`\n"
      }
    },
    "schemas": {
      "APIErrorData": {
        "type": "object",
        "properties": {
          "code": {
            "type": "integer",
            "description": "HTTP status code",
            "example": 400
          },
          "message": {
            "type": "string",
            "description": "Human-readable error message",
            "example": "Invalid subject_request_id"
          },
          "af_gdpr_code": {
            "type": "string",
            "description": "AppsFlyer-specific error code for detailed error identification.\n\n**Request State Errors (e2xx)**\n- `e211`: Unable to cancel request with invalid status\n- `e212`: Request not permitted\n- `e213`: Request already exists\n- `e214`: Request not found\n- `e215`: One or more subject-identities already exist in an open request\n\n**Validation Errors (e3xx)**\n- `e311`: Invalid request content type\n- `e312`: Invalid API version\n- `e313`: Invalid subject_request_id\n- `e314`: Invalid submitted_time format\n- `e315`: Invalid status_callback_url length\n- `e316`: Invalid status_callback_url format\n- `e317`: Invalid app_id format\n- `e318`: Invalid identity_type\n- `e319`: Application platform does not match identity types\n- `e321`: LAT users are not supported via API\n- `e322`: Invalid subject_request_type\n- `e323`: Invalid subject_identities format\n- `e324`: Invalid subject_identities length\n- `e325`: Invalid subject_identities value\n- `e326`: Invalid JSON format in request body\n\n**Authorization Errors (e4xx)**\n- `e411`: AppID is incorrect or does not belong to your account\n- `e412`: No permissions to cancel erasure request\n- `e413`: No permissions to view request\n- `e414`: Too many requests in batch\n- `e415`: Duplicated subject_request_id in batch\n- `e416`: Duplicated subject_identity in batch\n- `e417`: PropertyID in request is not the same as in batch\n\n**Server Errors (e5xx)**\n- `e511`: Internal problem. Wait 60 mins and try again\n",
            "enum": [
              "e211",
              "e212",
              "e213",
              "e214",
              "e215",
              "e311",
              "e312",
              "e313",
              "e314",
              "e315",
              "e316",
              "e317",
              "e318",
              "e319",
              "e321",
              "e322",
              "e323",
              "e324",
              "e325",
              "e326",
              "e411",
              "e412",
              "e413",
              "e414",
              "e415",
              "e416",
              "e417",
              "e511"
            ],
            "example": "e313"
          }
        }
      },
      "Request": {
        "type": "object",
        "properties": {
          "subject_request_id": {
            "type": "string",
            "description": "External Fields"
          },
          "subject_request_type": {
            "type": "string",
            "description": "SubjectRequestType is the type of the request",
            "enum": [
              "access",
              "portability",
              "rectification",
              "erasure"
            ],
            "example": "access"
          },
          "submitted_time": {
            "type": "string",
            "description": "SubmittedTime is the time when the request is submitted"
          },
          "api_version": {
            "type": "string",
            "description": "APIVersion is the version of the API"
          },
          "subject_identities": {
            "type": "array",
            "description": "SubjectIdentities is the list of subject identities.",
            "items": {
              "$ref": "#/components/schemas/SubjectIdentity"
            }
          },
          "status_callback_urls": {
            "type": "array",
            "description": "StatusCallbackURLs is the callback URLs to notify when the request is completed",
            "items": {
              "type": "string"
            }
          },
          "property_id": {
            "type": "string",
            "description": "PropertyID is the AppID"
          },
          "platform": {
            "type": "string",
            "description": "Platform is the platform of the app"
          },
          "requester": {
            "type": "string",
            "description": "Requester is the email of the requester"
          }
        }
      },
      "SubjectIdentity": {
        "type": "object",
        "properties": {
          "identity_type": {
            "type": "string",
            "description": "Type of identity used to identify the data subject.\n\n**For Android, iOS, Web, WindowsPhone platforms:**\n- `ios_advertising_id`\n- `android_advertising_id`\n- `fire_advertising_id`\n- `microsoft_advertising_id`\n- `appsflyer_id`\n- `customer_user_id` (CUID)\n- `idfv`\n\n**For CTV, PC, and Console platforms:**\n- `appsflyer_id`\n- `customer_user_id` (CUID)\n\n> **Important!**\n>\n> To use CUID through the OpenDSR API, you must send the CUID with idfa/appsflyer_id inside in-app events using `event_name: Login - Complete` or `Registration - Account created`\n",
            "enum": [
              "ios_advertising_id",
              "android_advertising_id",
              "fire_advertising_id",
              "microsoft_advertising_id",
              "appsflyer_id",
              "customer_user_id",
              "idfv"
            ],
            "example": "android_advertising_id"
          },
          "identity_value": {
            "type": "string",
            "description": "Value of the identifier used to identify the data subject"
          },
          "identity_format": {
            "type": "string",
            "enum": [
              "raw"
            ]
          }
        }
      },
      "BatchRequest": {
        "type": "object",
        "properties": {
          "meta": {
            "$ref": "#/components/schemas/Meta"
          },
          "requests": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Request"
            }
          }
        }
      },
      "CreateBatchResponse": {
        "type": "object",
        "properties": {
          "batch_id": {
            "type": "string"
          },
          "encoded_request": {
            "type": "string"
          },
          "responses": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CreateResponse"
            }
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "CreateResponse": {
        "type": "object",
        "properties": {
          "subject_request_id": {
            "type": "string"
          },
          "original_request_id": {
            "type": "string"
          },
          "expected_completion_time": {
            "type": "string"
          },
          "received_time": {
            "type": "string"
          },
          "encoded_request": {
            "type": "string"
          },
          "info": {
            "type": "string"
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "subject_request_id": {
            "type": "string"
          },
          "error": {
            "$ref": "#/components/schemas/APIErrorData"
          }
        }
      },
      "Meta": {
        "type": "object",
        "properties": {
          "api_version": {
            "type": "string"
          },
          "property_id": {
            "type": "string"
          },
          "platform": {
            "type": "string",
            "description": "Platform is the platform of the app"
          },
          "status_callback_urls": {
            "type": "array",
            "description": "StatusCallbackURLs is the callback URLs to notify when the request is completed",
            "items": {
              "type": "string"
            }
          },
          "submitted_time": {
            "type": "string"
          }
        }
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  }
}
```