---
description: This document describes the supported REST API endpoints
---

# API

All REST API endpoint are accessible via your environment subdomain endpoint, e.g: `https://acme.cedalio.dev/api/v1`

## Authentication

Authentication is done via Basic Auth

## Error response

All errors are return with the following format:

```json
{
  "errors": [
    {
      "code": "resource_validation_error",
      "message": "The resource could not be modified because is not valid",
      "context": [
        {
          "field": "processable_data_type",
          "errors": [
            "can't be blank"
          ]
        }
      ]
    }
  ]
}
```

Where each error object has the following fields:

* `code` A string representing a human readable error code
* `message` A string containing the error message
* `context` An optional object or array whose content depends on the type of error being returned that adds more contextual information about the error

## Resources

### Files batches

#### Create a files batch

_Example cURL_

```bash
curl -v -u BASIC_AUTH_USER:BASIC_AUTH_PASSWORD "https://COMPANY_ID.cedalio.dev/api/v1/files_batches" \
    -H "Content-Type: application/json" \
    -XPOST \
    -d '{"files_batch": {"name": "testing batch via API", "processable_data_type": "utility_bill"}}' | jq
```

_Example response_

```json
{
  "id": "018fe586-0cd3-7ef4-9bfc-32c8d90684ac",
  "name": "testing batch via API",
  "url": "https://COMPANY_ID.cedalio.dev/api/v1/files_batches/018fe586-0cd3-7ef4-9bfc-32c8d90684ac",
  "inserted_at": "2024-06-04T23:11:58Z",
  "is_editable": true,
  "is_finalized": false,
  "processable_data_type": "utility_bill",
  "total_files": 0,
  "processed_files": 0,
  "failed_processed_files": 0,
  "pending_processing_files": 0,
  "updated_at": "2024-06-04T23:11:58Z",
  "files_url": "https://COMPANY_ID.cedalio.dev/api/v1/files_batches/018fe586-0cd3-7ef4-9bfc-32c8d90684ac/files",
  "finalize_url": "https://COMPANY_ID.cedalio.dev/api/v1/files_batches/018fe586-0cd3-7ef4-9bfc-32c8d90684ac/finalize",
  "processed_data_url": "https://COMPANY_ID.cedalio.dev/api/v1/files_batches/018fe586-0cd3-7ef4-9bfc-32c8d90684ac/processed_data"
}
```

#### Fetch a files batch

_Example cURL_

```bash
curl -v -u BASIC_AUTH_USER:BASIC_AUTH_PASSWORD "https://COMPANY_ID.cedalio.dev/api/v1/files_batches/018fe586-0cd3-7ef4-9bfc-32c8d90684ac" | jq
```

_Example response_

```json
{
  "id": "018fe586-0cd3-7ef4-9bfc-32c8d90684ac",
  "name": "testing batch via API",
  "url": "https://COMPANY_ID.cedalio.dev/api/v1/files_batches/018fe586-0cd3-7ef4-9bfc-32c8d90684ac",
  "inserted_at": "2024-06-04T23:11:58Z",
  "is_editable": true,
  "is_finalized": false,
  "processable_data_type": "utility_bill",
  "total_files": 2,
  "processed_files": 2,
  "failed_processed_files": 0,
  "pending_processing_files": 0,
  "updated_at": "2024-06-04T23:11:58Z",
  "files_url": "https://COMPANY_ID.cedalio.dev/api/v1/files_batches/018fe586-0cd3-7ef4-9bfc-32c8d90684ac/files",
  "finalize_url": "https://COMPANY_ID.cedalio.dev/api/v1/files_batches/018fe586-0cd3-7ef4-9bfc-32c8d90684ac/finalize",
  "processed_data_url": "https://COMPANY_ID.cedalio.dev/api/v1/files_batches/018fe586-0cd3-7ef4-9bfc-32c8d90684ac/processed_data"
}
```

#### Update a batch

_Example cURL_

```bash
curl -v -u BASIC_AUTH_USER:BASIC_AUTH_PASSWORD "https://COMPANY_ID.cedalio.dev/api/v1/files_batches/018fe586-0cd3-7ef4-9bfc-32c8d90684ac" \
  -X PATCH \
  -H 'Content-Type: application/json' \
  -d '{ "files_batch": { "name" : "new batch name" }}' | jq
```

