(templates)
- find - Find templates
- get - Get template
- update - Update template
- duplicate - Duplicate template
- delete - Delete template
- use - Use template
- moveToTeam - Move template
Find templates based on a search criteria
import { Documenso } from "@documenso/sdk-typescript";
const documenso = new Documenso({
apiKey: process.env["DOCUMENSO_API_KEY"] ?? "",
});
async function run() {
const result = await documenso.templates.find({});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { DocumensoCore } from "@documenso/sdk-typescript/core.js";
import { templatesFind } from "@documenso/sdk-typescript/funcs/templatesFind.js";
// Use `DocumensoCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const documenso = new DocumensoCore({
apiKey: process.env["DOCUMENSO_API_KEY"] ?? "",
});
async function run() {
const res = await templatesFind(documenso, {});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.TemplateFindTemplatesRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.TemplateFindTemplatesResponse>
Error Type | Status Code | Content Type |
---|---|---|
errors.TemplateFindTemplatesBadRequestError | 400 | application/json |
errors.TemplateFindTemplatesNotFoundError | 404 | application/json |
errors.TemplateFindTemplatesInternalServerError | 500 | application/json |
errors.APIError | 4XX, 5XX | */* |
Get template
import { Documenso } from "@documenso/sdk-typescript";
const documenso = new Documenso({
apiKey: process.env["DOCUMENSO_API_KEY"] ?? "",
});
async function run() {
const result = await documenso.templates.get({
templateId: 7003.47,
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { DocumensoCore } from "@documenso/sdk-typescript/core.js";
import { templatesGet } from "@documenso/sdk-typescript/funcs/templatesGet.js";
// Use `DocumensoCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const documenso = new DocumensoCore({
apiKey: process.env["DOCUMENSO_API_KEY"] ?? "",
});
async function run() {
const res = await templatesGet(documenso, {
templateId: 7003.47,
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.TemplateGetTemplateByIdRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.TemplateGetTemplateByIdResponse>
Error Type | Status Code | Content Type |
---|---|---|
errors.TemplateGetTemplateByIdBadRequestError | 400 | application/json |
errors.TemplateGetTemplateByIdNotFoundError | 404 | application/json |
errors.TemplateGetTemplateByIdInternalServerError | 500 | application/json |
errors.APIError | 4XX, 5XX | */* |
Update template
import { Documenso } from "@documenso/sdk-typescript";
const documenso = new Documenso({
apiKey: process.env["DOCUMENSO_API_KEY"] ?? "",
});
async function run() {
const result = await documenso.templates.update({
templateId: 8574.78,
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { DocumensoCore } from "@documenso/sdk-typescript/core.js";
import { templatesUpdate } from "@documenso/sdk-typescript/funcs/templatesUpdate.js";
// Use `DocumensoCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const documenso = new DocumensoCore({
apiKey: process.env["DOCUMENSO_API_KEY"] ?? "",
});
async function run() {
const res = await templatesUpdate(documenso, {
templateId: 8574.78,
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.TemplateUpdateTemplateRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.TemplateUpdateTemplateResponse>
Error Type | Status Code | Content Type |
---|---|---|
errors.TemplateUpdateTemplateBadRequestError | 400 | application/json |
errors.TemplateUpdateTemplateInternalServerError | 500 | application/json |
errors.APIError | 4XX, 5XX | */* |
Duplicate template
import { Documenso } from "@documenso/sdk-typescript";
const documenso = new Documenso({
apiKey: process.env["DOCUMENSO_API_KEY"] ?? "",
});
async function run() {
const result = await documenso.templates.duplicate({
templateId: 3523.11,
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { DocumensoCore } from "@documenso/sdk-typescript/core.js";
import { templatesDuplicate } from "@documenso/sdk-typescript/funcs/templatesDuplicate.js";
// Use `DocumensoCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const documenso = new DocumensoCore({
apiKey: process.env["DOCUMENSO_API_KEY"] ?? "",
});
async function run() {
const res = await templatesDuplicate(documenso, {
templateId: 3523.11,
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.TemplateDuplicateTemplateRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.TemplateDuplicateTemplateResponse>
Error Type | Status Code | Content Type |
---|---|---|
errors.TemplateDuplicateTemplateBadRequestError | 400 | application/json |
errors.TemplateDuplicateTemplateInternalServerError | 500 | application/json |
errors.APIError | 4XX, 5XX | */* |
Delete template
import { Documenso } from "@documenso/sdk-typescript";
const documenso = new Documenso({
apiKey: process.env["DOCUMENSO_API_KEY"] ?? "",
});
async function run() {
const result = await documenso.templates.delete({
templateId: 5459.07,
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { DocumensoCore } from "@documenso/sdk-typescript/core.js";
import { templatesDelete } from "@documenso/sdk-typescript/funcs/templatesDelete.js";
// Use `DocumensoCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const documenso = new DocumensoCore({
apiKey: process.env["DOCUMENSO_API_KEY"] ?? "",
});
async function run() {
const res = await templatesDelete(documenso, {
templateId: 5459.07,
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.TemplateDeleteTemplateRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.TemplateDeleteTemplateResponse>
Error Type | Status Code | Content Type |
---|---|---|
errors.TemplateDeleteTemplateBadRequestError | 400 | application/json |
errors.TemplateDeleteTemplateInternalServerError | 500 | application/json |
errors.APIError | 4XX, 5XX | */* |
Use the template to create a document
import { Documenso } from "@documenso/sdk-typescript";
const documenso = new Documenso({
apiKey: process.env["DOCUMENSO_API_KEY"] ?? "",
});
async function run() {
const result = await documenso.templates.use({
templateId: 6626.9,
recipients: [
{
id: 6473.53,
email: "[email protected]",
},
{
id: 3772.31,
email: "[email protected]",
},
],
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { DocumensoCore } from "@documenso/sdk-typescript/core.js";
import { templatesUse } from "@documenso/sdk-typescript/funcs/templatesUse.js";
// Use `DocumensoCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const documenso = new DocumensoCore({
apiKey: process.env["DOCUMENSO_API_KEY"] ?? "",
});
async function run() {
const res = await templatesUse(documenso, {
templateId: 6626.9,
recipients: [
{
id: 6473.53,
email: "[email protected]",
},
{
id: 3772.31,
email: "[email protected]",
},
],
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.TemplateCreateDocumentFromTemplateRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.TemplateCreateDocumentFromTemplateResponse>
Error Type | Status Code | Content Type |
---|---|---|
errors.TemplateCreateDocumentFromTemplateBadRequestError | 400 | application/json |
errors.TemplateCreateDocumentFromTemplateInternalServerError | 500 | application/json |
errors.APIError | 4XX, 5XX | */* |
Move a template to a team
import { Documenso } from "@documenso/sdk-typescript";
const documenso = new Documenso({
apiKey: process.env["DOCUMENSO_API_KEY"] ?? "",
});
async function run() {
const result = await documenso.templates.moveToTeam({
templateId: 8301.72,
teamId: 6724.78,
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { DocumensoCore } from "@documenso/sdk-typescript/core.js";
import { templatesMoveToTeam } from "@documenso/sdk-typescript/funcs/templatesMoveToTeam.js";
// Use `DocumensoCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const documenso = new DocumensoCore({
apiKey: process.env["DOCUMENSO_API_KEY"] ?? "",
});
async function run() {
const res = await templatesMoveToTeam(documenso, {
templateId: 8301.72,
teamId: 6724.78,
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.TemplateMoveTemplateToTeamRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<operations.TemplateMoveTemplateToTeamResponse>
Error Type | Status Code | Content Type |
---|---|---|
errors.TemplateMoveTemplateToTeamBadRequestError | 400 | application/json |
errors.TemplateMoveTemplateToTeamInternalServerError | 500 | application/json |
errors.APIError | 4XX, 5XX | */* |