# core.v2.DocumentsApi

All URIs are relative to */v2*

Method | HTTP request | Description
------------- | ------------- | -------------
[**create_document**](DocumentsApi.md#create_document) | **POST** /documents/ | Create document
[**deleted_document**](DocumentsApi.md#deleted_document) | **DELETE** /documents/{id} | Deleted document
[**get_document**](DocumentsApi.md#get_document) | **GET** /documents/{id}/download/ | Get document
[**get_document_pages**](DocumentsApi.md#get_document_pages) | **GET** /documents/{id}/pages | Get document pages
[**list_document**](DocumentsApi.md#list_document) | **GET** /documents/ | List document
[**update_document**](DocumentsApi.md#update_document) | **PATCH** /documents/{id} | Update document


# **create_document**
> object create_document(file, applicant, document_type, x_eaz_account_id=x_eaz_account_id)

Create document

Upload a Document for Analysis.

This endpoint allows the authenticated user to upload a document for analysis
associated with a specific applicant. Supported document formats include PDF and
image formats (JPEG, PNG), and the uploaded file is stored for processing.

**Apple's HEIC format is not supported**

## Authentication:
- Requires a valid OAuth access token with the following scopes:
  - `document:write`
  - Or one of the internal scopes: `org:staff`, `org:admin`, `admin`
  - Public scopes may also be included.

## Parameters:
- **file** (required, form): The document file to upload. Supported formats:
  - `application/pdf`
  - `image/jpeg`
  - `image/png`
- **applicant** (required, form): The unique identifier (UUID) of the applicant
  to whom the document is associated.
- **document_type** (required, form): The unique identifier (UUID) representing
  the type of document being uploaded.

## Response:
- **201 Created**: Returns the details of the uploaded document, including
  its storage reference and metadata.
- **404 Not Found**: If the applicant or the document type associated with the
  provided ID cannot be found.
- **400 Bad Request**: If the uploaded file is of an unsupported format or
  if any of the required parameters are missing.
- **413 Payload Too Large**: If the uploaded file exceeds the maximum size limit
  of 50 MB.
- **403 Forbidden**: If the user does not have the necessary permissions
  to upload the document.

### Example

* Api Key Authentication (APIKeyHeader):
* OAuth Authentication (OAuth2):

```python
import core.v2
from core.v2.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to /v2
# See configuration.py for a list of all supported configuration parameters.
configuration = core.v2.Configuration(
    host = "/v2"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: APIKeyHeader
configuration.api_key['APIKeyHeader'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['APIKeyHeader'] = 'Bearer'

configuration.access_token = os.environ["ACCESS_TOKEN"]

# Enter a context with an instance of the API client
with core.v2.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = core.v2.DocumentsApi(api_client)
    file = None # bytearray | 
    applicant = 'applicant_example' # str | 
    document_type = 'document_type_example' # str | 
    x_eaz_account_id = 'x_eaz_account_id_example' # str | The default is always the organization of the requesting user. If you like to get/set a result of another organization include the header. Make sure the user has permission to access the requested data. (optional)

    try:
        # Create document
        api_response = api_instance.create_document(file, applicant, document_type, x_eaz_account_id=x_eaz_account_id)
        print("The response of DocumentsApi->create_document:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling DocumentsApi->create_document: %s\n" % e)
```



### Parameters


Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **file** | **bytearray**|  | 
 **applicant** | **str**|  | 
 **document_type** | **str**|  | 
 **x_eaz_account_id** | **str**| The default is always the organization of the requesting user. If you like to get/set a result of another organization include the header. Make sure the user has permission to access the requested data. | [optional] 

### Return type

**object**

### Authorization

[APIKeyHeader](../README.md#APIKeyHeader), [OAuth2](../README.md#OAuth2)

### HTTP request headers

 - **Content-Type**: multipart/form-data
 - **Accept**: application/json

### HTTP response details

| Status code | Description | Response headers |
|-------------|-------------|------------------|
**201** | Successful Response |  -  |
**422** | Validation Error |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **deleted_document**
> object deleted_document(id, x_eaz_account_id=x_eaz_account_id)

Deleted document

Delete a Document.

This endpoint allows the authenticated user to delete a specific document
associated with their organization. The document ID must be provided to identify
which document to delete.

## Authentication:
- Requires a valid OAuth access token with the following scopes:
  - `document:write`
  - Or one of the internal scopes: `org:staff`, `org:admin`, `admin`
  - Public scopes may also be included.

## Parameters:
- **id** (required, path): The unique identifier (UUID) of the document to be
   deleted.

## Response:
- **204 No Content**: Indicates that the document has been successfully deleted.
- **404 Not Found**: If the document with the provided ID cannot be found.
- **403 Forbidden**: If the user does not have the necessary permissions
  to delete the document.

### Example

* Api Key Authentication (APIKeyHeader):
* OAuth Authentication (OAuth2):

```python
import core.v2
from core.v2.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to /v2
# See configuration.py for a list of all supported configuration parameters.
configuration = core.v2.Configuration(
    host = "/v2"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: APIKeyHeader
configuration.api_key['APIKeyHeader'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['APIKeyHeader'] = 'Bearer'

configuration.access_token = os.environ["ACCESS_TOKEN"]

# Enter a context with an instance of the API client
with core.v2.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = core.v2.DocumentsApi(api_client)
    id = 'id_example' # str | 
    x_eaz_account_id = 'x_eaz_account_id_example' # str | The default is always the organization of the requesting user. If you like to get/set a result of another organization include the header. Make sure the user has permission to access the requested data. (optional)

    try:
        # Deleted document
        api_response = api_instance.deleted_document(id, x_eaz_account_id=x_eaz_account_id)
        print("The response of DocumentsApi->deleted_document:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling DocumentsApi->deleted_document: %s\n" % e)
```



### Parameters


Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **id** | **str**|  | 
 **x_eaz_account_id** | **str**| The default is always the organization of the requesting user. If you like to get/set a result of another organization include the header. Make sure the user has permission to access the requested data. | [optional] 

### Return type

**object**

### Authorization

[APIKeyHeader](../README.md#APIKeyHeader), [OAuth2](../README.md#OAuth2)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json

### HTTP response details

| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Successful Response |  -  |
**422** | Validation Error |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **get_document**
> get_document(id, x_eaz_account_id=x_eaz_account_id)

Get document

### Example

* Api Key Authentication (APIKeyHeader):
* OAuth Authentication (OAuth2):

```python
import core.v2
from core.v2.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to /v2
# See configuration.py for a list of all supported configuration parameters.
configuration = core.v2.Configuration(
    host = "/v2"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: APIKeyHeader
configuration.api_key['APIKeyHeader'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['APIKeyHeader'] = 'Bearer'

configuration.access_token = os.environ["ACCESS_TOKEN"]

# Enter a context with an instance of the API client
with core.v2.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = core.v2.DocumentsApi(api_client)
    id = 'id_example' # str | 
    x_eaz_account_id = 'x_eaz_account_id_example' # str | The default is always the organization of the requesting user. If you like to get/set a result of another organization include the header. Make sure the user has permission to access the requested data. (optional)

    try:
        # Get document
        api_instance.get_document(id, x_eaz_account_id=x_eaz_account_id)
    except Exception as e:
        print("Exception when calling DocumentsApi->get_document: %s\n" % e)
```



### Parameters


Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **id** | **str**|  | 
 **x_eaz_account_id** | **str**| The default is always the organization of the requesting user. If you like to get/set a result of another organization include the header. Make sure the user has permission to access the requested data. | [optional] 

### Return type

void (empty response body)

### Authorization

[APIKeyHeader](../README.md#APIKeyHeader), [OAuth2](../README.md#OAuth2)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json

### HTTP response details

| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Successful Response |  -  |
**422** | Validation Error |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **get_document_pages**
> object get_document_pages(id, x_eaz_account_id=x_eaz_account_id)

Get document pages

Retrieve Document Pages.

This endpoint allows the authenticated user to retrieve the pages (images)
associated with a specific document. The document ID must be provided to
identify which document's pages to retrieve.

## Authentication:
- Requires a valid OAuth access token with the following scopes:
  - `document:read`
  - Or one of the internal scopes: `org:staff`, `org:admin`, `admin`
  - Public scopes may also be included.

## Parameters:
- **id** (required, path): The unique identifier (UUID) of the document for
  which the pages are to be retrieved.

## Response:
- **200 OK**: Returns a list of images representing the pages of the specified
  document.
- **404 Not Found**: If the document with the provided ID cannot be found.
- **403 Forbidden**: If the user does not have the necessary permissions
  to access the document pages.

### Example

* Api Key Authentication (APIKeyHeader):
* OAuth Authentication (OAuth2):

```python
import core.v2
from core.v2.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to /v2
# See configuration.py for a list of all supported configuration parameters.
configuration = core.v2.Configuration(
    host = "/v2"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: APIKeyHeader
configuration.api_key['APIKeyHeader'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['APIKeyHeader'] = 'Bearer'

configuration.access_token = os.environ["ACCESS_TOKEN"]

# Enter a context with an instance of the API client
with core.v2.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = core.v2.DocumentsApi(api_client)
    id = 'id_example' # str | 
    x_eaz_account_id = 'x_eaz_account_id_example' # str | The default is always the organization of the requesting user. If you like to get/set a result of another organization include the header. Make sure the user has permission to access the requested data. (optional)

    try:
        # Get document pages
        api_response = api_instance.get_document_pages(id, x_eaz_account_id=x_eaz_account_id)
        print("The response of DocumentsApi->get_document_pages:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling DocumentsApi->get_document_pages: %s\n" % e)
```



### Parameters


Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **id** | **str**|  | 
 **x_eaz_account_id** | **str**| The default is always the organization of the requesting user. If you like to get/set a result of another organization include the header. Make sure the user has permission to access the requested data. | [optional] 

### Return type

**object**

### Authorization

[APIKeyHeader](../README.md#APIKeyHeader), [OAuth2](../README.md#OAuth2)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json

### HTTP response details

| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Successful Response |  -  |
**422** | Validation Error |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **list_document**
> PaginatedResponseDocumentView list_document(limit=limit, offset=offset, rental_file=rental_file, applicant=applicant, x_eaz_account_id=x_eaz_account_id)

List document

List Documents.

This endpoint allows the authenticated user to retrieve a list of documents
associated with their organization or specific applicants. The response includes
metadata for each document, such as the document ID, type, upload date, and
associated applicant details.

*Note: This is a virtual view based on the uploaded files. To access all raw uploads
  look at `uploads`*

## Authentication:
- Requires a valid OAuth access token with the following scopes:
  - `document:read`
  - Or one of the internal scopes: `org:staff`, `org:admin`, `admin`
  - Public scopes may also be included.

## Response:
- **200 OK**: Returns a list of documents with their details.
- **403 Forbidden**: If the user does not have the necessary permissions to
  access the documents.

### Example

* Api Key Authentication (APIKeyHeader):
* OAuth Authentication (OAuth2):

```python
import core.v2
from core.v2.models.paginated_response_document_view import PaginatedResponseDocumentView
from core.v2.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to /v2
# See configuration.py for a list of all supported configuration parameters.
configuration = core.v2.Configuration(
    host = "/v2"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: APIKeyHeader
configuration.api_key['APIKeyHeader'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['APIKeyHeader'] = 'Bearer'

configuration.access_token = os.environ["ACCESS_TOKEN"]

# Enter a context with an instance of the API client
with core.v2.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = core.v2.DocumentsApi(api_client)
    limit = 10 # int |  (optional) (default to 10)
    offset = 0 # int |  (optional) (default to 0)
    rental_file = 'rental_file_example' # str |  (optional)
    applicant = 'applicant_example' # str |  (optional)
    x_eaz_account_id = 'x_eaz_account_id_example' # str | The default is always the organization of the requesting user. If you like to get/set a result of another organization include the header. Make sure the user has permission to access the requested data. (optional)

    try:
        # List document
        api_response = api_instance.list_document(limit=limit, offset=offset, rental_file=rental_file, applicant=applicant, x_eaz_account_id=x_eaz_account_id)
        print("The response of DocumentsApi->list_document:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling DocumentsApi->list_document: %s\n" % e)
```



### Parameters


Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **limit** | **int**|  | [optional] [default to 10]
 **offset** | **int**|  | [optional] [default to 0]
 **rental_file** | **str**|  | [optional] 
 **applicant** | **str**|  | [optional] 
 **x_eaz_account_id** | **str**| The default is always the organization of the requesting user. If you like to get/set a result of another organization include the header. Make sure the user has permission to access the requested data. | [optional] 

### Return type

[**PaginatedResponseDocumentView**](PaginatedResponseDocumentView.md)

### Authorization

[APIKeyHeader](../README.md#APIKeyHeader), [OAuth2](../README.md#OAuth2)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json

### HTTP response details

| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Successful Response |  -  |
**422** | Validation Error |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **update_document**
> object update_document(id, x_eaz_account_id=x_eaz_account_id)

Update document

Update an Existing Document.

This endpoint allows the authenticated user to update the details of an existing
document associated with a specific applicant. The document ID must be provided
to identify which document to update.

## Authentication:
- Requires a valid OAuth access token with the following scopes:
  - `document:write`
  - Or one of the internal scopes: `org:staff`, `org:admin`, `admin`
  - Public scopes may also be included.

## Parameters:
- **id** (required, path): The unique identifier (UUID) of the document to be
   updated.

## Response:
- **200 OK**: Returns the updated details of the document, confirming the changes.
- **404 Not Found**: If the document with the provided ID cannot be found.
- **403 Forbidden**: If the user does not have the necessary permissions to update
   the document.

### Example

* Api Key Authentication (APIKeyHeader):
* OAuth Authentication (OAuth2):

```python
import core.v2
from core.v2.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to /v2
# See configuration.py for a list of all supported configuration parameters.
configuration = core.v2.Configuration(
    host = "/v2"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: APIKeyHeader
configuration.api_key['APIKeyHeader'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['APIKeyHeader'] = 'Bearer'

configuration.access_token = os.environ["ACCESS_TOKEN"]

# Enter a context with an instance of the API client
with core.v2.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = core.v2.DocumentsApi(api_client)
    id = 'id_example' # str | 
    x_eaz_account_id = 'x_eaz_account_id_example' # str | The default is always the organization of the requesting user. If you like to get/set a result of another organization include the header. Make sure the user has permission to access the requested data. (optional)

    try:
        # Update document
        api_response = api_instance.update_document(id, x_eaz_account_id=x_eaz_account_id)
        print("The response of DocumentsApi->update_document:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling DocumentsApi->update_document: %s\n" % e)
```



### Parameters


Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **id** | **str**|  | 
 **x_eaz_account_id** | **str**| The default is always the organization of the requesting user. If you like to get/set a result of another organization include the header. Make sure the user has permission to access the requested data. | [optional] 

### Return type

**object**

### Authorization

[APIKeyHeader](../README.md#APIKeyHeader), [OAuth2](../README.md#OAuth2)

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: application/json

### HTTP response details

| Status code | Description | Response headers |
|-------------|-------------|------------------|
**200** | Successful Response |  -  |
**422** | Validation Error |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

