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.


GET/v1/reports

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

GET
/v1/reports
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"
      // ...
    }
  ]
}

POST/v1/reports

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

POST
/v1/reports'
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
}

GET/v1/reports/:id

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

GET
/v1/reports/xgQQXg3hrtjh7AvZ
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
}

PUT/v1/reports/:id

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

PUT
/v1/reports/xgQQXg3hrtjh7AvZ
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/v1/reports/:id

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

DELETE
/v1/reports/xgQQXg3hrtjh7AvZ
curl -X DELETE https://api.finx.ai/v1/reports/xgQQXg3hrtjh7AvZ \
  -H "Authorization: Bearer {token}"

Was this page helpful?