Update Document
Method: PATCH
/api/v1/documents/{documentId}
Descriptionβ
This endpoint updates an existing document. It allows modifying the documentβs name, associated files, uploader details, and related metadata.
π Authenticationβ
This endpoint requires authentication via headers.
| Param | Value | Type |
|---|---|---|
userId | {{userId}} | string |
tenantId | {{tenantId}} | string |
Path Parameterβ
| Name | Type | Description |
|---|---|---|
documentId | string | The unique ID of the document to update. |
Request Bodyβ
{
"name": "string",
"docs": [
{
"name": "string",
"link": "string"
}
],
"uploadedBy": "SELLER",
"countryCode": "string",
"userId": "string",
"tenantId": "string"
}
Request Body Explanationβ
| Name | Type | Description |
|---|---|---|
name | string | The updated name of the document. |
docs | array | List of associated files for the document. |
docs[].name | string | The name of the document file. |
docs[].link | string | A URL link to the document file. |
uploadedBy | string | The role of the uploader (e.g., "SELLER"). |
countryCode | string | The country code associated with the document. |
userId | string | The ID of the user making the update. |
tenantId | string | The ID of the tenant associated with the document. |
Response: 200β
{
"message": "Document updated successfully.",
"documentId": "12345",
"updatedDocument": {
"name": "Updated Document Name",
"docs": [
{
"name": "File1",
"link": "https://example.com/file1.pdf"
},
{
"name": "File2",
"link": "https://example.com/file2.pdf"
}
],
"uploadedBy": "SELLER",
"countryCode": "NG"
}
}
LANGUAGE
CURL REQUEST
curl --request PATCH \
--url /api/v1/documents/{documentId} \
--header 'accept: application/json' \
--header 'content-type: application/json'
RESPONSE
Click Try It! to start a request and see the response here!