# Search Privacy Requests

Searches privacy requests for information, correction or erasure, newest first and paginated. Returns status and due date (one month after the request). Answering or erasing happens in the linked app; opening a link answers nothing.

## Input schema:

```json
{
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "description": "pending, processed or all; default all",
      "default": "all",
      "enum": [
        "all",
        "pending",
        "processed"
      ]
    },
    "type": {
      "type": "string",
      "description": "information, update, delete or all; default all",
      "default": "all",
      "enum": [
        "all",
        "information",
        "update",
        "delete"
      ]
    },
    "archived": {
      "type": "boolean",
      "description": "true for the archived requests instead of the current ones",
      "default": false
    },
    "query": {
      "type": [
        "null",
        "string"
      ],
      "description": "Fragment of the requester's email address, first or last name",
      "default": null,
      "maxLength": 250
    },
    "cursor": {
      "type": [
        "null",
        "string"
      ],
      "description": "Opaque nextCursor value of the previous result page; omit for the first page",
      "default": null,
      "maxLength": 500
    },
    "pageSize": {
      "type": "integer",
      "description": "Maximum requests on the page, from 1 through 100",
      "default": 25,
      "minimum": 1,
      "maximum": 100
    },
    "accountId": {
      "type": [
        "null",
        "integer"
      ],
      "description": "User ID of the account; omit for the account the access token works in",
      "default": null,
      "minimum": 1
    }
  },
  "additionalProperties": false
}
```

## Output schema:

```json
{
  "type": "object",
  "required": [
    "accountId",
    "count",
    "hasNextPage",
    "nextCursor",
    "privacyRequests",
    "dashboardUrl"
  ],
  "properties": {
    "accountId": {
      "type": "integer"
    },
    "count": {
      "type": "integer"
    },
    "hasNextPage": {
      "type": "boolean"
    },
    "nextCursor": {
      "type": [
        "string",
        "null"
      ]
    },
    "privacyRequests": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "privacyRequestId",
          "type",
          "status",
          "contactId",
          "email",
          "firstName",
          "lastName",
          "requestedAt",
          "deadline",
          "processedAt",
          "archived",
          "requestedFieldIds",
          "contactHistoryUrl"
        ],
        "properties": {
          "privacyRequestId": {
            "type": "integer"
          },
          "type": {
            "type": "string",
            "enum": [
              "information",
              "update",
              "delete"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "processed"
            ]
          },
          "contactId": {
            "type": "integer"
          },
          "email": {
            "type": "string"
          },
          "firstName": {
            "type": "string"
          },
          "lastName": {
            "type": "string"
          },
          "requestedAt": {
            "type": "string"
          },
          "deadline": {
            "type": "string"
          },
          "processedAt": {
            "type": [
              "string",
              "null"
            ]
          },
          "archived": {
            "type": "boolean"
          },
          "requestedFieldIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "contactHistoryUrl": {
            "type": "string"
          }
        }
      }
    },
    "dashboardUrl": {
      "type": "string"
    }
  }
}
```

