---
agentTools:
  projectIndex: https://sendios.readme.io/llms.txt
---

# Erase user

АРІ-точка для додавання користувача до черги на видалення. Як наслідок, користувач буде видалений через 2 доби. Це окремий функціонал для відповідності GDPR-нормам.

> 🚧 Такий запит не тільки відписує користувача від електронних листів, а й повністю видаляє всю інформацію про нього у системі. Рекомендуємо використовувати цю точку лише у крайніх випадках.

> 📘 Якщо ви хочете просто відписати користувача від отримання електронних листів, скористайтеся АРІ точкою [Unsubscribe](https://sendios.readme.io/reference/unsubscribe).

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Sendios API V1",
    "version": "1"
  },
  "servers": [
    {
      "url": "https://api.sendios.io/"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "http",
        "scheme": "basic"
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/v1/user/erase": {
      "post": {
        "summary": "Erase user",
        "description": "АРІ-точка для додавання користувача до черги на видалення. Як наслідок, користувач буде видалений через 2 доби. Це окремий функціонал для відповідності GDPR-нормам.",
        "operationId": "erase-user",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "email",
                  "project_id"
                ],
                "properties": {
                  "email": {
                    "type": "string",
                    "description": "Електронна адреса користувача;",
                    "default": "test@example.com"
                  },
                  "project_id": {
                    "type": "string",
                    "description": "Ідентифікатор Проєкту."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "OK": {
                    "value": "{\n    \"_meta\": {\n        \"status\": \"SUCCESS\",\n        \"time\": 33,\n        \"count\": 1\n    },\n    \"data\": {\n        \"deleted\": true\n    }\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "_meta": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "example": "SUCCESS"
                        },
                        "time": {
                          "type": "integer",
                          "example": 33,
                          "default": 0
                        },
                        "count": {
                          "type": "integer",
                          "example": 1,
                          "default": 0
                        }
                      }
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "deleted": {
                          "type": "boolean",
                          "example": true,
                          "default": true
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "User in queue to erase": {
                    "value": "{\n    \"_meta\": {\n        \"status\": \"ERROR\",\n        \"time\": 68,\n        \"count\": 1\n    },\n    \"data\": {\n        \"error\": \"User with email \\\"test@example.com\\\" in queue to erase.\"\n    }\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "_meta": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "example": "ERROR"
                        },
                        "time": {
                          "type": "integer",
                          "example": 68,
                          "default": 0
                        },
                        "count": {
                          "type": "integer",
                          "example": 1,
                          "default": 0
                        }
                      }
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "string",
                          "example": "User with email \"test@example.com\" in queue to erase."
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "404",
            "content": {
              "application/json": {
                "examples": {
                  "User not found": {
                    "value": "{\n    \"_meta\": {\n        \"status\": \"ERROR\",\n        \"time\": 18,\n        \"count\": 1\n    },\n    \"data\": {\n        \"error\": \"User not found with email \\\"test@example.com\\\".\"\n    }\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "_meta": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "example": "ERROR"
                        },
                        "time": {
                          "type": "integer",
                          "example": 18,
                          "default": 0
                        },
                        "count": {
                          "type": "integer",
                          "example": 1,
                          "default": 0
                        }
                      }
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "error": {
                          "type": "string",
                          "example": "User not found with email \"test@example.com\"."
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": false,
        "x-readme": {
          "code-samples": [
            {
              "language": "curl",
              "code": "curl -X POST https://api.sendios.io/v1/user/erase \\\n    -u 123:957081746b54977d51bef9fc74f4d4fd023bab13 \\\n    -d {\n    \t\"email\": \"test@example.com\",\n      \"project_id\": 123\n\t\t}"
            },
            {
              "language": "php",
              "code": "$email = 'test@example.com';\n$projectId = 1;\n$this->sendios->user->erase($email, $projectId);"
            }
          ],
          "samples-languages": [
            "curl",
            "php"
          ]
        }
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true,
  "_id": "62612e954e73ee00a2f415e3:63a42c66bfef32001d3d9622"
}
```