Reports
Reports are essential for analyzing data and gaining insights into various aspects of your business. On this page, we’ll dive into the different reports endpoints you can use to manage reports programmatically. We'll look at how to query, create, update, and delete report records.
The report model
The report model contains all the information related to a report, including the report type, data, and generated date.
Properties
- Name
id- Type
- string
- Description
Unique identifier for the report record.
- Name
report_type- Type
- string
- Description
Type of report (e.g., financial, operational).
- Name
data- Type
- object
- Description
Data contained in the report.
- Name
generated_at- Type
- timestamp
- Description
Timestamp of when the report was generated.
- Name
created_at- Type
- timestamp
- Description
Timestamp of when the report record was created.
- Name
updated_at- Type
- timestamp
- Description
Timestamp of when the report record was last updated.
List all reports
This endpoint allows you to retrieve a paginated list of all your report records. By default, a maximum of ten records are shown per page.
Optional attributes
- Name
limit- Type
- integer
- Description
Limit the number of report records returned.
- Name
report_type- Type
- string
- Description
Only show records with the specified report type.
- Name
generated_after- Type
- timestamp
- Description
Only show records generated after the specified date.
Request
curl -G https://api.finx.ai/v1/reports \
-H "Authorization: Bearer {token}" \
-d limit=10
Response
{
"has_more": false,
"data": [
{
"id": "xgQQXg3hrtjh7AvZ",
"report_type": "financial",
"data": {
"revenue": 500000,
"expenses": 300000
},
"generated_at": 705103200,
"created_at": 705103200,
"updated_at": 705103200
},
{
"id": "hSIhXBhNe8X1d8Et"
// ...
}
]
}
Create a report
This endpoint allows you to add a new report record. You need to provide the report type, data, and generated date to create a report record.
Required attributes
- Name
report_type- Type
- string
- Description
Type of report (e.g., financial, operational).
- Name
data- Type
- object
- Description
Data contained in the report.
- Name
generated_at- Type
- timestamp
- Description
Timestamp of when the report was generated.
Request
curl https://api.finx.ai/v1/reports \
-H "Authorization: Bearer {token}" \
-d 'report_type'="financial" \
-d 'data'='{"revenue": 500000, "expenses": 300000}' \
-d 'generated_at'=705103200
Response
{
"id": "xgQQXg3hrtjh7AvZ",
"report_type": "financial",
"data": {
"revenue": 500000,
"expenses": 300000
},
"generated_at": 705103200,
"created_at": 705103200,
"updated_at": 705103200
}
Retrieve a report
This endpoint allows you to retrieve a report record by providing the record id. Refer to the list at the top of this page to see which properties are included with report objects.
Request
curl https://api.finx.ai/v1/reports/xgQQXg3hrtjh7AvZ \
-H "Authorization: Bearer {token}"
Response
{
"id": "xgQQXg3hrtjh7AvZ",
"report_type": "financial",
"data": {
"revenue": 500000,
"expenses": 300000
},
"generated_at": 705103200,
"created_at": 705103200,
"updated_at": 705103200
}
Update a report
This endpoint allows you to perform an update on a report record. Examples of updates are changing the report type, updating the data, or modifying the generated date.
Optional attributes
- Name
report_type- Type
- string
- Description
Updated type of report.
- Name
data- Type
- object
- Description
Updated data contained in the report.
- Name
generated_at- Type
- timestamp
- Description
Updated timestamp of when the report was generated.
Request
curl -X PUT https://api.finx.ai/v1/reports/xgQQXg3hrtjh7AvZ \
-H "Authorization: Bearer {token}" \
-d 'data'='{"revenue": 600000, "expenses": 350000}'
Response
{
"id": "xgQQXg3hrtjh7AvZ",
"report_type": "financial",
"data": {
"revenue": 600000,
"expenses": 350000
},
"generated_at": 705103200,
"created_at": 705103200,
"updated_at": 705103200
}
Delete a report
This endpoint allows you to delete your report records in Fin X. Note: This will permanently delete the record and all its data — ensure this is the desired action before proceeding.
Request
curl -X DELETE https://api.finx.ai/v1/reports/xgQQXg3hrtjh7AvZ \
-H "Authorization: Bearer {token}"