# updateUploadGrants

```graphql
mutation UpdateUploadGrants($input: UpdateUploadGrantsInput!) {
  updateUploadGrants(input: $input) {
    data {
      userId
      permission
      createdAt
    }
    resolvedPath
    resolvedType
    resolvedId
  }
}
```

Replace the complete list of user grants on an upload or folder; an empty list revokes every grant. Requires project.uploads.admin.

## Arguments

| Name                     | Type                      | Required | Description                                                                                                               |
| ------------------------ | ------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------- |
| `input`                  | UpdateUploadGrantsInput!  | Yes      |                                                                                                                           |
| `input.projectReference` | String!                   | Yes      | Project UUID, slug or configured domain.                                                                                  |
| `input.uploadPath`       | String!                   | Yes      | Upload UUID for grants on that upload, or an upload path or folder prefix resolved to the folder setting that governs it. |
| `input.grants`           | \[UploadPathGrantInput!]! | Yes      | The complete replacement list. An empty list revokes every grant.                                                         |

## Variables

```json
{
  "input": {
    "projectReference": "string",
    "uploadPath": "string",
    "grants": [
      {
        "userId": "string"
      }
    ]
  }
}
```

## Responses

| Status | Description                                       |
| ------ | ------------------------------------------------- |
| 200    | The UploadPathGrants! in data.updateUploadGrants. |

## 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 UpdateUploadGrants($input: UpdateUploadGrantsInput!) {\n  updateUploadGrants(input: $input) {\n    data {\n      userId\n      permission\n      createdAt\n    }\n    resolvedPath\n    resolvedType\n    resolvedId\n  }\n}",
  "variables": {
    "input": {
      "projectReference": "string",
      "uploadPath": "string",
      "grants": [
        {
          "userId": "string"
        }
      ]
    }
  }
}'
```

## Example response

```json
{
  "data": {
    "updateUploadGrants": {
      "data": [
        {
          "userId": "string",
          "permission": "read",
          "createdAt": "string"
        }
      ],
      "resolvedPath": "string",
      "resolvedType": "upload",
      "resolvedId": "string"
    }
  }
}
```
