(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.TemplateFindTemplatesResponseBody>
Error Type | Status Code | Content Type |
---|---|---|
errors.TemplateFindTemplatesResponseBody | 400 | application/json |
errors.TemplateFindTemplatesTemplatesResponseBody | 404 | application/json |
errors.TemplateFindTemplatesTemplatesResponseResponseBody | 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.TemplateGetTemplateByIdResponseBody>
Error Type | Status Code | Content Type |
---|---|---|
errors.TemplateGetTemplateByIdResponseBody | 400 | application/json |
errors.TemplateGetTemplateByIdTemplatesResponseBody | 404 | application/json |
errors.TemplateGetTemplateByIdTemplatesResponseResponseBody | 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.TemplateUpdateTemplateRequestBody | ✔️ | 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.TemplateUpdateTemplateResponseBody>
Error Type | Status Code | Content Type |
---|---|---|
errors.TemplateUpdateTemplateResponseBody | 400 | application/json |
errors.TemplateUpdateTemplateTemplatesResponseBody | 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.TemplateDuplicateTemplateRequestBody | ✔️ | 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.TemplateDuplicateTemplateResponseBody>
Error Type | Status Code | Content Type |
---|---|---|
errors.TemplateDuplicateTemplateResponseBody | 400 | application/json |
errors.TemplateDuplicateTemplateTemplatesResponseBody | 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.TemplateDeleteTemplateRequestBody | ✔️ | 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.TemplateDeleteTemplateResponseBody>
Error Type | Status Code | Content Type |
---|---|---|
errors.TemplateDeleteTemplateResponseBody | 400 | application/json |
errors.TemplateDeleteTemplateTemplatesResponseBody | 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.TemplateCreateDocumentFromTemplateRequestBody | ✔️ | 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.TemplateCreateDocumentFromTemplateResponseBody>
Error Type | Status Code | Content Type |
---|---|---|
errors.TemplateCreateDocumentFromTemplateResponseBody | 400 | application/json |
errors.TemplateCreateDocumentFromTemplateTemplatesResponseBody | 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.TemplateMoveTemplateToTeamRequestBody | ✔️ | 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.TemplateMoveTemplateToTeamResponseBody>
Error Type | Status Code | Content Type |
---|---|---|
errors.TemplateMoveTemplateToTeamResponseBody | 400 | application/json |
errors.TemplateMoveTemplateToTeamTemplatesResponseBody | 500 | application/json |
errors.APIError | 4XX, 5XX | */* |