_Example response_

```json
{
  "id": "018fe586-0cd3-7ef4-9bfc-32c8d90684ac",
  "name": "new batch name",
  "url": "https://COMPANY_ID.cedalio.dev/api/v1/files_batches/018fe586-0cd3-7ef4-9bfc-32c8d90684ac",
  "inserted_at": "2024-06-04T23:11:58Z",
  "is_editable": true,
  "is_finalized": false,
  "processable_data_type": "utility_bill",
  "total_files": 2,
  "processed_files": 2,
  "failed_processed_files": 0,
  "pending_processing_files": 0,
  "updated_at": "2024-06-05T00:25:16Z",
  "files_url": "https://COMPANY_ID.cedalio.dev/api/v1/files_batches/018fe586-0cd3-7ef4-9bfc-32c8d90684ac/files",
  "finalize_url": "https://COMPANY_ID.cedalio.dev/api/v1/files_batches/018fe586-0cd3-7ef4-9bfc-32c8d90684ac/finalize",
  "processed_data_url": "https://COMPANY_ID.cedalio.dev/api/v1/files_batches/018fe586-0cd3-7ef4-9bfc-32c8d90684ac/processed_data"
}
```

#### Fetch all files batches

_Example cURL_

```bash
curl -v -u BASIC_AUTH_USER:BASIC_AUTH_PASSWORD "https://COMPANY_ID.cedalio.dev/api/v1/files_batches" | jq
```

_Example response_

```json
[
  {
    "id": "018fe487-a33c-7be7-a54f-38141fa69603",
    "name": "testing batch via API",
    "url": "https://COMPANY_ID.cedalio.dev/api/v1/files_batches/018fe487-a33c-7be7-a54f-38141fa69603",
    "inserted_at": "2024-06-04T18:34:05Z",
    "is_editable": true,
    "is_finalized": false,
    "processable_data_type": "utility_bill",
    "total_files": 2,
    "processed_files": 2,
    "failed_processed_files": 0,
    "pending_processing_files": 0,
    "updated_at": "2024-06-04T18:34:05Z",
    "files_url": "https://COMPANY_ID.cedalio.dev/api/v1/files_batches/018fe487-a33c-7be7-a54f-38141fa69603/files",
    "finalize_url": "https://COMPANY_ID.cedalio.dev/api/v1/files_batches/018fe487-a33c-7be7-a54f-38141fa69603/finalize",
    "processed_data_url": "https://COMPANY_ID.cedalio.dev/api/v1/files_batches/018fe487-a33c-7be7-a54f-38141fa69603/processed_data"
  },
  {
    "id": "018fe4c4-11a9-7e76-b753-da48f15b0d59",
    "name": "testing batch via API",
    "url": "https://COMPANY_ID.cedalio.dev/api/v1/files_batches/018fe4c4-11a9-7e76-b753-da48f15b0d59",
    "inserted_at": "2024-06-04T19:40:05Z",
    "is_editable": true,
    "is_finalized": false,
    "processable_data_type": "utility_bill",
    "total_files": 2,
    "processed_files": 2,
    "failed_processed_files": 0,
    "pending_processing_files": 0,
    "updated_at": "2024-06-04T19:40:05Z",
    "files_url": "https://COMPANY_ID.cedalio.dev/api/v1/files_batches/018fe4c4-11a9-7e76-b753-da48f15b0d59/files",
    "finalize_url": "https://COMPANY_ID.cedalio.dev/api/v1/files_batches/018fe4c4-11a9-7e76-b753-da48f15b0d59/finalize",
    "processed_data_url": "https://COMPANY_ID.cedalio.dev/api/v1/files_batches/018fe4c4-11a9-7e76-b753-da48f15b0d59/processed_data"
  },
  {
    "id": "018fe586-0cd3-7ef4-9bfc-32c8d90684ac",
    "name": "testing batch via API",
    "url": "https://COMPANY_ID.cedalio.dev/api/v1/files_batches/018fe586-0cd3-7ef4-9bfc-32c8d90684ac",
    "inserted_at": "2024-06-04T23:11:58Z",
    "is_editable": true,
    "is_finalized": false,
    "processable_data_type": "utility_bill",
    "total_files": 2,
    "processed_files": 2,
    "failed_processed_files": 0,
    "pending_processing_files": 0,
    "updated_at": "2024-06-04T23:11:58Z",
    "files_url": "https://COMPANY_ID.cedalio.dev/api/v1/files_batches/018fe586-0cd3-7ef4-9bfc-32c8d90684ac/files",
    "finalize_url": "https://COMPANY_ID.cedalio.dev/api/v1/files_batches/018fe586-0cd3-7ef4-9bfc-32c8d90684ac/finalize",
    "processed_data_url": "https://COMPANY_ID.cedalio.dev/api/v1/files_batches/018fe586-0cd3-7ef4-9bfc-32c8d90684ac/processed_data"
  }
]
```

