Generate a new Report

POST /api/v1/report

Headers

application/json

Body Required

  • name string Required

    Name of the report

  • Type of report to generate, available types are actual_vs_estimate_report, adviser_income_detailed, aged_debt_report, cases_export, charges_export, client_expenditure_export, client_export, client_time_entries, conversion_pipeline, employee_export, form_submission_export, group_scheme_members_export, holding_export, income_reconciliation_export, new_business_export, new_business_summary_report, note_export, plan_export, premium_export, revenue_analysis_based_on_receipts, rmar, staff_member_export, task_export, demo_report

  • Report template uuid to generate a report from, required if no report id is passed

  • report_query array[string]

    Extra query parameters that can be used to manipulate the report output, only works for new reports, for templates the data stored on the template will be used

  • setting this to true will save this request as a template that can be reused, if no value is given this defaults to false, does not store a new template if a template if a template is passed

  • The name of the template to generate. Required if save_as_template is true.

Responses

  • 201 application/json
    Hide response attributes Show response attributes object
    • uuid string

      The UUID of the resource.

    • The timestamp of when the resource was created.

    • The timestamp of when the resource was updated.

    • name string

      Name of the report

    • the account that created this report

    • report type id

    • status string

      Current status of report generation

    • progress integer

      Current progress of the report when generating

    • files array[object]

      Files generated for this report instance

    • folder object

      Folder generated with the report. this is the default folder that all generated documents will be stored

POST /api/v1/report
curl \
 -X POST https://api.plannrcrm.com/api/v1/report \
 -H "Authorization: Bearer {OAUTH_ACCESS_TOKEN or PERSONAL_ACCESS_TOKEN}" \
 -H "Content-Type: application/json" \
 -H "Accept: application/json" \
 -d '{"name":"Client Export 22nd July","report_type_id":"rmar","report_template_uuid":"34851b79-1b8c-473b-add7-3cf60a7ab923","report_query":[{"start_date":"2024-10-16T11:10:17+01:00"}],"save_as_template":true,"template_name":"1"}'
Request examples
# Headers
Authorization: Bearer {OAUTH_ACCESS_TOKEN or PERSONAL_ACCESS_TOKEN}
Content-Type: application/json
Accept: application/json

# Payload
{
  "name": "Client Export 22nd July",
  "report_type_id": "rmar",
  "report_template_uuid": "34851b79-1b8c-473b-add7-3cf60a7ab923",
  "report_query": [
    {
      "start_date": "2024-10-16T11:10:17+01:00"
    }
  ],
  "save_as_template": true,
  "template_name": "1"
}
Response examples (201)
{
  "name": "rmar-report-2024-10-16T11:10:17+01:00",
  "uuid": "7f78ba2a-d5d0-4243-a7ce-9c0465b214a1",
  "files": [
    {
      "firm": "App\\Http\\Resources\\FirmResource",
      "name": "Welcome to Plannr",
      "size": "21691783",
      "tags": "App\\Http\\Resources\\TagResource",
      "type": "type",
      "uuid": "7ebf47c5-8fae-4d9f-b88f-451d4ab51f5f",
      "parent": "Object",
      "status": "uploaded",
      "account": "App\\Http\\Resources\\AccountResource",
      "filename": "Welcome to Plannr.pdf",
      "progress": "100",
      "extension": "pdf",
      "created_at": "2024-10-16T11:10:17+01:00",
      "updated_at": "2024-10-16T11:10:17+01:00",
      "folder_name": "folder 2",
      "uploaded_at": "2024-10-16T11:10:17+01:00",
      "download_url": "https://plannr.valet/file/8ad60a4f-411d-4d4a-b203-a536d1c1d13f/download",
      "last_modified": "2024-10-16T11:10:17+01:00",
      "original_created_at": "2024-10-16T11:10:17+01:00"
    }
  ],
  "folder": {
    "name": "Important Documents",
    "path": "Codepotato/Important Documents",
    "slug": "important-documents",
    "uuid": "d877ce5a-e28b-405f-8975-89060d4971e1",
    "depth": 5,
    "files": "App\\Http\\Resources\\FileResource",
    "owned": false,
    "parent": "App\\Http\\Resources\\FolderResource",
    "folders": "App\\Http\\Resources\\FolderResource",
    "parents": "App\\Http\\Resources\\FolderResource",
    "children": "App\\Http\\Resources\\FolderResource",
    "created_at": "2024-10-16T11:10:17+01:00",
    "updated_at": "2024-10-16T11:10:17+01:00",
    "files_count": 8,
    "clients_read": true,
    "participants": "App\\Http\\Resources\\FolderParticipantResource",
    "clients_write": true,
    "folders_count": 5,
    "is_root_folder": true,
    "is_pseudo_folder": true,
    "is_system_folder": true,
    "participants_count": 3,
    "show_client_permissions": true
  },
  "status": "complete",
  "progress": 100,
  "created_at": "2024-10-16T11:10:17+01:00",
  "created_by": {
    "firm": "App\\Http\\Resources\\FirmResource",
    "name": "Gareth Thompson",
    "role": "client",
    "tags": "App\\Http\\Resources\\TagResource",
    "type": "client",
    "uuid": "e17d3411-e6db-4f2c-872a-646c4df7338c",
    "email": "gareth@codepotato.co.uk",
    "groups": "App\\Http\\Resources\\GroupResource",
    "owners": "App\\Http\\Resources\\AccountResource",
    "last_name": "Thompson",
    "created_at": "2024-10-16T11:10:17+01:00",
    "first_name": "Gareth",
    "updated_at": "2024-10-16T11:10:17+01:00",
    "with_login": true,
    "custom_fields": "App\\Http\\Resources\\CustomFieldValueResource",
    "introduced_by": "App\\Http\\Resources\\AccountResource",
    "primary_email": "App\\Http\\Resources\\ContactDetailResource",
    "can_be_deleted": "false",
    "assigned_adviser": "App\\Http\\Resources\\AccountResource",
    "next_review_date": "2024-10-16T11:10:17+01:00",
    "has_joint_account": true,
    "current_time_entry": "App\\Http\\Resources\\TimeEntryResource",
    "first_contact_date": "2024-10-16T11:10:17+01:00",
    "external_references": "App\\Http\\Resources\\ExternalReferenceResource",
    "assigned_paraplanner": "App\\Http\\Resources\\AccountResource",
    "previous_review_date": "2024-10-16T11:10:17+01:00",
    "primary_phone_number": "App\\Http\\Resources\\ContactDetailResource",
    "assigned_administrator": "App\\Http\\Resources\\AccountResource",
    "anniversary_review_date": "2024-10-16T11:10:17+01:00"
  },
  "updated_at": "2024-10-16T11:10:17+01:00",
  "report_type_id": "rmar"
}