Skip to main content

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.

ParamValueType
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

NameTypeDescription
namestringThe name of the document.
documentIdstringThe unique ID of the document.
modelIdstringThe ID of the entity (e.g., product or seller) the document is associated with.
modelTypestringThe type of the associated entity (e.g., "PRODUCT").
uploadedBystringThe user role that uploaded the document (e.g., "SELLER").
applyActiveVersionHistorybooleanIndicates if version history should be maintained for this document.
docsarrayA list of document details.
docs[].namestringThe name of the document file.
docs[].linkstringA URL link to the uploaded document.
countryCodestringThe country code of the document uploader.
userIdstringThe ID of the user uploading the document.
tenantIdstringThe 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

AUTHORIZATION

Bearer

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!