### Files

#### Upload file to batch

_Example cURL_

```bash
curl -v -u BASIC_AUTH_USER:BASIC_AUTH_PASSWORD "https://COMPANY_ID.cedalio.dev/api/v1/files_batches/018fe586-0cd3-7ef4-9bfc-32c8d90684ac/files" \
    -F "file=@/PATH/TO/UTILITY/BILL/FILE" | jq
```

_Example response_

```json
{
  "id": "018fe589-3160-7dff-b938-f2491775dfda",
  "name": "Camuzzi.pdf",
  "size": 921076,
  "url": "https://COMPANY_ID.cedalio.dev/api/v1/files_batches/018fe586-0cd3-7ef4-9bfc-32c8d90684ac/files/018fe589-3160-7dff-b938-f2491775dfda",
  "content_type": "application/pdf",
  "inserted_at": "2024-06-04T23:15:24Z",
  "download_url": "https://s3.us-east-2.amazonaws.com/some-company-environment/data_input_files/utility_bill/018fe586-0cd3-7ef4-9bfc-32c8d90684ac/Camuzzi.pdf?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAU7H2I5GTDWRVE6DT%2F20240604%2Fus-east-2%2Fs3%2Faws4_request&X-Amz-Date=20240604T231526Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=1c3c0178c60cb05bfcd1598ac1009cf91dc5ed29666b73fe8854d2ac76c519b6",
  "original_name": "Camuzzi.pdf",
  "processing_status": "pending_processing",
  "processable_data_type": "utility_bill",
  "processed_data": [],
  "updated_at": "2024-06-04T23:15:26Z",
  "batch_url": "https://COMPANY_ID.cedalio.dev/api/v1/files_batches/018fe586-0cd3-7ef4-9bfc-32c8d90684ac"
}
```

#### Fetch all batch files

_Example cURL_

```bash
curl -v -u BASIC_AUTH_USER:BASIC_AUTH_PASSWORD "https://COMPANY_ID.cedalio.dev/api/v1/files_batches/018fe586-0cd3-7ef4-9bfc-32c8d90684ac/files" | jq
```

_Example response_

