> ## Documentation Index
> Fetch the complete documentation index at: https://developers.argosidentity.com/llms.txt
> Use this file to discover all available pages before exploring further.

# PUT/Image

> This API allows you to add or update (overwrite) four types of images (ID front, ID back, selfie, address) for an existing submission.

<Warning>
  **Notes**

  * Allowed image formats: jpg, jpeg, png.
  * All images must be submitted as Base64 encoded strings.
  * The `idType` parameter is required when submitting `idImage` or `idBackImage`.
  * At least one image must be submitted.
</Warning>

## 1. Endpoint

```text PUT/Image theme={null}
PUT https://rest-api.argosidentity.com/v3/submission/image
```

## 2. Authentication and headers

This API requires the request body to be sent as `multipart/form-data`.

| Header         | Value                 | Required |
| -------------- | --------------------- | -------- |
| `x-api-key`    | Your API key          | Required |
| `Content-Type` | `multipart/form-data` | Required |

<Note>
  When using `curl`'s `--form` option or Python `requests` library's `files` parameter, the `Content-Type: multipart/form-data` header and boundary value are set automatically. Setting the header manually may omit the boundary value and cause the request to fail.
</Note>

## 3. Request parameters

All parameters are sent as `multipart/form-data` fields.

<ParamField body="submissionId" type="string" required>
  Unique ID of the submission
</ParamField>

<ParamField body="admin" type="string" required>
  Project administrator's account (must be registered in the dashboard)
</ParamField>

<ParamField body="idType" type="string">
  Type of ID document. Required when submitting `idImage` or `idBackImage`.
</ParamField>

<ParamField body="idImage" type="string">
  Front side of the ID document, Base64 encoded
</ParamField>

<ParamField body="idBackImage" type="string">
  Back side of the ID document, Base64 encoded
</ParamField>

<ParamField body="selfieImage" type="string">
  Selfie image, Base64 encoded
</ParamField>

<ParamField body="addressImage" type="string">
  Address document image, Base64 encoded
</ParamField>

## 4. Request example

<CodeGroup>
  ```bash cURL theme={null}
  curl --location --request PUT 'https://rest-api.argosidentity.com/v3/submission/image' \
  --header 'x-api-key: {yourAPIKey}' \
  --form 'submissionId="sampleSubmissionId11"' \
  --form 'admin="sample@argosidentity.com"' \
  --form 'idType="drivers_license"' \
  --form 'idImage={base64String}' \
  --form 'idBackImage={base64String}' \
  --form 'selfieImage={base64String}' \
  --form 'addressImage={base64String}'
  ```

  ```python Python theme={null}
  import base64
  import requests
  from pathlib import Path

  API_URL = "https://rest-api.argosidentity.com/v3/submission/image"
  API_KEY = "your-api-key"

  image_path = Path("drvlic.jpeg")
  id_image_b64 = base64.b64encode(image_path.read_bytes()).decode()

  resp = requests.put(
      API_URL,
      headers={"x-api-key": API_KEY},
      files={
          "submissionId": (None, "sampleSubmissionId11"),
          "admin": (None, "sample@argosidentity.com"),
          "idType": (None, "drivers_license"),
          "idImage": (None, id_image_b64),
      },
  )

  print(resp.status_code, resp.json())
  ```
</CodeGroup>

<Note>
  When using the Python `requests` library's `files` parameter, pass text fields as `(None, "value")` tuples. The first element `None` indicates no filename, which correctly sends text data as multipart/form-data fields.
</Note>

## 5. Response

### 5-1. Success response

```json result.json theme={null}
{
   "message": "complete to update image."
}
```

### 5-2. Response data

| Field     | Description     | Type   |
| --------- | --------------- | ------ |
| `message` | Success message | String |

### 5-3. Error response

```json result.json theme={null}
{
    "errorCode": "invalid_payload",
    "message": "Fail to parse the input data."
}
```

### 5-4. Error codes

| Error Code           | Message                                                    | Description                                          |
| -------------------- | ---------------------------------------------------------- | ---------------------------------------------------- |
| `invalid_payload`    | Fail to parse the input data.                              | The format of the input data is invalid.             |
| `missing_data`       | Required input data is missing.                            | Some required fields are missing.                    |
| `invalid_project`    | Cannot find project info.                                  | The project ID does not exist.                       |
| `invalid_project`    | Invalid project.                                           | The project status is invalid.                       |
| `invalid_admin`      | Invalid admin.                                             | The administrator is invalid.                        |
| `invalid_submission` | Invalid submission.                                        | The submission ID is invalid.                        |
| `invalid_data`       | At least one image parameter is required.                  | No image was submitted.                              |
| `missing_data`       | The idType is required when submit idImage or idBackImage. | The `idType` is missing when submitting an ID image. |
| `invalid_idType`     | Invalid IdType.                                            | The `idType` provided is invalid.                    |
| `processing_error`   | Failed to put image.                                       | An unknown error occurred during processing.         |
