Shared Templates API
The Shared Templates API enables companies and partners to share and view templates across different partnerships. This API facilitates sharing specific templates with partners and retrieving the shared templates for a user and allowing the partner to create Dpps based on this template.
Endpoints

1. View Shared Templates
GET /view-shared-templates/:userId
Description:
Fetches a list of templates shared with the user based on their partnership status.
Parameters:
Parameter | Type | Description |
---|---|---|
userId | string | The ID of the user to fetch shared templates for. |
Response:
Status | Description |
---|---|
200 OK | Successfully fetched shared templates. |
400 Bad Request | Missing or invalid userId . |
404 Not Found | No shared templates found for the user. |
500 Internal Server Error | An error occurred while processing the request. |
Response Object:
{
"success": true,
"message": "Shared templates fetched successfully.",
"templates": [
{
"id": "string",
"template_id": "string",
"partner_id": "string",
"company_id": "string",
"model_id": "string",
"company_name": "string",
"created_at": "string"
}
]
}


2. Share a Template
POST /share-template
Description:
Shares a specific template with a partner.
Request Body:
Field | Type | Description |
---|---|---|
company_id | string | The ID of the company sharing the template. |
template_id | string | The ID of the template to be shared. |
partner_id | string | The ID of the partner to share the template with. |
Response:
Status | Description |
---|---|
200 OK | Template shared successfully with the partner. |
400 Bad Request | Missing required fields in the request body. |
409 Conflict | Template is already shared with the specified partner. |
500 Internal Server Error | An error occurred while processing the request. |
Response Object:
Success Response:
{
"success": true,
"message": "Template shared successfully with the partner.",
"data": {
"id": "string",
"template_id": "string",
"partner_id": "string",
"company_id": "string",
"created_at": "string"
}
}