```json
[
  {
    "id": "018fe589-3160-7dff-b938-f2491775dfda",
    "name": "Camuzzi.pdf",
    "size": 921076,
    "url": "https://COMPANY_ID.cedalio.dev/api/v1/files_batches/018fe586-0cd3-7ef4-9bfc-32c8d90684ac/files/018fe589-3160-7dff-b938-f2491775dfda",
    "content_type": "application/pdf",
    "inserted_at": "2024-06-04T23:15:24Z",
    "download_url": "https://s3.us-east-2.amazonaws.com/some-company-environment/data_input_files/utility_bill/018fe586-0cd3-7ef4-9bfc-32c8d90684ac/Camuzzi.pdf?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAU7H2I5GTDWRVE6DT%2F20240604%2Fus-east-2%2Fs3%2Faws4_request&X-Amz-Date=20240604T231934Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=0d54de3582008fed50910ee1a96012390f6a714431f04f8d61309be44f106db6",
    "original_name": "Camuzzi.pdf",
    "processing_status": "text_processed",
    "processable_data_type": "utility_bill",
    "processed_data": [
      {
        "data": {
          "period_start_date": "2023-09-26",
          "period_end_date": "2023-11-26",
          "supplier_name": "CAMUZZI GAS DEL SUR S.A.",
          "billing_address": {
            "country": "Argentina",
            "state_or_province": "Río Negro",
            "street": "Arelauquen 32 26063"
          },
          "measurements": [
            {
              "unit": "m3",
              "period_start_date": "2023-09-26",
              "period_end_date": "2023-11-26",
              "consumption": 1733.62,
              "utility_type": "gas",
              "meter_number": "228069042",
              "paid_amount": 31480.57
            }
          ],
          "account_number": "80011-18926062/4",
          "invoice_number": "84000230100732094",
          "supplier_tax_id": "30-65786442-7",
          "total_bill": 31480.57,
          "total_bill_currency": "ARS"
        },
        "id": "018fe58b-63a6-7574-91be-4405b81803ae",
        "is_valid": true,
        "url": "https://COMPANY_ID.cedalio.dev/api/v1/files_batches/018fe586-0cd3-7ef4-9bfc-32c8d90684ac/processed_data/018fe58b-63a6-7574-91be-4405b81803ae",
        "inserted_at": "2024-06-04T23:17:48Z",
        "processable_data_type": "utility_bill",
        "input_file_id": "018fe589-3160-7dff-b938-f2491775dfda",
        "review_status": "approved",
        "reviewer_type": "system",
        "updated_at": "2024-06-04T23:17:48Z",
        "input_file_url": "https://COMPANY_ID.cedalio.dev/api/v1/files_batches/018fe586-0cd3-7ef4-9bfc-32c8d90684ac/files/018fe589-3160-7dff-b938-f2491775dfda",
        "files_batch_url": "https://COMPANY_ID.cedalio.dev/api/v1/files_batches/018fe586-0cd3-7ef4-9bfc-32c8d90684ac",
        "validation_errors": []
      }
    ],
    "updated_at": "2024-06-04T23:17:48Z",
    "batch_url": "https://COMPANY_ID.cedalio.dev/api/v1/files_batches/018fe586-0cd3-7ef4-9bfc-32c8d90684ac"
  },
  {
    "id": "018fe589-da66-7f2c-9445-5f7575db069d",
    "name": "Invoice1.pdf",
    "size": 873197,
    "url": "https://COMPANY_ID.cedalio.dev/api/v1/files_batches/018fe586-0cd3-7ef4-9bfc-32c8d90684ac/files/018fe589-da66-7f2c-9445-5f7575db069d",
    "content_type": "application/pdf",
    "inserted_at": "2024-06-04T23:16:07Z",
    "download_url": "https://s3.us-east-2.amazonaws.com/some-company-environment/data_input_files/utility_bill/018fe586-0cd3-7ef4-9bfc-32c8d90684ac/Invoice1.pdf?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAU7H2I5GTDWRVE6DT%2F20240604%2Fus-east-2%2Fs3%2Faws4_request&X-Amz-Date=20240604T231934Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=29b179b5905c6209e4d87f71a7c6f6f2a44d82e1701b1c384a698b18aad92fe9",
    "original_name": "Invoice1.pdf",
    "processing_status": "text_processed",
    "processable_data_type": "utility_bill",
    "processed_data": [
      {
        "data": {
          "period_start_date": "2023-09-25",
          "period_end_date": "2023-11-22",
          "supplier_name": "Empresa Distribuidora Sur S.A.",
          "billing_address": {
            "country": "Argentina",
            "state_or_province": null,
            "street": "MONTEVIDEO 373"
          },
          "measurements": [
            {
              "unit": "kWh",
              "period_start_date": "2023-09-25",
              "period_end_date": "2023-11-22",
              "consumption": 230.0,
              "utility_type": "electricity",
              "meter_number": "037122970",
              "paid_amount": 5563.16
            }
          ],
          "account_number": "03877233",
          "invoice_number": "0501-00475606",
          "supplier_tax_id": "20-05071179-0",
          "total_bill": 5563.16,
          "total_bill_currency": "ARS"
        },
        "id": "018fe58c-9693-71d3-acf8-dba16f4e926e",
        "is_valid": true,
        "url": "https://COMPANY_ID.cedalio.dev/api/v1/files_batches/018fe586-0cd3-7ef4-9bfc-32c8d90684ac/processed_data/018fe58c-9693-71d3-acf8-dba16f4e926e",
        "inserted_at": "2024-06-04T23:19:07Z",
        "processable_data_type": "utility_bill",
        "input_file_id": "018fe589-da66-7f2c-9445-5f7575db069d",
        "review_status": "approved",
        "reviewer_type": "system",
        "updated_at": "2024-06-04T23:19:07Z",
        "input_file_url": "https://COMPANY_ID.cedalio.dev/api/v1/files_batches/018fe586-0cd3-7ef4-9bfc-32c8d90684ac/files/018fe589-da66-7f2c-9445-5f7575db069d",
        "files_batch_url": "https://COMPANY_ID.cedalio.dev/api/v1/files_batches/018fe586-0cd3-7ef4-9bfc-32c8d90684ac",
        "validation_errors": []
      }
    ],
    "updated_at": "2024-06-04T23:19:07Z",
    "batch_url": "https://COMPANY_ID.cedalio.dev/api/v1/files_batches/018fe586-0cd3-7ef4-9bfc-32c8d90684ac"
  }
]
```

