Upload Documents
Method: POST
/api/v1/documents
Description
This endpoint allows users to upload documents associated with a specific entity, such as products or sellers. Users can provide metadata about the document, including document name, model type, and upload details.
🔑 Authentication
This endpoint requires authentication via headers.
| Param | Value | Type |
|---|---|---|
tenantId | {{tenantId}} | string |
userId | {{userId}} | string |
countryCode | {{countryCode}} | string (optional) |
Request Body
{
"name": "string",
"documentId": "string",
"modelId": "string",
"modelType": "PRODUCT",
"uploadedBy": "SELLER",
"applyActiveVersionHistory": true,
"docs": [
{
"name": "string",
"link": "string"
}
],
"countryCode": "string",
"userId": "string",
"tenantId": "string"
}
Request Body Explanation
| Name | Type | Description |
|---|---|---|
name | string | The name of the document. |
documentId | string | The unique ID of the document. |
modelId | string | The ID of the entity (e.g., product or seller) the document is associated with. |
modelType | string | The type of the associated entity (e.g., "PRODUCT"). |
uploadedBy | string | The user role that uploaded the document (e.g., "SELLER"). |
applyActiveVersionHistory | boolean | Indicates if version history should be maintained for this document. |
docs | array | A list of document details. |
docs[].name | string | The name of the document file. |
docs[].link | string | A URL link to the uploaded document. |
countryCode | string | The country code of the document uploader. |
userId | string | The ID of the user uploading the document. |
tenantId | string | The tenant ID associated with the uploaded document. |
Response: 201
{
"message": "Document uploaded successfully.",
"documentId": "12345",
"name": "Sample Document",
"uploadedBy": "SELLER",
"modelId": "67890",
"modelType": "PRODUCT",
"docs": [
{
"name": "Product Manual",
"link": "https://example.com/document/manual.pdf"
}
]
}
LANGUAGE
CURL REQUEST
curl --request POST \
--url /api/v1/documents \
--header 'accept: application/json' \
--header 'content-type: application/json'
RESPONSE
Click Try It! to start a request and see the response here!