- create - Create attachment
- update - Update attachment
- delete - Delete attachment
- find - Find attachments
Create a new attachment for a document
from documenso_sdk import Documenso
import os
with Documenso(
api_key=os.getenv("DOCUMENSO_API_KEY", ""),
) as documenso:
res = documenso.documents.attachments.create(document_id=7014.36, data={
"label": "<value>",
"data": "https://cheerful-bourgeoisie.org/",
})
# Handle response
print(res)| Parameter | Type | Required | Description |
|---|---|---|---|
document_id |
float | ✔️ | N/A |
data |
models.DocumentAttachmentCreateData | ✔️ | N/A |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
models.DocumentAttachmentCreateResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| models.DocumentAttachmentCreateBadRequestError | 400 | application/json |
| models.DocumentAttachmentCreateUnauthorizedError | 401 | application/json |
| models.DocumentAttachmentCreateForbiddenError | 403 | application/json |
| models.DocumentAttachmentCreateInternalServerError | 500 | application/json |
| models.APIError | 4XX, 5XX | */* |
Update an existing attachment
from documenso_sdk import Documenso
import os
with Documenso(
api_key=os.getenv("DOCUMENSO_API_KEY", ""),
) as documenso:
res = documenso.documents.attachments.update(id="<id>", data={
"label": "<value>",
"data": "https://tinted-ceramics.biz",
})
# Handle response
print(res)| Parameter | Type | Required | Description |
|---|---|---|---|
id |
str | ✔️ | N/A |
data |
models.DocumentAttachmentUpdateData | ✔️ | N/A |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
models.DocumentAttachmentUpdateResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| models.DocumentAttachmentUpdateBadRequestError | 400 | application/json |
| models.DocumentAttachmentUpdateUnauthorizedError | 401 | application/json |
| models.DocumentAttachmentUpdateForbiddenError | 403 | application/json |
| models.DocumentAttachmentUpdateInternalServerError | 500 | application/json |
| models.APIError | 4XX, 5XX | */* |
Delete an attachment from a document
from documenso_sdk import Documenso
import os
with Documenso(
api_key=os.getenv("DOCUMENSO_API_KEY", ""),
) as documenso:
res = documenso.documents.attachments.delete(id="<id>")
# Handle response
print(res)| Parameter | Type | Required | Description |
|---|---|---|---|
id |
str | ✔️ | N/A |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
models.DocumentAttachmentDeleteResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| models.DocumentAttachmentDeleteBadRequestError | 400 | application/json |
| models.DocumentAttachmentDeleteUnauthorizedError | 401 | application/json |
| models.DocumentAttachmentDeleteForbiddenError | 403 | application/json |
| models.DocumentAttachmentDeleteInternalServerError | 500 | application/json |
| models.APIError | 4XX, 5XX | */* |
Find all attachments for a document
from documenso_sdk import Documenso
import os
with Documenso(
api_key=os.getenv("DOCUMENSO_API_KEY", ""),
) as documenso:
res = documenso.documents.attachments.find(document_id=965.17)
# Handle response
print(res)| Parameter | Type | Required | Description |
|---|---|---|---|
document_id |
float | ✔️ | N/A |
retries |
Optional[utils.RetryConfig] | ➖ | Configuration to override the default retry behavior of the client. |
models.DocumentAttachmentFindResponse
| Error Type | Status Code | Content Type |
|---|---|---|
| models.DocumentAttachmentFindBadRequestError | 400 | application/json |
| models.DocumentAttachmentFindUnauthorizedError | 401 | application/json |
| models.DocumentAttachmentFindForbiddenError | 403 | application/json |
| models.DocumentAttachmentFindNotFoundError | 404 | application/json |
| models.DocumentAttachmentFindInternalServerError | 500 | application/json |
| models.APIError | 4XX, 5XX | */* |