Update File Reading
const options = {
method: 'PUT',
headers: {
'x-api-key': '<x-api-key>',
'x-organization-id': '<x-organization-id>',
'Content-Type': 'application/json'
},
body: JSON.stringify({content: {}, 'content.items': [{}]})
};
fetch('https://api.dcycle.io/v1/files/readings/{file_reading_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.dcycle.io/v1/files/readings/{file_reading_id}"
payload = {
"content": {},
"content.items": [{}]
}
headers = {
"x-api-key": "<x-api-key>",
"x-organization-id": "<x-organization-id>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)curl --request PUT \
--url https://api.dcycle.io/v1/files/readings/{file_reading_id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>' \
--data '
{
"content": {},
"content.items": [
{}
]
}
'{
"id": "<string>",
"status": "<string>",
"content": {
"items": {}
}
}Update File Reading
Edit extracted file reading content before creating invoices or wastes
PUT
/
v1
/
files
/
readings
/
{file_reading_id}
Update File Reading
const options = {
method: 'PUT',
headers: {
'x-api-key': '<x-api-key>',
'x-organization-id': '<x-organization-id>',
'Content-Type': 'application/json'
},
body: JSON.stringify({content: {}, 'content.items': [{}]})
};
fetch('https://api.dcycle.io/v1/files/readings/{file_reading_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.dcycle.io/v1/files/readings/{file_reading_id}"
payload = {
"content": {},
"content.items": [{}]
}
headers = {
"x-api-key": "<x-api-key>",
"x-organization-id": "<x-organization-id>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)curl --request PUT \
--url https://api.dcycle.io/v1/files/readings/{file_reading_id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>' \
--data '
{
"content": {},
"content.items": [
{}
]
}
'{
"id": "<string>",
"status": "<string>",
"content": {
"items": {}
}
}Update File Reading
Use this endpoint to correct OCR or LLM extraction output before converting the reading into invoices or wastes.Request
Headers
string
required
Your API key for authenticationExample:
sk_live_1234567890abcdefstring
required
Your organization UUIDExample:
a8315ef3-dd50-43f8-b7ce-d839e68d51faPath Parameters
string
required
File reading UUID from
GET /v1/files/readings.Body
Send the full updatedcontent.items array. The shape depends on the reading category.
object
required
Wrapper for the updated extracted content.
array
required
Updated parsed items. Replace the existing list with the corrected values.
Response
Returns the updated file reading (HTTP 200).string
File reading UUID.
string
Processing status (e.g.
"success").object
Updated extracted content.
Show Content Object
Show Content Object
array[object]
Updated line items. Shape varies by reading category (e.g. invoice fields for energy, waste fields for wastes).
Example
curl -X PUT "https://api.dcycle.io/v1/files/readings/22222222-2222-2222-2222-222222222222" \
-H "x-api-key: ${DCYCLE_API_KEY}" \
-H "x-organization-id: ${DCYCLE_ORG_ID}" \
-H "Content-Type: application/json" \
-d '{
"content": {
"items": [
{
"invoice_number": "WTR-2024-03",
"quantity": 32.1,
"unit": "cubic_metre_(m3)",
"start_date": "2024-03-01",
"end_date": "2024-03-31"
}
]
}
}'
import os
import requests
requests.put(
"https://api.dcycle.io/v1/files/readings/22222222-2222-2222-2222-222222222222",
headers={
"x-api-key": os.environ["DCYCLE_API_KEY"],
"x-organization-id": os.environ["DCYCLE_ORG_ID"],
"Content-Type": "application/json",
},
json={
"content": {
"items": [
{
"invoice_number": "WTR-2024-03",
"quantity": 32.1,
"unit": "cubic_metre_(m3)",
"start_date": "2024-03-01",
"end_date": "2024-03-31",
}
]
}
},
timeout=30,
).raise_for_status()
const axios = require('axios');
axios.put('https://api.dcycle.io/v1/files/readings/22222222-2222-2222-2222-222222222222', {
content: {
items: [
{
invoice_number: 'WTR-2024-03',
quantity: 32.1,
unit: 'cubic_metre_(m3)',
start_date: '2024-03-01',
end_date: '2024-03-31',
},
],
},
}, {
headers: {
'x-api-key': process.env.DCYCLE_API_KEY,
'x-organization-id': process.env.DCYCLE_ORG_ID,
'Content-Type': 'application/json',
},
}).then(response => console.log(response.data));
Successful Response
{
"id": "22222222-2222-2222-2222-222222222222",
"status": "success",
"content": {
"items": [
{
"invoice_number": "WTR-2024-03",
"quantity": 32.1,
"unit": "cubic_metre_(m3)",
"start_date": "2024-03-01",
"end_date": "2024-03-31"
}
]
}
}
## Common Errors
### 401 Unauthorized
**Cause:** Missing or invalid API key
```json
{"detail": "Invalid API key for organization", "code": "INVALID_API_KEY"}
403 Forbidden
Cause: The authenticated user is not a member of the organization{"detail": "Logged User is not Member of Organization", "code": "LOGGED_USER_NOT_MEMBER"}
404 Not Found
Cause: The file reading does not exist or belongs to another organization{"detail": "Not Found"}
422 Unprocessable Entity
Cause: Missing requiredcontent.items array
{
"detail": [
{
"loc": ["body", "content"],
"msg": "field required",
"type": "value_error.missing"
}
]
}
Notes
- Use this before calling
POST /v1/files/readings. - The API does not currently publish category-specific schemas in the docs, so clients should start from the values
returned by
GET /v1/files/readings, modify only the needed fields, and send the fullcontent.itemsarray back.
Related Endpoints
List File Readings
Retrieve readings to get the current content
Create Records
Convert the edited reading into invoices or wastes
Upload Files
Upload new files via presigned S3 URLs
Files Overview
Learn about the Files API
Was this page helpful?