> ## Documentation Index
> Fetch the complete documentation index at: https://docs.aryn.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Storage

> Documentation for how to call the Storage APIs using the Aryn SDK

Please find the documentation for how to call the Storage APIs using the Aryn SDK below. All parameters are optional unless specified otherwise.

## DocSet Functions

Functions for managing document sets (DocSets) which are collections of documents.

### Create DocSet

Create a new DocSet to store documents.

<AccordionGroup>
  <Accordion title="Parameters">
    <ParamField path="name" type="string" required>
      String name for the DocSet
    </ParamField>

    <ParamField path="properties" type="object">
      Optional dictionary of additional properties
    </ParamField>

    <ParamField path="schema" type="Schema">
      Optional Schema object defining document properties
    </ParamField>

    <ParamField path="prompts" type="object">
      Optional dictionary of prompts for the DocSet
    </ParamField>
  </Accordion>

  <Accordion title="Example">
    ```python theme={null}
    from aryn_sdk.client.client import Client

    docset = client.create_docset(name="My DocSet")
    docset_id = docset.docset_id
    ```
  </Accordion>

  <Accordion title="Return Value">
    A DocSetMetadata object containing:

    <ParamField path="docset_id" type="string">
      Unique identifier for the DocSet
    </ParamField>

    <ParamField path="name" type="string">
      Name of the DocSet
    </ParamField>

    <ParamField path="created" type="timestamp">
      Creation timestamp
    </ParamField>

    <ParamField path="readonly" type="boolean">
      Boolean indicating if DocSet is read-only
    </ParamField>

    <ParamField path="properties" type="object">
      Dictionary of custom properties
    </ParamField>

    <ParamField path="size" type="number">
      Size of DocSet in bytes
    </ParamField>

    <ParamField path="schema" type="Schema">
      Schema object defining document properties
    </ParamField>

    <ParamField path="prompts" type="object">
      Dictionary of prompts for the DocSet
    </ParamField>
  </Accordion>
</AccordionGroup>

### Get DocSet

Retrieve metadata for a DocSet.

<AccordionGroup>
  <Accordion title="Parameters">
    <ParamField path="docset_id" type="string" required>
      The unique identifier of the DocSet to retrieve
    </ParamField>
  </Accordion>

  <Accordion title="Example">
    ```python theme={null}
    docset = client.get_docset(docset_id="your-docset-id")
    ```
  </Accordion>

  <Accordion title="Return Value">
    A DocSetMetadata object containing:

    <ParamField path="docset_id" type="string">
      Unique identifier for the DocSet
    </ParamField>

    <ParamField path="name" type="string">
      Name of the DocSet
    </ParamField>

    <ParamField path="created" type="timestamp">
      Creation timestamp
    </ParamField>

    <ParamField path="readonly" type="boolean">
      Boolean indicating if DocSet is read-only
    </ParamField>

    <ParamField path="properties" type="object">
      Dictionary of custom properties
    </ParamField>

    <ParamField path="size" type="number">
      Size of DocSet in bytes
    </ParamField>

    <ParamField path="schema" type="Schema">
      Schema object defining document properties
    </ParamField>

    <ParamField path="prompts" type="object">
      Dictionary of prompts for the DocSet
    </ParamField>
  </Accordion>

  <Accordion title="Exceptions">
    * `HTTPError 403`: "No Aryn API Key provided"
    * `HTTPError 403`: "Invalid Aryn API key"
    * `HTTPError 403`: "Expired Aryn API key"
    * `HTTPError 404`: "DocSet not found"
    * `HTTPError 5xx`: Internal Server Error
  </Accordion>
</AccordionGroup>

### List DocSets

List all DocSets in the account.

