Skip to content

Latest commit

 

History

History
131 lines (83 loc) · 6.87 KB

File metadata and controls

131 lines (83 loc) · 6.87 KB

Documents

(documents)

Overview

Available Operations

  • list - List all documents
  • get - Retrieve a document
  • delete - Delete a document

list

Retrieve a list of documents for the authenticated team.

Example Usage

from midday import Midday


with Midday(
    token="MIDDAY_API_KEY",
) as m_client:

    res = m_client.documents.list(cursor="20", page_size=20, q="invoice", tags=[
        "tag1",
        "tag2",
    ])

    # Handle response
    print(res)

Parameters

Parameter Type Required Description Example
cursor OptionalNullable[str] N/A 20
sort List[str] N/A
page_size Optional[float] N/A 20
q OptionalNullable[str] N/A invoice
tags List[str] N/A [
"tag1",
"tag2"
]
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.ListDocumentsResponse

Errors

Error Type Status Code Content Type
errors.APIError 4XX, 5XX */*

get

Retrieve a document by its unique identifier for the authenticated team.

Example Usage

from midday import Midday


with Midday(
    token="MIDDAY_API_KEY",
) as m_client:

    res = m_client.documents.get(id="<id>")

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
id Nullable[str] ✔️ N/A
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.GetDocumentByIDResponse

Errors

Error Type Status Code Content Type
errors.APIError 4XX, 5XX */*

delete

Delete a document by its unique identifier for the authenticated team.

Example Usage

from midday import Midday


with Midday(
    token="MIDDAY_API_KEY",
) as m_client:

    res = m_client.documents.delete(id="<id>")

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
id str ✔️ N/A
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

models.DeleteDocumentResponse

Errors

Error Type Status Code Content Type
errors.APIError 4XX, 5XX */*