# Update a file by externalId

> You're reading the Mindset v3 documentation. v3 is no longer sold; this is reference for existing customers. Mindset 4 docs are at /docs.

Mindset v3 REST API reference: Context Files.

**PATCH** `/api/v1/appuid/{appUid}/contexts/{contextUid}/files/externalId/{externalId}`

## Base URL

Requests go to your region's API host, for example `https://a.api.mindset.ai`. Hosts: `https://a.api.mindset.ai`, `https://b.api.mindset.ai`, `https://c.api.mindset.ai`, `https://d.api.mindset.ai`.

## Authorization

- `x-api-key` (string, required, header)

  Your API key.

## Path parameters

- `appUid` (string, required, path)

  Your application's uid

* `contextUid` (string, required, path)

  Your context's uid

- `externalId` (string, required, path)

  Unique externalId of the file

## Request body

Content type: `application/json`.

- `name` (string, body)

  Name of the file

* `hideContentSegments` (boolean, body)

  Allows the agent to refer to knowledge ingested from this document without ever revealing the source doc

- `knownAs` (string, body)

  How the agent can refer to this file. eg 'video', 'discussion', 'sales pitch'

* `externalUrl` (string, body)

  An external URL to direct an end user to the file for this document

- `viewOriginalSource` (boolean, body)

  Instruct agent UI to launch the externalUrl provided

* `labels` (string\[], body)

  Array of label uids (max 10)

- `thumbnailUrl` (string, body)

  An external URL for a custom thumbnail for this file. It must point to an image of less than 3MB

* `thumbnail` (string, body)

  A base64 encoded image to use as a thumbnail for this file.

```json
{
  "name": "string",
  "hideContentSegments": true,
  "knownAs": "string",
  "externalUrl": "string",
  "viewOriginalSource": true,
  "labels": [
    "string"
  ],
  "thumbnailUrl": "string",
  "thumbnail": "string"
}
```

## Responses

### 200

Successful update

```json
{
  "uid": "string",
  "externalId": "string",
  "createdAt": "string",
  "name": "string",
  "status": "string",
  "statusMessage": "string",
  "runId": "string",
  "mimeType": "string",
  "autoPublish": true,
  "hideContentSegments": true,
  "labels": [
    "string"
  ],
  "contentHash": "string",
  "knownAs": "string",
  "externalUrl": "string",
  "viewOriginalSource": true,
  "thumbnailUpdatedByAdmin": true
}
```

### 404

Context or File not found

### 422

Unprocessable Entity

## Example request

```bash
curl -X PATCH "https://a.api.mindset.ai/api/v1/appuid/{appUid}/contexts/{contextUid}/files/externalId/{externalId}" \
  -H "x-api-key: <your-api-key>" \
  -H "Content-Type: application/json" \
  -d '{"name":"string","hideContentSegments":true,"knownAs":"string","externalUrl":"string","viewOriginalSource":true,"labels":["string"],"thumbnailUrl":"string","thumbnail":"string"}'
```