#### Fetch a file

_Example cURL_

```bash
curl -v -u BASIC_AUTH_USER:BASIC_AUTH_PASSWORD "https://COMPANY_ID.cedalio.dev/api/v1/files_batches/018fe586-0cd3-7ef4-9bfc-32c8d90684ac/files/018fe589-da66-7f2c-9445-5f7575db069d" | jq
```

_Example response_

```json
{
  "id": "018fe589-da66-7f2c-9445-5f7575db069d",
  "name": "Invoice1.pdf",
  "size": 873197,
  "url": "https://COMPANY_ID.cedalio.dev/api/v1/files_batches/018fe586-0cd3-7ef4-9bfc-32c8d90684ac/files/018fe589-da66-7f2c-9445-5f7575db069d",
  "content_type": "application/pdf",
  "inserted_at": "2024-06-04T23:16:07Z",
  "download_url": "https://s3.us-east-2.amazonaws.com/some-company-environment/data_input_files/utility_bill/018fe586-0cd3-7ef4-9bfc-32c8d90684ac/Invoice1.pdf?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAU7H2I5GTDWRVE6DT%2F20240605%2Fus-east-2%2Fs3%2Faws4_request&X-Amz-Date=20240605T001137Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=b7844d36e7441215efbea69b8ed4414b14212d5a0efb1476a2fbec89c759f746",
  "original_name": "Invoice1.pdf",
  "processing_status": "text_processed",
  "processable_data_type": "utility_bill",
  "processed_data": [
    {
      "data": {
        "period_start_date": "2023-09-25",
        "period_end_date": "2023-11-22",
        "supplier_name": "Empresa Distribuidora Sur S.A.",
        "billing_address": {
          "country": "Argentina",
          "state_or_province": null,
          "street": "MONTEVIDEO 373"
        },
        "measurements": [
          {
            "unit": "kWh",
            "period_start_date": "2023-09-25",
            "period_end_date": "2023-11-22",
            "consumption": 230.0,
            "utility_type": "electricity",
            "meter_number": "037122970",
            "paid_amount": 5563.16
          }
        ],
        "account_number": "03877233",
        "invoice_number": "0501-00475606",
        "supplier_tax_id": "20-05071179-0",
        "total_bill": 5563.16,
        "total_bill_currency": "ARS"
      },
      "id": "018fe58c-9693-71d3-acf8-dba16f4e926e",
      "is_valid": true,
      "url": "https://COMPANY_ID.cedalio.dev/api/v1/files_batches/018fe586-0cd3-7ef4-9bfc-32c8d90684ac/processed_data/018fe58c-9693-71d3-acf8-dba16f4e926e",
      "inserted_at": "2024-06-04T23:19:07Z",
      "processable_data_type": "utility_bill",
      "input_file_id": "018fe589-da66-7f2c-9445-5f7575db069d",
      "review_status": "approved",
      "reviewer_type": "system",
      "updated_at": "2024-06-04T23:19:07Z",
      "input_file_url": "https://COMPANY_ID.cedalio.dev/api/v1/files_batches/018fe586-0cd3-7ef4-9bfc-32c8d90684ac/files/018fe589-da66-7f2c-9445-5f7575db069d",
      "files_batch_url": "https://COMPANY_ID.cedalio.dev/api/v1/files_batches/018fe586-0cd3-7ef4-9bfc-32c8d90684ac",
      "validation_errors": []
    }
  ],
  "updated_at": "2024-06-04T23:19:07Z",
  "batch_url": "https://COMPANY_ID.cedalio.dev/api/v1/files_batches/018fe586-0cd3-7ef4-9bfc-32c8d90684ac"
}
```