<AccordionGroup>
  <Accordion title="Parameters">
    <ParamField query="page_size" type="integer" default="100">
      Number of items per page
    </ParamField>

    <ParamField query="page_token" type="string">
      Token for pagination
    </ParamField>

    <ParamField query="name_eq" type="string">
      Filter DocSets by exact name match
    </ParamField>
  </Accordion>

  <Accordion title="Example">
    ```python theme={null}
    docsets = client.list_docsets().get_all()
    for docset in docsets:
        print(f"DocSet: {docset.name}")
    ```
  </Accordion>

  <Accordion title="Return Value">
    A paginated list of DocSetMetadata objects, each containing:

    <ParamField path="docset_id" type="string">
      Unique identifier for the DocSet
    </ParamField>

    <ParamField path="name" type="string">
      Name of the DocSet
    </ParamField>

    <ParamField path="created" type="timestamp">
      Creation timestamp
    </ParamField>

    <ParamField path="readonly" type="boolean">
      Boolean indicating if DocSet is read-only
    </ParamField>

    <ParamField path="properties" type="object">
      Dictionary of custom properties
    </ParamField>

    <ParamField path="size" type="number">
      Size of DocSet in bytes
    </ParamField>

    <ParamField path="schema" type="Schema">
      Schema object defining document properties
    </ParamField>

    <ParamField path="prompts" type="object">
      Dictionary of prompts for the DocSet
    </ParamField>
  </Accordion>

  <Accordion title="Exceptions">
    * `HTTPError 403`: "No Aryn API Key provided"
    * `HTTPError 403`: "Invalid Aryn API key"
    * `HTTPError 403`: "Expired Aryn API key"
    * `HTTPError 5xx`: Internal Server Error
  </Accordion>
</AccordionGroup>

### Delete DocSet

Delete a DocSet and all its documents.

<AccordionGroup>
  <Accordion title="Parameters">
    <ParamField path="docset_id" type="string" required>
      The unique identifier of the DocSet to delete
    </ParamField>
  </Accordion>

  <Accordion title="Example">
    ```python theme={null}
    client.delete_docset(docset_id="your-docset-id")
    ```
  </Accordion>

  <Accordion title="Return Value">
    The metadata of the deleted DocSet
  </Accordion>

  <Accordion title="Exceptions">
    * `HTTPError 403`: "No Aryn API Key provided"
    * `HTTPError 403`: "Invalid Aryn API key"
    * `HTTPError 403`: "Expired Aryn API key"
    * `HTTPError 404`: "DocSet not found"
    * `HTTPError 5xx`: Internal Server Error
  </Accordion>
</AccordionGroup>

## Document Functions

Functions for managing individual documents within DocSets.

### Add Document

Add a single document to the Aryn platform.

This API calls DocParse to partition the document, and automatically extracts any properties registered as part of the DocSet schema.

