(templates.fields)
- create - Create template field
- get - Get template field
- createMany - Create template fields
- update - Update template field
- updateMany - Update template fields
- delete - Delete template field
Create a single field for a 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.fields.create({
templateId: 4865.89,
field: {
type: "NUMBER",
recipientId: 4174.58,
pageNumber: 1343.65,
pageX: 690.25,
pageY: 7964.74,
width: 9510.62,
height: 0.86,
},
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { DocumensoCore } from "@documenso/sdk-typescript/core.js";
import { templatesFieldsCreate } from "@documenso/sdk-typescript/funcs/templatesFieldsCreate.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 templatesFieldsCreate(documenso, {
templateId: 4865.89,
field: {
type: "NUMBER",
recipientId: 4174.58,
pageNumber: 1343.65,
pageX: 690.25,
pageY: 7964.74,
width: 9510.62,
height: 0.86,
},
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.FieldCreateTemplateFieldRequestBody | ✔️ | 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.FieldCreateTemplateFieldResponseBody>
Error Type | Status Code | Content Type |
---|---|---|
errors.FieldCreateTemplateFieldResponseBody | 400 | application/json |
errors.FieldCreateTemplateFieldTemplatesFieldsResponseBody | 500 | application/json |
errors.APIError | 4XX, 5XX | */* |
Returns a single field. If you want to retrieve all the fields for a template, use the "Get Template" endpoint.
import { Documenso } from "@documenso/sdk-typescript";
const documenso = new Documenso({
apiKey: process.env["DOCUMENSO_API_KEY"] ?? "",
});
async function run() {
const result = await documenso.templates.fields.get({
fieldId: 1340.63,
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { DocumensoCore } from "@documenso/sdk-typescript/core.js";
import { templatesFieldsGet } from "@documenso/sdk-typescript/funcs/templatesFieldsGet.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 templatesFieldsGet(documenso, {
fieldId: 1340.63,
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.FieldGetTemplateFieldRequest | ✔️ | 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.FieldGetTemplateFieldResponseBody>
Error Type | Status Code | Content Type |
---|---|---|
errors.FieldGetTemplateFieldResponseBody | 400 | application/json |
errors.FieldGetTemplateFieldTemplatesFieldsResponseBody | 404 | application/json |
errors.FieldGetTemplateFieldTemplatesFieldsResponseResponseBody | 500 | application/json |
errors.APIError | 4XX, 5XX | */* |
Create multiple fields for a 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.fields.createMany({
templateId: 5158.41,
fields: [
{
type: "CHECKBOX",
recipientId: 2516.72,
pageNumber: 2304.17,
pageX: 7760.32,
pageY: 3376.66,
width: 3566.94,
height: 2768.94,
},
{
type: "NUMBER",
recipientId: 5689.64,
pageNumber: 6483.69,
pageX: 7271.79,
pageY: 1891.56,
width: 7263.21,
height: 5043.41,
},
],
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { DocumensoCore } from "@documenso/sdk-typescript/core.js";
import { templatesFieldsCreateMany } from "@documenso/sdk-typescript/funcs/templatesFieldsCreateMany.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 templatesFieldsCreateMany(documenso, {
templateId: 5158.41,
fields: [
{
type: "CHECKBOX",
recipientId: 2516.72,
pageNumber: 2304.17,
pageX: 7760.32,
pageY: 3376.66,
width: 3566.94,
height: 2768.94,
},
{
type: "NUMBER",
recipientId: 5689.64,
pageNumber: 6483.69,
pageX: 7271.79,
pageY: 1891.56,
width: 7263.21,
height: 5043.41,
},
],
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.FieldCreateTemplateFieldsRequestBody | ✔️ | 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.FieldCreateTemplateFieldsResponseBody>
Error Type | Status Code | Content Type |
---|---|---|
errors.FieldCreateTemplateFieldsResponseBody | 400 | application/json |
errors.FieldCreateTemplateFieldsTemplatesFieldsResponseBody | 500 | application/json |
errors.APIError | 4XX, 5XX | */* |
Update a single field for a 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.fields.update({
templateId: 8574.78,
field: {
type: "TEXT",
id: 3446.2,
},
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { DocumensoCore } from "@documenso/sdk-typescript/core.js";
import { templatesFieldsUpdate } from "@documenso/sdk-typescript/funcs/templatesFieldsUpdate.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 templatesFieldsUpdate(documenso, {
templateId: 8574.78,
field: {
type: "TEXT",
id: 3446.2,
},
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.FieldUpdateTemplateFieldRequestBody | ✔️ | 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.FieldUpdateTemplateFieldResponseBody>
Error Type | Status Code | Content Type |
---|---|---|
errors.FieldUpdateTemplateFieldResponseBody | 400 | application/json |
errors.FieldUpdateTemplateFieldTemplatesFieldsResponseBody | 500 | application/json |
errors.APIError | 4XX, 5XX | */* |
Update multiple fields for a 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.fields.updateMany({
templateId: 4057.69,
fields: [
{
type: "DATE",
id: 8982.15,
},
{
type: "NAME",
id: 310.19,
},
],
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { DocumensoCore } from "@documenso/sdk-typescript/core.js";
import { templatesFieldsUpdateMany } from "@documenso/sdk-typescript/funcs/templatesFieldsUpdateMany.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 templatesFieldsUpdateMany(documenso, {
templateId: 4057.69,
fields: [
{
type: "DATE",
id: 8982.15,
},
{
type: "NAME",
id: 310.19,
},
],
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.FieldUpdateTemplateFieldsRequestBody | ✔️ | 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.FieldUpdateTemplateFieldsResponseBody>
Error Type | Status Code | Content Type |
---|---|---|
errors.FieldUpdateTemplateFieldsResponseBody | 400 | application/json |
errors.FieldUpdateTemplateFieldsTemplatesFieldsResponseBody | 500 | application/json |
errors.APIError | 4XX, 5XX | */* |
Delete template field
import { Documenso } from "@documenso/sdk-typescript";
const documenso = new Documenso({
apiKey: process.env["DOCUMENSO_API_KEY"] ?? "",
});
async function run() {
const result = await documenso.templates.fields.delete({
fieldId: 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 { templatesFieldsDelete } from "@documenso/sdk-typescript/funcs/templatesFieldsDelete.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 templatesFieldsDelete(documenso, {
fieldId: 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.FieldDeleteTemplateFieldRequestBody | ✔️ | 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.FieldDeleteTemplateFieldResponseBody>
Error Type | Status Code | Content Type |
---|---|---|
errors.FieldDeleteTemplateFieldResponseBody | 400 | application/json |
errors.FieldDeleteTemplateFieldTemplatesFieldsResponseBody | 500 | application/json |
errors.APIError | 4XX, 5XX | */* |