#### Delete a file

_Example cURL_

```bash
curl -v -u BASIC_AUTH_USER:BASIC_AUTH_PASSWORD "https://COMPANY_ID.cedalio.dev/api/v1/files_batches/018fe586-0cd3-7ef4-9bfc-32c8d90684ac/files/018fe589-3160-7dff-b938-f2491775dfda" -X DELETE
```

_Example response_

```json
{}
```

### Processed data

#### Fetch all processed data for files batch

_Example cURL_

```bash
curl -v -u BASIC_AUTH_USER:BASIC_AUTH_PASSWORD "https://COMPANY_ID.cedalio.dev/api/v1/files_batches/018fe586-0cd3-7ef4-9bfc-32c8d90684ac/processed_data" | jq
```

_Example response_

```json
[
  {
    "data": {
      "period_start_date": "2023-09-26",
      "period_end_date": "2023-11-26",
      "supplier_name": "CAMUZZI GAS DEL SUR S.A.",
      "billing_address": {
        "country": "Argentina",
        "state_or_province": "Río Negro",
        "street": "Arelauquen 32 26063"
      },
      "measurements": [
        {
          "unit": "m3",
          "period_start_date": "2023-09-26",
          "period_end_date": "2023-11-26",
          "consumption": 1733.62,
          "utility_type": "gas",
          "meter_number": "228069042",
          "paid_amount": 31480.57
        }
      ],
      "account_number": "80011-18926062/4",
      "invoice_number": "84000230100732094",
      "supplier_tax_id": "30-65786442-7",
      "total_bill": 31480.57,
      "total_bill_currency": "ARS"
    },
    "id": "018fe58b-63a6-7574-91be-4405b81803ae",
    "is_valid": true,
    "url": "https://COMPANY_ID.cedalio.dev/api/v1/files_batches/018fe586-0cd3-7ef4-9bfc-32c8d90684ac/processed_data/018fe58b-63a6-7574-91be-4405b81803ae",
    "inserted_at": "2024-06-04T23:17:48Z",
    "processable_data_type": "utility_bill",
    "input_file_id": "018fe589-3160-7dff-b938-f2491775dfda",
    "review_status": "approved",
    "reviewer_type": "system",
    "updated_at": "2024-06-04T23:17:48Z",
    "input_file_url": "https://COMPANY_ID.cedalio.dev/api/v1/files_batches/018fe586-0cd3-7ef4-9bfc-32c8d90684ac/files/018fe589-3160-7dff-b938-f2491775dfda",
    "files_batch_url": "https://COMPANY_ID.cedalio.dev/api/v1/files_batches/018fe586-0cd3-7ef4-9bfc-32c8d90684ac",
    "validation_errors": []
  },
  {
    "data": {
      "period_start_date": "2023-09-25",
      "period_end_date": "2023-11-22",
      "supplier_name": "Empresa Distribuidora Sur S.A.",
      "billing_address": {
        "country": "Argentina",
        "state_or_province": null,
        "street": "MONTEVIDEO 373"
      },
      "measurements": [
        {
          "unit": "kWh",
          "period_start_date": "2023-09-25",
          "period_end_date": "2023-11-22",
          "consumption": 230.0,
          "utility_type": "electricity",
          "meter_number": "037122970",
          "paid_amount": 5563.16
        }
      ],
      "account_number": "03877233",
      "invoice_number": "0501-00475606",
      "supplier_tax_id": "20-05071179-0",
      "total_bill": 5563.16,
      "total_bill_currency": "ARS"
    },
    "id": "018fe58c-9693-71d3-acf8-dba16f4e926e",
    "is_valid": true,
    "url": "https://COMPANY_ID.cedalio.dev/api/v1/files_batches/018fe586-0cd3-7ef4-9bfc-32c8d90684ac/processed_data/018fe58c-9693-71d3-acf8-dba16f4e926e",
    "inserted_at": "2024-06-04T23:19:07Z",
    "processable_data_type": "utility_bill",
    "input_file_id": "018fe589-da66-7f2c-9445-5f7575db069d",
    "review_status": "approved",
    "reviewer_type": "system",
    "updated_at": "2024-06-04T23:19:07Z",
    "input_file_url": "https://COMPANY_ID.cedalio.dev/api/v1/files_batches/018fe586-0cd3-7ef4-9bfc-32c8d90684ac/files/018fe589-da66-7f2c-9445-5f7575db069d",
    "files_batch_url": "https://COMPANY_ID.cedalio.dev/api/v1/files_batches/018fe586-0cd3-7ef4-9bfc-32c8d90684ac",
    "validation_errors": []
  }
]
```