<AccordionGroup>
  <Accordion title="Parameters">
    <ParamField body="file" type="BinaryIO | str | PathLike" required>
      A `file` opened in binary mode or a path specified as either a `str` or `PathLike` instance, or an HTTP URL indicating the document to add. The path can either be a local path or an Amazon S3 url starting with `s3://`. The URL can start with either `https://` or `http://`. In the latter case, you must have boto3 installed and AWS credentials set up in your environment.
    </ParamField>

    <ParamField path="docset_id" type="str" required>
      The id of the DocSet into which to add the document.
    </ParamField>

    <ParamField body="options" type="str">
      DocParse options to use for partitioning the specified document. You can find more about specific options [here](/sdk-reference/partition#parameters)
    </ParamField>
  </Accordion>

  <Accordion title="Example">
    ```python theme={null}
    doc = client.add_doc(file="/path/to/myfile.pdf", docset_id="your-docset-id")
    ```
  </Accordion>

  <Accordion title="Return Value">
    A `DocumentMetadata` object containing

    <ParamField path="account_id" type="string">
      Account identifier
    </ParamField>

    <ParamField path="doc_id" type="string">
      Document identifier
    </ParamField>

    <ParamField path="docset_id" type="string">
      Document set identifier
    </ParamField>

    <ParamField path="name" type="string">
      Document name
    </ParamField>

    <ParamField path="created_at" type="timestamp">
      Creation timestamp
    </ParamField>

    <ParamField path="size" type="number">
      Document size in bytes
    </ParamField>

    <ParamField path="content_type" type="string">
      MIME type of document
    </ParamField>

    <ParamField path="properties" type="object">
      Custom document properties
    </ParamField>
  </Accordion>

  <Accordion title="Exceptions">
    * `HTTPError 403`: "No Aryn API Key provided"
    * `HTTPError 403`: "Invalid Aryn API key"
    * `HTTPError 403`: "Expired Aryn API key"
    * `HTTPError 404`: "DocSet not found"
    * `HTTPError 5xx`: Internal Server Error
  </Accordion>
</AccordionGroup>

### List Documents

List all documents in a DocSet.

<AccordionGroup>
  <Accordion title="Parameters">
    <ParamField path="docset_id" type="string" required>
      ID of the DocSet containing the documents
    </ParamField>

    <ParamField query="page_size" type="integer" default="100">
      Number of items per page
    </ParamField>

    <ParamField query="page_token" type="string">
      Token for pagination
    </ParamField>
  </Accordion>

  <Accordion title="Example">
    ```python theme={null}
    docs = client.list_docs(docset_id="your-docset-id")
    for doc in docs:
        print(f"Document: {doc.name}")
    ```
  </Accordion>

  <Accordion title="Return Value">
    A paginated list of DocumentMetadata objects, each containing:

    <ParamField path="account_id" type="string">
      Account identifier
    </ParamField>

    <ParamField path="doc_id" type="string">
      Document identifier
    </ParamField>

    <ParamField path="docset_id" type="string">
      Document set identifier
    </ParamField>

    <ParamField path="name" type="string">
      Document name
    </ParamField>

    <ParamField path="created_at" type="timestamp">
      Creation timestamp
    </ParamField>

    <ParamField path="size" type="number">
      Document size in bytes
    </ParamField>

    <ParamField path="content_type" type="string">
      MIME type of document
    </ParamField>

    <ParamField path="properties" type="object">
      Custom document properties
    </ParamField>
  </Accordion>

  <Accordion title="Exceptions">
    * `HTTPError 403`: "No Aryn API Key provided"
    * `HTTPError 403`: "Invalid Aryn API key"
    * `HTTPError 403`: "Expired Aryn API key"
    * `HTTPError 404`: "DocSet not found"
    * `HTTPError 400`: "Invalid filter parameters"
    * `HTTPError 5xx`: Internal Server Error
  </Accordion>
</AccordionGroup>

### Get Document

Get a document by ID.

<AccordionGroup>
  <Accordion title="Parameters">
    <ParamField path="docset_id" type="string" required>
      The unique identifier of the DocSet containing the document
    </ParamField>

    <ParamField path="doc_id" type="string" required>
      The unique identifier of the document to retrieve
    </ParamField>

    <ParamField query="include_elements" type="boolean" default="true">
      Boolean to include document elements
    </ParamField>

    <ParamField query="include_binary" type="boolean" default="false">
      Boolean to include binary data
    </ParamField>
  </Accordion>

  <Accordion title="Example">
    ```python theme={null}
    doc = client.get_doc(docset_id="your-docset-id", doc_id="your-doc-id")
    ```
  </Accordion>

  <Accordion title="Return Value">
    A Document object containing:

    <ParamField path="id" type="string">
      Document identifier
    </ParamField>

    <ParamField path="elements" type="array">
      List of document elements
    </ParamField>

    <ParamField path="properties" type="object">
      Document properties
    </ParamField>

    <ParamField path="binary_data" type="binary">
      Optional binary content of the document
    </ParamField>
  </Accordion>

  <Accordion title="Exceptions">
    * `HTTPError 403`: "No Aryn API Key provided"
    * `HTTPError 403`: "Invalid Aryn API key"
    * `HTTPError 403`: "Expired Aryn API key"
    * `HTTPError 404`: "Document not found"
    * `HTTPError 5xx`: Internal Server Error
  </Accordion>
</AccordionGroup>

### Delete Document

Delete a document by ID.

<AccordionGroup>
  <Accordion title="Parameters">
    <ParamField path="docset_id" type="string" required>
      The unique identifier of the DocSet containing the document
    </ParamField>

    <ParamField path="doc_id" type="string" required>
      The unique identifier of the document to delete
    </ParamField>
  </Accordion>

  <Accordion title="Example">
    ```python theme={null}
    client.delete_doc(docset_id="your-docset-id", doc_id="your-doc-id")
    ```
  </Accordion>

  <Accordion title="Return Value">
    The metadata of the deleted document
  </Accordion>

  <Accordion title="Exceptions">
    * `HTTPError 403`: "No Aryn API Key provided"
    * `HTTPError 403`: "Invalid Aryn API key"
    * `HTTPError 403`: "Expired Aryn API key"
    * `HTTPError 404`: "Document not found"
    * `HTTPError 5xx`: Internal Server Error
  </Accordion>
</AccordionGroup>

### Get Document Binary

Get the binary content of a document.

<AccordionGroup>
  <Accordion title="Parameters">
    <ParamField path="docset_id" type="string" required>
      The unique identifier of the DocSet containing the document
    </ParamField>

    <ParamField path="doc_id" type="string" required>
      The unique identifier of the document to retrieve
    </ParamField>

    <ParamField path="file" type="string" required>
      The file object to write the binary content to
    </ParamField>
  </Accordion>

  <Accordion title="Example">
    ```python theme={null}
    output = "output.pdf"
    client.get_doc_binary(docset_id="your-docset-id", doc_id="your-doc-id", file=output)
    ```
  </Accordion>

  <Accordion title="Return Value">
    The binary content of the document
  </Accordion>

  <Accordion title="Exceptions">
    * `HTTPError 403`: "No Aryn API Key provided"
    * `HTTPError 403`: "Invalid Aryn API key"
    * `HTTPError 403`: "Expired Aryn API key"
    * `HTTPError 404`: "Document not found"
    * `HTTPError 5xx`: Internal Server Error
  </Accordion>
</AccordionGroup>

## Asynchronous Document Functions

### add\_doc\_async

Submit a document for asynchronous add\_doc and get its `task_id`. The results of the task will remain available in the system for 48 hours. Meant to be used with `get_async_result`.
Note: sending multiple asynchronous add\_doc tasks at the same time does not guarantee that they will run simultaneously.

<AccordionGroup>
  <Accordion title="Parameters">
    <ParamField body="file" type="BinaryIO | str | PathLike" required>
      A `file` opened in binary mode or a path specified as either a `str` or `PathLike` instance, or an HTTP URL indicating the document to add. The path can either be a local path or an Amazon S3 url starting with `s3://`. The URL can start with either `https://` or `http://`. In the latter case, you must have boto3 installed and AWS credentials set up in your environment.
    </ParamField>

    <ParamField path="docset_id" type="str" required>
      The id of the DocSet into which to add the document.
    </ParamField>

    <ParamField body="options" type="str">
      DocParse options to use for partitioning the specified document. You can find more about specific options [here](/sdk-reference/partition#parameters)
    </ParamField>
  </Accordion>

  <Accordion title="Example">
    ```python theme={null}
    with open("my-favorite-pdf.pdf", "rb") as f:
        res = client.add_doc_async(file=f, docset_id="your-docset-id")
        print(f"Task ID: {res.task_id}")
        doc_metadata = res.result().value
        print(f"Document ID: {doc_metadata.doc_id}")
    ```
  </Accordion>

  <Accordion title="Return Value">
    A dict containing the `task_id` of the submitted request.

    ```json theme={null}
    {
        "task_id": "aryn:t-47gpd3604e5tz79z1jro5fc"
    }
    ```
  </Accordion>

  <Accordion title="Exceptions">
    User errors:

    * `HTTPError: Error:status_code 403`. Reason: `"This async action requires you to upgrade your account plan"`
    * Fix: Please upgrade your account [here](https://console.aryn.ai/billing)
    * `HTTPError: Error:status_code 403`. Reason: `"No Aryn API Key provided"`
    * Fix: Please provide an API key either as a parameter or specify it in the environment variable `ARYN_API_KEY`.
    * `HTTPError: Error:status_code 403`. Reason: `"Invalid Aryn API key"`
    * Fix: Please provide a valid API key either as a parameter or specify it in the environment variable `ARYN_API_KEY`.
    * `HTTPError: Error:status_code 403`. Reason: `"Expired Aryn API key"`
    * Fix: Please get a new API key [here](https://console.aryn.ai/api-keys).
    * `HTTPError: Error:status_code 429`. Reason: `"Too many requests"`
    * Fix: Please try again after some time. Each account is allowed 1000 tasks to run at a time.

    Other errors:

    * `HTTPError: Error:status_code 5xx`. Reason: `Internal Server Error`
  </Accordion>
</AccordionGroup>

### get\_async\_result

Gets the results of an asynchronous add\_doc task by `task_id`. Meant to be used with `add_doc_async`.

<AccordionGroup>
  <Accordion title="Parameters">
    * `task_id`: Required. A string of the task id to poll and attempt to get the result for.
    * `aryn_api_key`: An Aryn API key, provided as a string. You can get one for free at [aryn.ai/get-started](https://www.aryn.ai/get-started). Default is `None` (If not provided, the sdk will check for it in the environment variable `ARYN_API_KEY` or will look in aryn\_config as specified above).
    * `region`: A string that specifies the region to use for the DocParse server. Valid values are `US` and `None`. Default is `None`, which uses the US region. Via the API, you can specify the region by modifying the base URL of the DocParse server.
    * `aryn_config`: An ArynConfig object (defined in
      [aryn\_sdk/config.py](https://github.com/aryn-ai/sycamore/blob/main/lib/aryn-sdk/aryn_sdk/config.py)), used for finding
      an api key. If `aryn_api_key` is set it will override this. The default ArynConfig looks in the env var `ARYN_API_KEY`
      and then in the file `~/.aryn/config.yaml`. Default is None (aryn-sdk will look in the aryn\_api\_key parameter, in your
      environment variables, and then in `~/.aryn/config.yaml`).
    * `ssl_verify`: A `bool` that controls whether the client verifies the SSL certificate of the chosen DocParse server.
      ssl\_verify is `True` by default, enforcing SSL verification.
  </Accordion>

  <Accordion title="Example">
    ```python theme={null}
    import time

    with open("/path/to/pdf", "rb") as f:
        res = client.add_doc_async(file=f, docset_id=docset_id)
        task_id = res.task_id

    while True:
        result = client.get_async_result(task_id)
        if result.status_code == 202:
            print("Task still pending...")
        else:
            print(f"Task completed with status code: {result.status_code}")
            print(f"Result: {result.value}")
            break
        time.sleep(1)
    ```
  </Accordion>

  <Accordion title="Return Value">
    A dict like the one in the example below containing "task\_status". When "task\_status" is "done", the returned
    dict also contains "result" which contains what would have been returned had `add_doc` been called directly. If there is an error with ingesting the file itself, then the "task\_status" will still be "done" but the
    "result" will contain an "error" field indicating what went wrong.

    "task\_status" can be "done" or "pending". <br />

    ```json theme={null}
    {
        "task_status":"done",
        "result": ...
    }
    ```
  </Accordion>

  <Accordion title="Exceptions">
    User errors:

    * `HTTPError: Error:status_code 403`. Reason: `"This async action requires you to upgrade your account plan"`
    * Fix: Please upgrade your account [here](https://console.aryn.ai/billing)
    * `HTTPError: Error:status_code 403`. Reason: `"No Aryn API Key provided"`
    * Fix: Please provide an API key either as a parameter or specify it in the environment variable `ARYN_API_KEY`.
    * `HTTPError: Error:status_code 403`. Reason: `"Invalid Aryn API key"`
    * Fix: Please provide a valid API key either as a parameter or specify it in the environment variable `ARYN_API_KEY`.
    * `HTTPError: Error:status_code 403`. Reason: `"Expired Aryn API key"`
    * Fix: Please get a new API key [here](https://console.aryn.ai/api-keys).
    * `aryn_sdk.partition.partition.PartitionTaskNotFoundError`. Reason: `"No such task"`
    * Fix: Check to make sure the task\_id specified is correct.

    Other errors:

    * `HTTPError: Error:status_code 5xx`. Reason: `Internal Server Error`
  </Accordion>
</AccordionGroup>

### cancel\_async\_task

Cancels the task associated with the task\_id specified.

<AccordionGroup>
  <Accordion title="Parameters">
    * `task_id`: Required. A string of the task id to cancel.
    * `aryn_api_key`: An Aryn API key, provided as a string. You can get one for free at [aryn.ai/get-started](https://www.aryn.ai/get-started). Default is `None` (If not provided, the sdk will check for it in the environment variable `ARYN_API_KEY` or will look in aryn\_config as specified above).
    * `region`: A string that specifies the region to use for the DocParse server. Valid values are `US` and `None`. Default is `None`, which uses the US region. Via the API, you can specify the region by modifying the base URL of the DocParse server.
    * `aryn_config`: An ArynConfig object (defined in
      [aryn\_sdk/config.py](https://github.com/aryn-ai/sycamore/blob/main/lib/aryn-sdk/aryn_sdk/config.py)), used for finding
      an api key. If `aryn_api_key` is set it will override this. The default ArynConfig looks in the env var `ARYN_API_KEY`
      and then in the file `~/.aryn/config.yaml`. Default is None (aryn-sdk will look in the aryn\_api\_key parameter, in your
      environment variables, and then in `~/.aryn/config.yaml`).
    * `ssl_verify`: A `bool` that controls whether the client verifies the SSL certificate of the chosen DocParse server.
      ssl\_verify is `True` by default, enforcing SSL verification.
  </Accordion>

  <Accordion title="Example">
    ```python theme={null}
    with open("/path/to/pdf", "rb") as f:
        task = client.add_doc_async(file=f, docset_id=docset_id)
        task_id = task.task_id
        print(f"Cancelling task {task_id}")
        res = client.cancel_async_task(task)
        if res.status_code == 200:
            print("Cancel successful.")
    ```
  </Accordion>

  <Accordion title="Return Value">
    No return value. Asynchronous tasks may only be successfully cancelled once. Once a task has been
    cancelled, any `get_async_result` calls using that task's id will throw an exception.
  </Accordion>

  <Accordion title="Exceptions">
    User errors:

    * `HTTPError: Error:status_code 403`. Reason: `"This async action requires you to upgrade your account plan"`
    * Fix: Please upgrade your account [here](https://console.aryn.ai/billing)
    * `HTTPError: Error:status_code 403`. Reason: `"No Aryn API Key provided"`
    * Fix: Please provide an API key either as a parameter or specify it in the environment variable `ARYN_API_KEY`.
    * `HTTPError: Error:status_code 403`. Reason: `"Invalid Aryn API key"`
    * Fix: Please provide a valid API key either as a parameter or specify it in the environment variable `ARYN_API_KEY`.
    * `HTTPError: Error:status_code 403`. Reason: `"Expired Aryn API key"`
    * Fix: Please get a new API key [here](https://console.aryn.ai/api-keys).
    * `aryn_sdk.partition.partition.PartitionTaskNotFoundError`. Reason: `"No such task"`
    * Fix: Check to make sure the task\_id specified is correct.

    Other errors:

    * `HTTPError: Error:status_code 5xx`. Reason: `Internal Server Error`
  </Accordion>
</AccordionGroup>

### list\_async\_tasks

Lists all the add\_doc tasks still running in your account.

<AccordionGroup>
  <Accordion title="Parameters">
    * `aryn_api_key`: An Aryn API key, provided as a string. You can get one for free at [aryn.ai/get-started](https://www.aryn.ai/get-started). Default is `None` (If not provided, the sdk will check for it in the environment variable `ARYN_API_KEY` or will look in aryn\_config as specified above).
    * `region`: A string that specifies the region to use for the DocParse server. Valid values are `US` and `None`. Default is `None`, which uses the US region. Via the API, you can specify the region by modifying the base URL of the DocParse server.
    * `aryn_config`: An ArynConfig object (defined in
      [aryn\_sdk/config.py](https://github.com/aryn-ai/sycamore/blob/main/lib/aryn-sdk/aryn_sdk/config.py)), used for finding
      an api key. If `aryn_api_key` is set it will override this. The default ArynConfig looks in the env var `ARYN_API_KEY`
      and then in the file `~/.aryn/config.yaml`. Default is None (aryn-sdk will look in the aryn\_api\_key parameter, in your
      environment variables, and then in `~/.aryn/config.yaml`).
    * `ssl_verify`: A `bool` that controls whether the client verifies the SSL certificate of the chosen DocParse server.
      ssl\_verify is `True` by default, enforcing SSL verification.
  </Accordion>

  <Accordion title="Example">
    ```python theme={null}
    tasks = client.list_async_tasks().value
    print(tasks.tasks)
    ```
  </Accordion>

  <Accordion title="Return Value">
    A dict like the one below which maps task\_ids to a dict containing details of the respective task.

    ```json theme={null}
    {
        "aryn:t-sc0v0lglkauo774pioflp4l": {
        "task_status": "pending"
    },
        "aryn:t-b9xp7ny0eejvqvbazjhg8rn": {
        "task_status": "pending"
    }
    }
    ```
  </Accordion>

  <Accordion title="Exceptions">
    User errors:

    * `HTTPError: Error:status_code 403`. Reason: `"This async action requires you to upgrade your account plan"`
    * Fix: Please upgrade your account [here](https://console.aryn.ai/billing)
    * `HTTPError: Error:status_code 403`. Reason: `"No Aryn API Key provided"`
    * Fix: Please provide an API key either as a parameter or specify it in the environment variable `ARYN_API_KEY`.
    * `HTTPError: Error:status_code 403`. Reason: `"Invalid Aryn API key"`
    * Fix: Please provide a valid API key either as a parameter or specify it in the environment variable `ARYN_API_KEY`.
    * `HTTPError: Error:status_code 403`. Reason: `"Expired Aryn API key"`
    * Fix: Please get a new API key [here](https://console.aryn.ai/api-keys).

    Other errors:

    * `HTTPError: Error:status_code 5xx`. Reason: `Internal Server Error`
  </Accordion>
</AccordionGroup>

## Properties Functions

Functions for managing document properties.

### Update Document Properties

Update properties of a document.

<AccordionGroup>
  <Accordion title="Parameters">
    <ParamField path="docset_id" type="string" required>
      The unique identifier of the DocSet containing the document
    </ParamField>

    <ParamField path="doc_id" type="string" required>
      The unique identifier of the document to update
    </ParamField>

    <ParamField body="updates" type="array" required>
      List of ReplaceOperation objects defining property updates
    </ParamField>
  </Accordion>

  <Accordion title="Example">
    ```python theme={null}
    from aryn_sdk.types import ReplaceOperation

    updates = [
        ReplaceOperation(
            path="/properties/status",
            value="reviewed"
        )
    ]
    client.update_doc_properties(
        docset_id="your-docset-id",
        doc_id="your-doc-id",
        operations=updates
    )
    ```
  </Accordion>

  <Accordion title="Return Value">
    The updated Document object containing:

    <ParamField path="id" type="string">
      Document identifier
    </ParamField>

    <ParamField path="elements" type="array">
      List of document elements
    </ParamField>

    <ParamField path="properties" type="object">
      Document properties
    </ParamField>

    <ParamField path="binary_data" type="binary">
      Optional binary content of the document
    </ParamField>
  </Accordion>

  <Accordion title="Exceptions">
    * `HTTPError 403`: "No Aryn API Key provided"
    * `HTTPError 403`: "Invalid Aryn API key"
    * `HTTPError 403`: "Expired Aryn API key"
    * `HTTPError 404`: "Document not found"
    * `HTTPError 5xx`: Internal Server Error
  </Accordion>
</AccordionGroup>

### Extract Properties

Extract properties from a document.

<AccordionGroup>
  <Accordion title="Parameters">
    <ParamField path="docset_id" type="string" required>
      The unique identifier of the DocSet containing the documents
    </ParamField>

    <ParamField body="schema" type="object" required>
      Schema object defining properties to extract
    </ParamField>
  </Accordion>

  <Accordion title="Example">
    ```python theme={null}
    from aryn_sdk.types.schema import Schema, SchemaField

    schema = Schema(fields=[
        SchemaField(name="category", field_type="string")
    ])
    client.extract_properties(docset_id="your-docset-id", schema=schema)
    ```
  </Accordion>

  <Accordion title="Return Value">
    A job status object containing:

    * `exit_status`: The exit status of the job
  </Accordion>

  <Accordion title="Exceptions">
    * `HTTPError 403`: "No Aryn API Key provided"
    * `HTTPError 403`: "Invalid Aryn API key"
    * `HTTPError 403`: "Expired Aryn API key"
    * `HTTPError 404`: "DocSet not found"
    * `HTTPError 5xx`: Internal Server Error
  </Accordion>
</AccordionGroup>

### Delete Properties

Delete properties from a document.

<AccordionGroup>
  <Accordion title="Parameters">
    <ParamField path="docset_id" type="string" required>
      The unique identifier of the DocSet containing the documents
    </ParamField>

    <ParamField body="schema" type="object" required>
      Schema object defining properties to delete
    </ParamField>
  </Accordion>

  <Accordion title="Example">
    ```python theme={null}
    client.delete_properties(docset_id="your-docset-id", schema=schema)
    ```
  </Accordion>

  <Accordion title="Return Value">
    A job status object
  </Accordion>

  <Accordion title="Exceptions">
    * `HTTPError 403`: "No Aryn API Key provided"
    * `HTTPError 403`: "Invalid Aryn API key"
    * `HTTPError 403`: "Expired Aryn API key"
    * `HTTPError 404`: "DocSet not found"
    * `HTTPError 5xx`: Internal Server Error
  </Accordion>
</AccordionGroup>

## Client Options

<AccordionGroup>
  <Accordion title="Parameters">
    * `region`: A string that specifies the region to use for the DocParse server. Valid values are `US` and `None`. Default is `None`.
    * `timeout`: A float that specifies the timeout in seconds for the client. Default is `240.0`.
  </Accordion>

  <Accordion title="Example">
    ```python theme={null}
    from aryn_sdk.client import Client
    client = Client(region="US", timeout=240.0)
    ```
  </Accordion>
</AccordionGroup>
