(documents)
- find - Find documents
- get - Get document
- createV0 - Create document
- update - Update document
- delete - Delete document
- moveToTeam - Move document
- distribute - Distribute document
- redistribute - Redistribute document
- duplicate - Duplicate document
Find documents 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.documents.find({});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { DocumensoCore } from "@documenso/sdk-typescript/core.js";
import { documentsFind } from "@documenso/sdk-typescript/funcs/documentsFind.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 documentsFind(documenso, {});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.DocumentFindDocumentsRequest | ✔️ | 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.DocumentFindDocumentsResponse>
Error Type | Status Code | Content Type |
---|---|---|
errors.DocumentFindDocumentsBadRequestError | 400 | application/json |
errors.DocumentFindDocumentsNotFoundError | 404 | application/json |
errors.DocumentFindDocumentsInternalServerError | 500 | application/json |
errors.APIError | 4XX, 5XX | */* |
Returns a document given an ID
import { Documenso } from "@documenso/sdk-typescript";
const documenso = new Documenso({
apiKey: process.env["DOCUMENSO_API_KEY"] ?? "",
});
async function run() {
const result = await documenso.documents.get({
documentId: 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 { documentsGet } from "@documenso/sdk-typescript/funcs/documentsGet.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 documentsGet(documenso, {
documentId: 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.DocumentGetDocumentWithDetailsByIdRequest | ✔️ | 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.DocumentGetDocumentWithDetailsByIdResponse>
Error Type | Status Code | Content Type |
---|---|---|
errors.DocumentGetDocumentWithDetailsByIdBadRequestError | 400 | application/json |
errors.DocumentGetDocumentWithDetailsByIdNotFoundError | 404 | application/json |
errors.DocumentGetDocumentWithDetailsByIdInternalServerError | 500 | application/json |
errors.APIError | 4XX, 5XX | */* |
You will need to upload the PDF to the provided URL returned. Note: Once V2 API is released, this will be removed since we will allow direct uploads, instead of using an upload URL.
import { Documenso } from "@documenso/sdk-typescript";
const documenso = new Documenso({
apiKey: process.env["DOCUMENSO_API_KEY"] ?? "",
});
async function run() {
const result = await documenso.documents.createV0({
title: "<value>",
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { DocumensoCore } from "@documenso/sdk-typescript/core.js";
import { documentsCreateV0 } from "@documenso/sdk-typescript/funcs/documentsCreateV0.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 documentsCreateV0(documenso, {
title: "<value>",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.DocumentCreateDocumentTemporaryRequest | ✔️ | 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.DocumentCreateDocumentTemporaryResponse>
Error Type | Status Code | Content Type |
---|---|---|
errors.DocumentCreateDocumentTemporaryBadRequestError | 400 | application/json |
errors.DocumentCreateDocumentTemporaryInternalServerError | 500 | application/json |
errors.APIError | 4XX, 5XX | */* |
Update 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.update({
documentId: 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 { documentsUpdate } from "@documenso/sdk-typescript/funcs/documentsUpdate.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 documentsUpdate(documenso, {
documentId: 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.DocumentUpdateDocumentRequest | ✔️ | 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.DocumentUpdateDocumentResponse>
Error Type | Status Code | Content Type |
---|---|---|
errors.DocumentUpdateDocumentBadRequestError | 400 | application/json |
errors.DocumentUpdateDocumentInternalServerError | 500 | application/json |
errors.APIError | 4XX, 5XX | */* |
Delete 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.delete({
documentId: 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 { documentsDelete } from "@documenso/sdk-typescript/funcs/documentsDelete.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 documentsDelete(documenso, {
documentId: 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.DocumentDeleteDocumentRequest | ✔️ | 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.DocumentDeleteDocumentResponse>
Error Type | Status Code | Content Type |
---|---|---|
errors.DocumentDeleteDocumentBadRequestError | 400 | application/json |
errors.DocumentDeleteDocumentInternalServerError | 500 | application/json |
errors.APIError | 4XX, 5XX | */* |
Move a document from your personal account 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.documents.moveToTeam({
documentId: 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 { documentsMoveToTeam } from "@documenso/sdk-typescript/funcs/documentsMoveToTeam.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 documentsMoveToTeam(documenso, {
documentId: 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.DocumentMoveDocumentToTeamRequest | ✔️ | 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.DocumentMoveDocumentToTeamResponse>
Error Type | Status Code | Content Type |
---|---|---|
errors.DocumentMoveDocumentToTeamBadRequestError | 400 | application/json |
errors.DocumentMoveDocumentToTeamInternalServerError | 500 | application/json |
errors.APIError | 4XX, 5XX | */* |
Send the document out to recipients based on your distribution method
import { Documenso } from "@documenso/sdk-typescript";
const documenso = new Documenso({
apiKey: process.env["DOCUMENSO_API_KEY"] ?? "",
});
async function run() {
const result = await documenso.documents.distribute({
documentId: 4115.92,
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { DocumensoCore } from "@documenso/sdk-typescript/core.js";
import { documentsDistribute } from "@documenso/sdk-typescript/funcs/documentsDistribute.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 documentsDistribute(documenso, {
documentId: 4115.92,
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.DocumentSendDocumentRequest | ✔️ | 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.DocumentSendDocumentResponse>
Error Type | Status Code | Content Type |
---|---|---|
errors.DocumentSendDocumentBadRequestError | 400 | application/json |
errors.DocumentSendDocumentInternalServerError | 500 | application/json |
errors.APIError | 4XX, 5XX | */* |
Redistribute the document to the provided recipients who have not actioned the document. Will use the distribution method set in the 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.redistribute({
documentId: 5758.65,
recipients: [
],
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { DocumensoCore } from "@documenso/sdk-typescript/core.js";
import { documentsRedistribute } from "@documenso/sdk-typescript/funcs/documentsRedistribute.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 documentsRedistribute(documenso, {
documentId: 5758.65,
recipients: [
],
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.DocumentResendDocumentRequest | ✔️ | 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.DocumentResendDocumentResponse>
Error Type | Status Code | Content Type |
---|---|---|
errors.DocumentResendDocumentBadRequestError | 400 | application/json |
errors.DocumentResendDocumentInternalServerError | 500 | application/json |
errors.APIError | 4XX, 5XX | */* |
Duplicate 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.duplicate({
documentId: 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 { documentsDuplicate } from "@documenso/sdk-typescript/funcs/documentsDuplicate.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 documentsDuplicate(documenso, {
documentId: 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.DocumentDuplicateDocumentRequest | ✔️ | 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.DocumentDuplicateDocumentResponse>
Error Type | Status Code | Content Type |
---|---|---|
errors.DocumentDuplicateDocumentBadRequestError | 400 | application/json |
errors.DocumentDuplicateDocumentInternalServerError | 500 | application/json |
errors.APIError | 4XX, 5XX | */* |