# updateExternalFile

```graphql
mutation UpdateExternalFile($input: ExternalStorageUpdateInput!) {
  updateExternalFile(input: $input) {
    id
    provider
    name
    path
    mimeType
    sizeBytes
    kind
    parentId
    modifiedAt
    etag
    thumbnailUrl
    webUrl
  }
}
```

Update external file. Requires project.integrations.connect.

## Arguments

| Name                     | Type                        | Required | Description                                                                                                                                                  |
| ------------------------ | --------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `input`                  | ExternalStorageUpdateInput! | Yes      |                                                                                                                                                              |
| `input.provider`         | String!                     | Yes      | Storage provider accessed through the caller's own personal connection. A human caller is required; agent, run, and service-account credentials are refused. |
| `input.projectReference` | String                      |          | Project ID or slug. Requires project.integrations.connect through the caller's own personal provider connection.                                             |
| `input.fileId`           | String!                     | Yes      |                                                                                                                                                              |
| `input.content`          | String!                     | Yes      |                                                                                                                                                              |
| `input.contentEncoding`  | ExternalFileContentEncoding |          | Content encoding; base64 when omitted. One of `utf8`, `base64`.                                                                                              |
| `input.ifMatch`          | String                      |          | Refuse the write unless the file's etag still matches.                                                                                                       |

## Variables

```json
{
  "input": {
    "provider": "string",
    "fileId": "string",
    "content": "string"
  }
}
```

## Responses

| Status | Description                                          |
| ------ | ---------------------------------------------------- |
| 200    | The ExternalStorageFile! in data.updateExternalFile. |

## 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 UpdateExternalFile($input: ExternalStorageUpdateInput!) {\n  updateExternalFile(input: $input) {\n    id\n    provider\n    name\n    path\n    mimeType\n    sizeBytes\n    kind\n    parentId\n    modifiedAt\n    etag\n    thumbnailUrl\n    webUrl\n  }\n}",
  "variables": {
    "input": {
      "provider": "string",
      "fileId": "string",
      "content": "string"
    }
  }
}'
```

## Example response

```json
{
  "data": {
    "updateExternalFile": {
      "id": "string",
      "provider": "string",
      "name": "string",
      "path": "string",
      "mimeType": "string",
      "sizeBytes": 0,
      "kind": "string",
      "parentId": "string",
      "modifiedAt": "string",
      "etag": "string",
      "thumbnailUrl": "https://example.com",
      "webUrl": "https://example.com"
    }
  }
}
```
