# restoreUpload

```graphql
mutation RestoreUpload($input: RestoreUploadInput!) {
  restoreUpload(input: $input) {
    success
    file {
      id
      fileId
      key
      path
      name
      bucket
      url
      size
      contentType
      status
      createdAt
      updatedAt
      visibility
      permission
    }
    error
    id
    path
    fileName
    contentType
    sizeBytes
    url
    status
    visibility
    createdAt
    updatedAt
    deletedAt
  }
}
```

Restore a soft-deleted upload. Requires project.uploads.write.

## Arguments

| Name                     | Type                | Required | Description                                                                                                                                                                                                                                                                                      |
| ------------------------ | ------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `input`                  | RestoreUploadInput! | Yes      |                                                                                                                                                                                                                                                                                                  |
| `input.projectReference` | String              |          | Project UUID, slug or configured domain. Omission does not select the context project.                                                                                                                                                                                                           |
| `input.uploadReference`  | String              |          | Upload UUID selects that exact row; raw project-relative path selects an active row first, otherwise latest deletion then descending UUID. Active rows are rejected. No deletion-age cutoff is enforced; stored content availability is not checked. Requires upload write and path edit access. |
| `input.uploadId`         | String              |          | Another spelling of uploadReference. Send one of the two.                                                                                                                                                                                                                                        |

## Variables

```json
{
  "input": {}
}
```

## Responses

| Status | Description                                      |
| ------ | ------------------------------------------------ |
| 200    | The RestoreUploadPayload! in data.restoreUpload. |

## Call it

```bash
curl -X POST "https://api.veryfront.com/graphql" \
  -H "Authorization: Bearer $VERYFRONT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "query": "mutation RestoreUpload($input: RestoreUploadInput!) {\n  restoreUpload(input: $input) {\n    success\n    file {\n      id\n      fileId\n      key\n      path\n      name\n      bucket\n      url\n      size\n      contentType\n      status\n      createdAt\n      updatedAt\n      visibility\n      permission\n    }\n    error\n    id\n    path\n    fileName\n    contentType\n    sizeBytes\n    url\n    status\n    visibility\n    createdAt\n    updatedAt\n    deletedAt\n  }\n}",
  "variables": {
    "input": {}
  }
}'
```

## Example response

```json
{
  "data": {
    "restoreUpload": {
      "success": false,
      "file": {
        "id": "string",
        "fileId": "string",
        "key": "string",
        "path": "string",
        "name": "string",
        "bucket": "string",
        "url": "https://example.com",
        "size": 0,
        "contentType": "string",
        "status": "string",
        "createdAt": "string",
        "updatedAt": "string",
        "visibility": "string",
        "permission": "string"
      },
      "error": "string",
      "id": "string",
      "path": "string",
      "fileName": "string",
      "contentType": "string",
      "sizeBytes": 0,
      "url": "https://example.com",
      "status": "pending",
      "visibility": "project",
      "createdAt": "2026-01-01T00:00:00Z",
      "updatedAt": "2026-01-01T00:00:00Z",
      "deletedAt": "2026-01-01T00:00:00Z"
    }
  }
}
```
