(templates)
- find - Find templates
- get - Get template
- update - Update template
- duplicate - Duplicate template
- delete - Delete template
- use - Use template
- move_to_team - Move template
Find templates based on a search criteria
from documenso_sdk import Documenso
import os
with Documenso(
api_key=os.getenv("DOCUMENSO_API_KEY", ""),
) as documenso:
res = documenso.templates.find()
# Handle response
print(res)
Parameter | Type | Required | Description |
---|---|---|---|
query |
Optional[str] | ➖ | The search query. |
page |
Optional[float] | ➖ | The pagination page number, starts at 1. |
per_page |
Optional[float] | ➖ | The number of items per page. |
type |
Optional[models.QueryParamType] | ➖ | Filter templates by type. |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
models.TemplateFindTemplatesResponse
Error Type | Status Code | Content Type |
---|---|---|
models.TemplateFindTemplatesBadRequestError | 400 | application/json |
models.TemplateFindTemplatesNotFoundError | 404 | application/json |
models.TemplateFindTemplatesInternalServerError | 500 | application/json |
models.APIError | 4XX, 5XX | */* |
Get template
from documenso_sdk import Documenso
import os
with Documenso(
api_key=os.getenv("DOCUMENSO_API_KEY", ""),
) as documenso:
res = documenso.templates.get(template_id=7003.47)
# Handle response
print(res)
Parameter | Type | Required | Description |
---|---|---|---|
template_id |
float | ✔️ | N/A |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
models.TemplateGetTemplateByIDResponse
Error Type | Status Code | Content Type |
---|---|---|
models.TemplateGetTemplateByIDBadRequestError | 400 | application/json |
models.TemplateGetTemplateByIDNotFoundError | 404 | application/json |
models.TemplateGetTemplateByIDInternalServerError | 500 | application/json |
models.APIError | 4XX, 5XX | */* |
Update template
from documenso_sdk import Documenso
import os
with Documenso(
api_key=os.getenv("DOCUMENSO_API_KEY", ""),
) as documenso:
res = documenso.templates.update(template_id=8574.78)
# Handle response
print(res)
Parameter | Type | Required | Description |
---|---|---|---|
template_id |
float | ✔️ | N/A |
data |
Optional[models.TemplateUpdateTemplateData] | ➖ | N/A |
meta |
Optional[models.TemplateUpdateTemplateMeta] | ➖ | N/A |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
models.TemplateUpdateTemplateResponse
Error Type | Status Code | Content Type |
---|---|---|
models.TemplateUpdateTemplateBadRequestError | 400 | application/json |
models.TemplateUpdateTemplateInternalServerError | 500 | application/json |
models.APIError | 4XX, 5XX | */* |
Duplicate template
from documenso_sdk import Documenso
import os
with Documenso(
api_key=os.getenv("DOCUMENSO_API_KEY", ""),
) as documenso:
res = documenso.templates.duplicate(template_id=3523.11)
# Handle response
print(res)
Parameter | Type | Required | Description |
---|---|---|---|
template_id |
float | ✔️ | N/A |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
models.TemplateDuplicateTemplateResponse
Error Type | Status Code | Content Type |
---|---|---|
models.TemplateDuplicateTemplateBadRequestError | 400 | application/json |
models.TemplateDuplicateTemplateInternalServerError | 500 | application/json |
models.APIError | 4XX, 5XX | */* |
Delete template
from documenso_sdk import Documenso
import os
with Documenso(
api_key=os.getenv("DOCUMENSO_API_KEY", ""),
) as documenso:
res = documenso.templates.delete(template_id=5459.07)
# Handle response
print(res)
Parameter | Type | Required | Description |
---|---|---|---|
template_id |
float | ✔️ | N/A |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
models.TemplateDeleteTemplateResponse
Error Type | Status Code | Content Type |
---|---|---|
models.TemplateDeleteTemplateBadRequestError | 400 | application/json |
models.TemplateDeleteTemplateInternalServerError | 500 | application/json |
models.APIError | 4XX, 5XX | */* |
Use the template to create a document
from documenso_sdk import Documenso
import os
with Documenso(
api_key=os.getenv("DOCUMENSO_API_KEY", ""),
) as documenso:
res = documenso.templates.use(template_id=6626.9, recipients=[
{
"id": 6473.53,
"email": "[email protected]",
},
{
"id": 3772.31,
"email": "[email protected]",
},
])
# Handle response
print(res)
Parameter | Type | Required | Description |
---|---|---|---|
template_id |
float | ✔️ | N/A |
recipients |
List[models.TemplateCreateDocumentFromTemplateRecipientRequestBody] | ✔️ | The information of the recipients to create the document with. |
distribute_document |
Optional[bool] | ➖ | Whether to create the document as pending and distribute it to recipients. |
custom_document_data_id |
Optional[str] | ➖ | The data ID of an alternative PDF to use when creating the document. If not provided, the PDF attached to the template will be used. |
prefill_fields |
List[models.PrefillField] | ➖ | The fields to prefill on the document before sending it out. Useful when you want to create a document from an existing template and pre-fill the fields with specific values. |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
models.TemplateCreateDocumentFromTemplateResponse
Error Type | Status Code | Content Type |
---|---|---|
models.TemplateCreateDocumentFromTemplateBadRequestError | 400 | application/json |
models.TemplateCreateDocumentFromTemplateInternalServerError | 500 | application/json |
models.APIError | 4XX, 5XX | */* |
Move a template to a team
from documenso_sdk import Documenso
import os
with Documenso(
api_key=os.getenv("DOCUMENSO_API_KEY", ""),
) as documenso:
res = documenso.templates.move_to_team(template_id=8301.72, team_id=6724.78)
# Handle response
print(res)
Parameter | Type | Required | Description |
---|---|---|---|
template_id |
float | ✔️ | The ID of the template to move to. |
team_id |
float | ✔️ | The ID of the team to move the template to. |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
models.TemplateMoveTemplateToTeamResponse
Error Type | Status Code | Content Type |
---|---|---|
models.TemplateMoveTemplateToTeamBadRequestError | 400 | application/json |
models.TemplateMoveTemplateToTeamInternalServerError | 500 | application/json |
models.APIError | 4XX, 5XX | */* |