Skip to main content
POST
Create Records From File Reading

Create Records From File Reading

This endpoint converts a parsed file reading into downstream business records:
  • water, electricity, gas, fuel delivery, or recharge invoices
  • waste records
Facility linking happens here. You provide the target facilities and allocation percentages, and the created invoices or wastes are stored with those facility IDs.

Request

Headers

string
required
Your API key for authenticationExample: sk_live_1234567890abcdef
string
required
Your organization UUIDExample: a8315ef3-dd50-43f8-b7ce-d839e68d51fa

Body

object[]
required
Array of file reading references. Each item must include an id.
string
required
File reading UUID returned in reading.id from GET /v1/files/readings.
object[]
required
Facilities to link to the created records.
string
required
Facility UUID.
number
required
Allocation percentage as a decimal between 0 and 1. The total must be less than or equal to 1.0.
string
Optional project UUID. When present, created invoices are also linked to that project.
string
Optional supplier UUID. Only used for electricity readings. When provided, it overrides the supplier_id extracted from the file reading content. Required when any target facility is located in Spain and the reading did not resolve a supplier automatically.

Response

Returns an array of the created records (HTTP 200). The exact shape depends on the file reading category — invoices for energy categories, waste records for document::wastes.

Current Limitation

This endpoint currently supports exactly one file reading per request. If you send more than one file_readings item, the API returns MULTIPLE_FILES_NOT_SUPPORTED.

Example

Behavior by Category

  • invoice::water creates water invoices
  • invoice::electricity creates electricity invoices
  • invoice::gas and invoice::fuel_delivery create combustion invoices
  • invoice::recharges creates recharge invoices
  • document::wastes creates waste records
The endpoint determines the category from the file tags, not from the request body.

Common Errors

401 Unauthorized

Cause: Missing or invalid API key

403 Forbidden

Cause: The authenticated user is not a member of the organization

422 Unprocessable Entity

Cause: Missing required fields (file_readings, facilities) or invalid allocation percentages

Notes

  • This endpoint requires a successful file reading with content.items.
  • For Spain electricity facilities, supplier information may still be required depending on the extracted reading.
  • After records are created, the file will appear as linked=true in GET /v1/files/readings.

List File Readings

Retrieve readings to get file reading IDs

Update Reading

Edit extracted content before creating records

Upload Files

Upload new files via presigned S3 URLs

List Invoices

View invoices created from file readings