# updateUploadGrant

```graphql
mutation UpdateUploadGrant($input: UpdateUploadGrantInput!) {
  updateUploadGrant(input: $input) {
    userId
    permission
    createdAt
  }
}
```

Grant one user read, write or admin access to an upload or folder, or change that grant, and leave the other grants unchanged. Requires project.uploads.admin.

## Arguments

| Name                     | Type                      | Required | Description                                                                                                               |
| ------------------------ | ------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------- |
| `input`                  | UpdateUploadGrantInput!   | 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.userId`           | ID!                       | Yes      | UUID of the user the grant is for.                                                                                        |
| `input.permission`       | UploadPathGrantPermission |          | Access to give: read (default), write or admin. Default `read`. One of `read`, `write`, `admin`.                          |

## Variables

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

## Responses

| Status | Description                                 |
| ------ | ------------------------------------------- |
| 200    | The UploadGrant! in data.updateUploadGrant. |

## 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 UpdateUploadGrant($input: UpdateUploadGrantInput!) {\n  updateUploadGrant(input: $input) {\n    userId\n    permission\n    createdAt\n  }\n}",
  "variables": {
    "input": {
      "projectReference": "string",
      "uploadPath": "string",
      "userId": "string"
    }
  }
}'
```

## Example response

```json
{
  "data": {
    "updateUploadGrant": {
      "userId": "string",
      "permission": "read",
      "createdAt": "string"
    }
  }
}
```
