- 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: 6077.81,
});
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: 6077.81,
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("documentsFieldsGet failed:", res.error);
}
}
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.FieldGetDocumentFieldUnauthorizedError | 401 | application/json |
| errors.FieldGetDocumentFieldForbiddenError | 403 | 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: 8001.93,
field: {
type: "NAME",
recipientId: 2564.68,
pageNumber: 791.77,
pageX: 7845.22,
pageY: 6843.16,
width: 3932.15,
height: 8879.89,
},
});
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: 8001.93,
field: {
type: "NAME",
recipientId: 2564.68,
pageNumber: 791.77,
pageX: 7845.22,
pageY: 6843.16,
width: 3932.15,
height: 8879.89,
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("documentsFieldsCreate failed:", res.error);
}
}
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.FieldCreateDocumentFieldUnauthorizedError | 401 | application/json |
| errors.FieldCreateDocumentFieldForbiddenError | 403 | 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: 6257.51,
fields: [
{
type: "FREE_SIGNATURE",
recipientId: 679.35,
pageNumber: 5914.59,
pageX: 7253.11,
pageY: 8426.91,
width: 8995.55,
height: 9808.97,
},
],
});
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: 6257.51,
fields: [
{
type: "FREE_SIGNATURE",
recipientId: 679.35,
pageNumber: 5914.59,
pageX: 7253.11,
pageY: 8426.91,
width: 8995.55,
height: 9808.97,
},
],
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("documentsFieldsCreateMany failed:", res.error);
}
}
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.FieldCreateDocumentFieldsUnauthorizedError | 401 | application/json |
| errors.FieldCreateDocumentFieldsForbiddenError | 403 | 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: 5956.26,
field: {
type: "FREE_SIGNATURE",
id: 6955.16,
},
});
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: 5956.26,
field: {
type: "FREE_SIGNATURE",
id: 6955.16,
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("documentsFieldsUpdate failed:", res.error);
}
}
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.FieldUpdateDocumentFieldUnauthorizedError | 401 | application/json |
| errors.FieldUpdateDocumentFieldForbiddenError | 403 | 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: 9317.43,
fields: [],
});
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: 9317.43,
fields: [],
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("documentsFieldsUpdateMany failed:", res.error);
}
}
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.FieldUpdateDocumentFieldsUnauthorizedError | 401 | application/json |
| errors.FieldUpdateDocumentFieldsForbiddenError | 403 | 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: 4748.27,
});
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: 4748.27,
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("documentsFieldsDelete failed:", res.error);
}
}
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.FieldDeleteDocumentFieldUnauthorizedError | 401 | application/json |
| errors.FieldDeleteDocumentFieldForbiddenError | 403 | application/json |
| errors.FieldDeleteDocumentFieldInternalServerError | 500 | application/json |
| errors.APIError | 4XX, 5XX | */* |