Create a Report Template

POST /api/v1/report-template

Headers

application/json

Body Required

  • name string Required

    Name of the report template

  • report_type_id string Required

    Valid report type id, this template will generate reports of this type

  • report_query array[string]

    Extra query information that may be either required or optional depending on the report type

Responses

  • 200 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 template

    • The account that created this report template

      Additional properties are allowed.

    • Report type id of the report type to generate when using this template

    • Extra query information that will be used in generating the report

      Additional properties are allowed.

POST /api/v1/report-template
curl \
 -X POST https://api.plannrcrm.com/api/v1/report-template \
 -H "Authorization: Bearer {OAUTH_ACCESS_TOKEN or PERSONAL_ACCESS_TOKEN}" \
 -H "Content-Type: application/json" \
 -H "Accept: application/json" \
 -d '{"name":"Task report for clients over the age 60","report_type_id":"rmar","report_query":[{"start_age":60}]}'
Request examples
# Headers
Authorization: Bearer {OAUTH_ACCESS_TOKEN or PERSONAL_ACCESS_TOKEN}
Content-Type: application/json
Accept: application/json

# Payload
{
  "name": "Task report for clients over the age 60",
  "report_type_id": "rmar",
  "report_query": [
    {
      "start_age": 60
    }
  ]
}
Response examples (200)
{
  "name": "2 weeks overdue task report",
  "uuid": "16808e5b-89a4-4177-9675-27575b8f7f88",
  "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": "a312118d-8467-4b8b-a444-0022b48c0aa9",
    "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_query": {
    "start_date": "2024-11-20T13:24:04+00:00"
  },
  "report_type_id": "rmar"
}