# Update attachment by ID

> For the complete documentation index, see [llms.txt](https://developer.fluxir.com/llms.txt).

**PATCH** `/api/app/attachments/{id}`

Replaces the file content of an existing attachment.

## Authorization

- oidc (openIdConnect)

## Header parameters

- `X-Tenant` (string)
  Tenant ID

## Path parameters

- `id` (integer, required)
  The attachment identifier.

## Body

Content type: `multipart/form-data`

- `file` (string<binary>)
  The new file to upload.

Example:

```json
{
  "file": "string"
}
```

## Responses

### 200

OK

- `id` (integer<int64>)
- `documentFileId` (integer<int64>)
- `fileName` (string)
- `ownerId` (integer<int64>)
- `attachmentTypeNameId` (string)
- `ownerType` ("ServiceApplication" | "Person" | "Visa" | "InsurancePolicy" | "IdentityDocument" | "DocumentItem")
- `visa` (object)
  - `id` (integer<int64>)
  - `personId` (integer<int64>)
  - `visaApplicationId` (integer<int64>)
  - `visaTypeName` (string)
  - `countryCode` (string)
  - `isReadonly` (boolean)
  - `validFrom` (string<date>)
  - `validTo` (string<date>)
  - `hasDownloadableContent` (boolean)
  - `visaNo` (string)
  - `serialNumber` (string)
  - `numOfEntries` ("Single" | "Multi" | "Double")
  - `relatedVisaTypeId` (integer<int64>)
- `visaId` (integer<int64>)

Example:

```json
{
  "id": 0,
  "documentFileId": 0,
  "fileName": "string",
  "ownerId": 0,
  "attachmentTypeNameId": "string",
  "ownerType": "ServiceApplication",
  "visa": {
    "id": 0,
    "personId": 0,
    "visaApplicationId": 0,
    "visaTypeName": "string",
    "countryCode": "string",
    "isReadonly": true,
    "validFrom": "2024-01-01",
    "validTo": "2024-01-01",
    "hasDownloadableContent": true,
    "visaNo": "string",
    "serialNumber": "string",
    "numOfEntries": "Single",
    "relatedVisaTypeId": 0
  },
  "visaId": 0
}
```

### 400

Bad Request

- `error` (object)
  - `code` (string)
  - `message` (string)
  - `details` (string)
  - `data` (object)
  - `validationErrors` (object[])
    - `message` (string)
    - `members` (string[])

Example:

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "details": "string",
    "data": {},
    "validationErrors": [
      {
        "message": "string",
        "members": [
          "string"
        ]
      }
    ]
  }
}
```

### 401

Unauthorized

- `error` (object)
  - `code` (string)
  - `message` (string)
  - `details` (string)
  - `data` (object)
  - `validationErrors` (object[])
    - `message` (string)
    - `members` (string[])

Example:

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "details": "string",
    "data": {},
    "validationErrors": [
      {
        "message": "string",
        "members": [
          "string"
        ]
      }
    ]
  }
}
```

### 403

Forbidden

- `error` (object)
  - `code` (string)
  - `message` (string)
  - `details` (string)
  - `data` (object)
  - `validationErrors` (object[])
    - `message` (string)
    - `members` (string[])

Example:

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "details": "string",
    "data": {},
    "validationErrors": [
      {
        "message": "string",
        "members": [
          "string"
        ]
      }
    ]
  }
}
```

### 404

Not Found

- `error` (object)
  - `code` (string)
  - `message` (string)
  - `details` (string)
  - `data` (object)
  - `validationErrors` (object[])
    - `message` (string)
    - `members` (string[])

Example:

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "details": "string",
    "data": {},
    "validationErrors": [
      {
        "message": "string",
        "members": [
          "string"
        ]
      }
    ]
  }
}
```

### 500

Internal Server Error

- `error` (object)
  - `code` (string)
  - `message` (string)
  - `details` (string)
  - `data` (object)
  - `validationErrors` (object[])
    - `message` (string)
    - `members` (string[])

Example:

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "details": "string",
    "data": {},
    "validationErrors": [
      {
        "message": "string",
        "members": [
          "string"
        ]
      }
    ]
  }
}
```

### 501

Not Implemented

- `error` (object)
  - `code` (string)
  - `message` (string)
  - `details` (string)
  - `data` (object)
  - `validationErrors` (object[])
    - `message` (string)
    - `members` (string[])

Example:

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "details": "string",
    "data": {},
    "validationErrors": [
      {
        "message": "string",
        "members": [
          "string"
        ]
      }
    ]
  }
}
```