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, 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, time_entries, 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

      Additional properties are allowed.

    • 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

      Additional properties are allowed.

    • folder object

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

      Additional properties are allowed.

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":"51dc6e64-adc4-428b-8d3e-c3fa8a38d38d","report_query":[{"start_date":"2024-11-20T13:24:04+00: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": "51dc6e64-adc4-428b-8d3e-c3fa8a38d38d",
  "report_query": [
    {
      "start_date": "2024-11-20T13:24:04+00:00"
    }
  ],
  "save_as_template": true,
  "template_name": "1"
}
Response examples (201)
{
  "name": "rmar-report-2024-11-20T13:24:04+00:00",
  "uuid": "9b76a519-96cf-4248-b900-607d16de0c48",
  "files": [
    {
      "firm": "App\\Http\\Resources\\FirmResource",
      "name": "Welcome to Plannr",
      "size": "21691783",
      "tags": "App\\Http\\Resources\\TagResource",
      "type": "type",
      "uuid": "80a5f3f9-a68e-4a28-a89c-2c930ed421ce",
      "parent": "Object",
      "status": "uploaded",
      "account": "App\\Http\\Resources\\AccountResource",
      "filename": "Welcome to Plannr.pdf",
      "progress": "100",
      "extension": "pdf",
      "created_at": "2024-11-20T13:24:04+00:00",
      "updated_at": "2024-11-20T13:24:04+00:00",
      "folder_name": "folder 2",
      "uploaded_at": "2024-11-20T13:24:04+00:00",
      "download_url": "https://plannr.valet/file/8361137f-1485-454c-9de0-8b789719ed2c/download",
      "last_modified": "2024-11-20T13:24:04+00:00",
      "original_created_at": "2024-11-20T13:24:04+00:00"
    }
  ],
  "folder": {
    "name": "Important Documents",
    "path": "Codepotato/Important Documents",
    "slug": "important-documents",
    "uuid": "f84a7333-6a24-4531-a3f9-1b01f25f3cd2",
    "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-11-20T13:24:04+00:00",
    "updated_at": "2024-11-20T13:24:04+00: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-11-20T13:24:04+00:00",
  "created_by": {
    "firm": "App\\Http\\Resources\\FirmResource",
    "name": "Gareth Thompson",
    "role": "client",
    "tags": "App\\Http\\Resources\\TagResource",
    "type": "client",
    "uuid": "6e619ee1-c487-4cb5-b250-fc8f8a7749c8",
    "email": "gareth@codepotato.co.uk",
    "groups": "App\\Http\\Resources\\GroupResource",
    "owners": "App\\Http\\Resources\\AccountResource",
    "last_name": "Thompson",
    "created_at": "2024-11-20T13:24:04+00:00",
    "first_name": "Gareth",
    "updated_at": "2024-11-20T13:24:04+00: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-11-20T13:24:04+00:00",
    "has_joint_account": true,
    "current_time_entry": "App\\Http\\Resources\\TimeEntryResource",
    "first_contact_date": "2024-11-20T13:24:04+00:00",
    "external_references": "App\\Http\\Resources\\ExternalReferenceResource",
    "assigned_paraplanner": "App\\Http\\Resources\\AccountResource",
    "previous_review_date": "2024-11-20T13:24:04+00:00",
    "primary_phone_number": "App\\Http\\Resources\\ContactDetailResource",
    "assigned_administrator": "App\\Http\\Resources\\AccountResource",
    "anniversary_review_date": "2024-11-20T13:24:04+00:00"
  },
  "updated_at": "2024-11-20T13:24:04+00:00",
  "report_type_id": "rmar"
}