# Finalize an attachment after upload completes (/docs/api-reference/products/ProductAttachmentsController_finalize)

`POST /api/factories/{factoryId}/products/{productId}/attachments`

Base URL: https://api.xentr.ai

Authentication: bearer token (`Authorization: Bearer <token>`).

## Parameters

| Name | In | Required | Type | Description |
| --- | --- | --- | --- | --- |
| `factoryId` | path | yes | string |  |
| `productId` | path | yes | string |  |

## Request body

Required.

Content type: `application/json`

```json
{
  "type": "object",
  "properties": {
    "storagePath": {
      "type": "string",
      "description": "Storage path returned by upload-url endpoint"
    },
    "fileName": {
      "type": "string",
      "description": "Original file name"
    },
    "mimeType": {
      "type": "string",
      "description": "MIME type"
    },
    "sizeBytes": {
      "type": "number",
      "description": "File size in bytes"
    },
    "kind": {
      "type": "string",
      "description": "Attachment kind",
      "enum": [
        "drawing",
        "spec",
        "photo",
        "file"
      ],
      "default": "file"
    }
  },
  "required": [
    "storagePath",
    "fileName"
  ]
}
```

## Responses

### 201: Attachment record created