(documents.fields)
- get - Get document field
- create - Create document field
- createMany - Create document fields
- update - Update document field
- updateMany - Update document fields
- delete - Delete document field
Returns a single field. If you want to retrieve all the fields for a document, use the "Get Document" endpoint.
import { Documenso } from "@documenso/sdk-typescript";
const documenso = new Documenso({
apiKey: process.env["DOCUMENSO_API_KEY"] ?? "",
});
async function run() {
const result = await documenso.documents.fields.get({
fieldId: 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 { documentsFieldsGet } from "@documenso/sdk-typescript/funcs/documentsFieldsGet.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 documentsFieldsGet(documenso, {
fieldId: 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.FieldGetDocumentFieldRequest | ✔️ | 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.FieldGetDocumentFieldResponse>
Error Type | Status Code | Content Type |
---|---|---|
errors.FieldGetDocumentFieldBadRequestError | 400 | application/json |
errors.FieldGetDocumentFieldNotFoundError | 404 | application/json |
errors.FieldGetDocumentFieldInternalServerError | 500 | application/json |
errors.APIError | 4XX, 5XX | */* |
Create a single field for 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.documents.fields.create({
documentId: 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 { documentsFieldsCreate } from "@documenso/sdk-typescript/funcs/documentsFieldsCreate.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 documentsFieldsCreate(documenso, {
documentId: 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.FieldCreateDocumentFieldRequest | ✔️ | 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.FieldCreateDocumentFieldResponse>
Error Type | Status Code | Content Type |
---|---|---|
errors.FieldCreateDocumentFieldBadRequestError | 400 | application/json |
errors.FieldCreateDocumentFieldInternalServerError | 500 | application/json |
errors.APIError | 4XX, 5XX | */* |
Create multiple fields for 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.documents.fields.createMany({
documentId: 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 { documentsFieldsCreateMany } from "@documenso/sdk-typescript/funcs/documentsFieldsCreateMany.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 documentsFieldsCreateMany(documenso, {
documentId: 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.FieldCreateDocumentFieldsRequest | ✔️ | 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.FieldCreateDocumentFieldsResponse>
Error Type | Status Code | Content Type |
---|---|---|
errors.FieldCreateDocumentFieldsBadRequestError | 400 | application/json |
errors.FieldCreateDocumentFieldsInternalServerError | 500 | application/json |
errors.APIError | 4XX, 5XX | */* |
Update a single field for 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.documents.fields.update({
documentId: 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 { documentsFieldsUpdate } from "@documenso/sdk-typescript/funcs/documentsFieldsUpdate.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 documentsFieldsUpdate(documenso, {
documentId: 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.FieldUpdateDocumentFieldRequest | ✔️ | 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.FieldUpdateDocumentFieldResponse>
Error Type | Status Code | Content Type |
---|---|---|
errors.FieldUpdateDocumentFieldBadRequestError | 400 | application/json |
errors.FieldUpdateDocumentFieldInternalServerError | 500 | application/json |
errors.APIError | 4XX, 5XX | */* |
Update multiple fields for 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.documents.fields.updateMany({
documentId: 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 { documentsFieldsUpdateMany } from "@documenso/sdk-typescript/funcs/documentsFieldsUpdateMany.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 documentsFieldsUpdateMany(documenso, {
documentId: 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.FieldUpdateDocumentFieldsRequest | ✔️ | 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.FieldUpdateDocumentFieldsResponse>
Error Type | Status Code | Content Type |
---|---|---|
errors.FieldUpdateDocumentFieldsBadRequestError | 400 | application/json |
errors.FieldUpdateDocumentFieldsInternalServerError | 500 | application/json |
errors.APIError | 4XX, 5XX | */* |
Delete document field
import { Documenso } from "@documenso/sdk-typescript";
const documenso = new Documenso({
apiKey: process.env["DOCUMENSO_API_KEY"] ?? "",
});
async function run() {
const result = await documenso.documents.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 { documentsFieldsDelete } from "@documenso/sdk-typescript/funcs/documentsFieldsDelete.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 documentsFieldsDelete(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.FieldDeleteDocumentFieldRequest | ✔️ | 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.FieldDeleteDocumentFieldResponse>
Error Type | Status Code | Content Type |
---|---|---|
errors.FieldDeleteDocumentFieldBadRequestError | 400 | application/json |
errors.FieldDeleteDocumentFieldInternalServerError | 500 | application/json |
errors.APIError | 4XX, 5XX | */* |