#### Fetch processed data

_Example cURL_

```bash
curl -v -u BASIC_AUTH_USER:BASIC_AUTH_PASSWORD "https://COMPANY_ID.cedalio.dev/api/v1/files_batches/018fe586-0cd3-7ef4-9bfc-32c8d90684ac/processed_data/018fe58c-9693-71d3-acf8-dba16f4e926e" | jq
```

_Example response_

```json
{
  "data": {
    "period_start_date": "2023-09-25",
    "period_end_date": "2023-11-22",
    "supplier_name": "Empresa Distribuidora Sur S.A.",
    "billing_address": {
      "country": "Argentina",
      "state_or_province": null,
      "street": "MONTEVIDEO 373"
    },
    "measurements": [
      {
        "unit": "kWh",
        "period_start_date": "2023-09-25",
        "period_end_date": "2023-11-22",
        "consumption": 230.0,
        "utility_type": "electricity",
        "meter_number": "037122970",
        "paid_amount": 5563.16
      }
    ],
    "account_number": "03877233",
    "invoice_number": "0501-00475606",
    "supplier_tax_id": "20-05071179-0",
    "total_bill": 5563.16,
    "total_bill_currency": "ARS"
  },
  "id": "018fe58c-9693-71d3-acf8-dba16f4e926e",
  "is_valid": true,
  "url": "https://COMPANY_ID.cedalio.dev/api/v1/files_batches/018fe586-0cd3-7ef4-9bfc-32c8d90684ac/processed_data/018fe58c-9693-71d3-acf8-dba16f4e926e",
  "inserted_at": "2024-06-04T23:19:07Z",
  "processable_data_type": "utility_bill",
  "input_file_id": "018fe589-da66-7f2c-9445-5f7575db069d",
  "review_status": "approved",
  "reviewer_type": "system",
  "updated_at": "2024-06-04T23:19:07Z",
  "input_file_url": "https://COMPANY_ID.cedalio.dev/api/v1/files_batches/018fe586-0cd3-7ef4-9bfc-32c8d90684ac/files/018fe589-da66-7f2c-9445-5f7575db069d",
  "files_batch_url": "https://COMPANY_ID.cedalio.dev/api/v1/files_batches/018fe586-0cd3-7ef4-9bfc-32c8d90684ac",
  "validation_errors": []
}
```

#### Update processed data

_Example cURL_

```bash
curl -v -u BASIC_AUTH_USER:BASIC_AUTH_PASSWORD "https://COMPANY_ID.cedalio.dev/api/v1/files_batches/018fe586-0cd3-7ef4-9bfc-32c8d90684ac/processed_data/018fe58c-9693-71d3-acf8-dba16f4e926e" \
  -X PATCH -H 'Content-Type: application/json' \
  -d '{ "processed_data": { "billing_address" : { "street" : "a fake street 123" } } }' | jq
```

_Example response_

