<commit_before>FORMAT: 1A

# docgen
API allows you to generate multiple docx documents using specified template and data

# Generation

For all following actions, API key specified in HTTP header is required.

## Template [/api/v1/template]
### Upload template [POST]

Creates new template. Returns its ID and MD5 checksum.

+ Request
    
    + Headers
        
            X-Auth: API key

+ Attributes
    + file (required, array) - POST file type

+ Request (application/x-www-form-urlencoded)

+ Response 200 (application/json)

        {
            "template_id": 10,
            "md5": "09f5f87a3bf63e32a8325b9202a5ed78"
        }
 
+ Response 401
        
        {
            "error": "API key is invalid."
        }

+ Response 500 (application/json)

        {
            "error_id": 1,
            "error": "File is too big."
        }

### Delete template [GET /api/v1/template/{template_id}]

Deletes template pernamently.

+ Request
    
    + Headers
    
            X-Auth: API key

+ Parameters
    + template_id (required, number) - template ID

+ Response 200 (application/json)
 
+ Response 401
        
        {
            "error": "API key is invalid."
        }

+ Response 404
        
        {
            "error": "Template ID is invalid."
        }



## Requests [/api/v1/request]
### Create request [POST]

Creates new request. Returns its ID.

+ Request
    
    + Headers<commit_msg>Transferring blueprint from apiary.io<commit_after>FORMAT: 1A

# docgen
API allows you to generate multiple docx documents using specified template and data

# Generation

For all following actions, API key specified in HTTP header is required.

## Template [/api/v1/template]
### Upload template [POST]

Creates new template. Returns its ID and MD5 checksum.

+ Request
    
    + Headers
        
            X-Auth: API key

+ Attributes
    + file (required, array) - POST file type

+ Request (application/x-www-form-urlencoded)

+ Response 200 (application/json)

        {
            "template_id": 10,
            "md5": "09f5f87a3bf63e32a8325b9202a5ed78"
        }
 
+ Response 401 (application/json)
        
        {
            "error": "API key is invalid."
        }

+ Response 500 (application/json)

        {
            "error_id": 1,
            "error": "File is too big."
        }

### Delete template [GET /api/v1/template/{template_id}]

Deletes template pernamently.

+ Request
    
    + Headers
    
            X-Auth: API key

+ Parameters
    + template_id (required, number) - template ID

+ Response 200 (application/json)
 
+ Response 401 (application/json)
        
        {
            "error": "API key is invalid."
        }

+ Response 404 (application/json)
        
        {
            "error": "Template ID is invalid."
        }



## Requests [/api/v1/request]
### Create request [POST]

Creates new request. Returns its ID.

+ Request
    
    + Headers
{'fraction_non_alphanumeric': 0.09846153846153846, 'fraction_numerical': 0.03282051282051282, 'mean_word_length': 1.9766022380467956, 'pattern_counts': {'":': 14, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '44565', 'n_tokens_mistral': 954, 'n_tokens_neox': 875, 'n_words': 263}