```json
{
  "data": {
    "period_start_date": "2023-09-25",
    "period_end_date": "2023-11-22",
    "supplier_name": "Empresa Distribuidora Sur S.A.",
    "billing_address": {
      "country": "Argentina",
      "state_or_province": null,
      "street": "MONTEVIDEO 373"
    },
    "measurements": [
      {
        "unit": "kWh",
        "period_start_date": "2023-09-25",
        "period_end_date": "2023-11-22",
        "consumption": 230.0,
        "utility_type": "electricity",
        "meter_number": "037122970",
        "paid_amount": 5563.16
      }
    ],
    "account_number": "03877233",
    "invoice_number": "0501-00475606",
    "supplier_tax_id": "20-05071179-0",
    "total_bill": 5563.16,
    "total_bill_currency": "ARS"
  },
  "id": "018fe58c-9693-71d3-acf8-dba16f4e926e",
  "is_valid": true,
  "url": "https://COMPANY_ID.cedalio.dev/api/v1/files_batches/018fe586-0cd3-7ef4-9bfc-32c8d90684ac/processed_data/018fe58c-9693-71d3-acf8-dba16f4e926e",
  "inserted_at": "2024-06-04T23:19:07Z",
  "processable_data_type": "utility_bill",
  "input_file_id": "018fe589-da66-7f2c-9445-5f7575db069d",
  "review_status": "approved",
  "reviewer_type": "system",
  "updated_at": "2024-06-04T23:19:07Z",
  "input_file_url": "https://COMPANY_ID.cedalio.dev/api/v1/files_batches/018fe586-0cd3-7ef4-9bfc-32c8d90684ac/files/018fe589-da66-7f2c-9445-5f7575db069d",
  "files_batch_url": "https://COMPANY_ID.cedalio.dev/api/v1/files_batches/018fe586-0cd3-7ef4-9bfc-32c8d90684ac",
  "validation_errors": []
}
```

#### Review processed data

_Example cURL_

```bash
curl -v -u BASIC_AUTH_USER:BASIC_AUTH_PASSWORD "https://COMPANY_ID.cedalio.dev/api/v1/files_batches/018fe4c4-11a9-7e76-b753-da48f15b0d59/processed_data/018fe4c6-175a-77b2-b687-b60a6926b80a/review" \
  -X POST \
  -H 'Content-Type: application/json' \
  -d '{"review_status": "rejected"}' | jq
```

_Example response_

```json
{
  "data": {
    "period_start_date": "2023-09-23",
    "period_end_date": "2023-11-22",
    "supplier_name": "Empresa Distribuidora Sur S.A.",
    "billing_address": {
      "country": "Argentina",
      "state_or_province": null,
      "street": "fake street 123"
    },
    "measurements": [
      {
        "unit": "kWh",
        "period_start_date": "2023-09-25",
        "period_end_date": "2023-11-22",
        "consumption": 230.0,
        "utility_type": "electricity",
        "meter_number": "037122970",
        "paid_amount": 5563.16
      }
    ],
    "account_number": "03877233",
    "invoice_number": "A 0501-00475606 17",
    "supplier_tax_id": "20-05071179-0",
    "total_bill": 5563.16,
    "total_bill_currency": "ARS"
  },
  "id": "018fe4c6-175a-77b2-b687-b60a6926b80a",
  "is_valid": true,
  "url": "https://COMPANY_ID.cedalio.dev/api/v1/files_batches/018fe4c4-11a9-7e76-b753-da48f15b0d59/processed_data/018fe4c6-175a-77b2-b687-b60a6926b80a",
  "inserted_at": "2024-06-04T19:42:18Z",
  "processable_data_type": "utility_bill",
  "input_file_id": "018fe4c4-79ba-7551-abd7-635e413d1e9f",
  "review_status": "rejected",
  "reviewer_type": "user",
  "updated_at": "2024-06-04T22:54:54Z",
  "input_file_url": "https://COMPANY_ID.cedalio.dev/api/v1/files_batches/018fe4c4-11a9-7e76-b753-da48f15b0d59/files/018fe4c4-79ba-7551-abd7-635e413d1e9f",
  "files_batch_url": "https://COMPANY_ID.cedalio.dev/api/v1/files_batches/018fe4c4-11a9-7e76-b753-da48f15b0d59",
  "validation_errors": []
}
```

![Untitled](https://prod-files-secure.s3.us-west-2.amazonaws.com/709e6015-171d-448c-87e0-279a60f5c6c8/88582d93-d12b-403a-9538-cfd909fcb090/Untitled.png)
