KPI Sense REST API - Core (1.0.0)

Download OpenAPI specification:Download

KPI Sense Developers: dev@kpisense.com URL: https://www.kpisense.com

KPI Sense API interface to manage users, reports, and data integrations

Accounting

Accounting consists of managing company accounts and their respective reports. Report data points are also kept track here.

Get Company Accounts Source

Get the Company Accounts Source for a given company

path Parameters
company_pk
required
int
Example: 2

The primary key of the company

Responses

Response samples

Content type
application/json
{
  • "unique_name": "qbo",
  • "display_name": "Quickbooks Online",
  • "method": "cash"
}

Get Company Accounts Sources

Get the Company Accounts Sources for a given company

path Parameters
company_pk
required
int
Example: 2

The primary key of the company

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Authentication

A session contains a token, which is a JSON Web Token. The token is created with a user's signin credentials.

This token can be used to authenticate to the API. In addition use the token to then authenticate for further requests to the KPI Sense API.

The token should be kept private, but could be stored on the user's browser client to simulate a "session".

Unless explicitly stated A Bearer Token is needed to be set in the Authorization header of every API call.

JWT authentication

Authenticate and retrieve a JWT token to use in future api calls.

Request Body schema: application/json
username
required
string

The username of the user to authenticate

password
required
string

The password associated with the users account.

Responses

Request samples

Content type
application/json
{
  • "username": "demo_user",
  • "password": "p@ssword123"
}

Response samples

Content type
application/json
{
  • "access": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNjI1MTg0OTAwLCJqdGkiOiI1MGY0YzlmOGJmN2U0YzFmYTM2ZGM5YzhkYzU3ZTEyNCIsInVzZXJfaWQiOjEsInVzZXJuYW1lIjoibWhlbW1pbmdzZW4iLCJlbWFpbCI6Im1oZW1taW5nc2VuQGtwaXNlbnNlLmNvbSIsImlzX3N0YWZmIjp0cnVlLCJmdWxsX25hbWUiOiJNYXRoZXcgSGVtbWluZ3NlbiJ9.UnBEu_d6ak_3qwbRHqTOcKKeX0mexWIDkyagtW0AN0s\n",
  • "refresh": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoicmVmcmVzaCIsImV4cCI6MTYyNjM5NDIwMCwianRpIjoiZjk2NTUyMjA5NzY1NDhjNzgyNjdkOTMwOWI1YTMwNTgiLCJ1c2VyX2lkIjoxLCJ1c2VybmFtZSI6Im1oZW1taW5nc2VuIiwiZW1haWwiOiJtaGVtbWluZ3NlbkBrcGlzZW5zZS5jb20iLCJpc19zdGFmZiI6dHJ1ZSwiZnVsbF9uYW1lIjoiTWF0aGV3IEhlbW1pbmdzZW4ifQ.AHD0hHwJLxlGfiw413CYBB55UAo3FzSy9kHXDTB51l0\n"
}

Get Imitated User JWT Token

Retrieves the JWT Access and Refresh tokens for the imitated user

Responses

Response samples

Content type
application/json
{
  • "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
  • "refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
}

Create Imitated User JWT Token

Creates and stores the imitated user JWT token

Responses

Response samples

Content type
application/json

Company

Company information detailing specifics related to a company's entities, basic information, etc.

Get Company

Update a company

Responses

Response samples

Content type
application/json
{
  • "pk": 2,
  • "name": "Company 1",
  • "partner": {
    },
  • "currency_id": 1,
  • "implemented_by_kpi": true,
  • "is_active": true,
  • "fiscal_year_start": {
    },
  • "company_investor_profile": {
    },
  • "company_investor_data_package_link": {
    }
}

Patch Company

Update a company

Request Body schema: application/json
pk
required
int

The id of the Company.

company_name
string

The name of the Company.

currency_id
integer

The id of the currency associated with the company.

implemented_by_kpi
boolean

If the company was implemented by KPISENSE.

year_founded
integer

The year the company was founded.

city
string

The City the company is located.

state
string

The state the company is located.

country
string

The country the company is located.

industry
string

The Industry the company is a part of.

latest_funding_round
integer

The last Funding round the company has reached.

seeking_funding_amount_min
integer

The minimum amount a company is seeking for an investment.

seeking_funding_amount_max
integer

The maximum amount a company is seeking for an investment.

annual_recurring_revenue
integer

The revenue the company makes Annually.

annual_revenue_growth_rate
integer

The percent the companies revenue has grown/shrunk.

num_employees
integer

The number of employees at the company.

description
string

The description of the company

company_contact_name
string

The name of the Person who is the contact for the company.

company_contact_email
string

The email of the Person who is the contact for the company.

is_seeking_investor_matches
boolean

If the company is looking for investors or not.

Responses

Request samples

Content type
application/json
{
  • "pk": 2,
  • "company_name": "Company Forecast Scenario 1",
  • "currency_id": 1,
  • "implemented_by_kpi": true,
  • "year_founded": 2020,
  • "city": "Chicago",
  • "state": "Illinois",
  • "country": "United States",
  • "industry": "Technology",
  • "latest_funding_round": 1,
  • "seeking_funding_amount_min": 10000,
  • "seeking_funding_amount_max": 100000,
  • "annual_recurring_revenue": 10000,
  • "annual_revenue_growth_rate": 0.25,
  • "num_employees": 10,
  • "description": "A wonderful Company",
  • "company_contact_name": "Fred",
  • "company_contact_email": "Fred@example.com",
  • "is_seeking_investor_matches": true
}

Response samples

Content type
application/json
{
  • "id": 5
}

List Company Entities

Retrieves a list of company entities given the company to query on

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "total": 1
}

List Company Investor Matches

Retrieves a list of investors who have and do not have permissions to view a given company given a company id.

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "page_num": 1,
  • "num_pages": 1
}

Create Company Investor Match

Creates a match between a company investor, given the company id and investment firm id.

Responses

Response samples

Content type
application/json
{
  • "company_id": 1,
  • "investor_id": 1
}

Delete Company Investor Match

Deletes a match between a company investor, given the company id and investment firm id.

Responses

Response samples

Content type
application/json
{
  • "result": "success"
}

Contracts

Company Contracts requires a Company Customer and Company Product.

Contracts are unique and there can be no exact duplicates

Post Contract

Creates a company contract

path Parameters
company_pk
required
int
Example: 2

The primary key of the company

Request Body schema: application/json
product_uuid
required
string

The uuid assocaited with a product

customer_uuid
required
string

The uuid assocaited with a customer

recurring
required
boolean

If "True" contract will recurr after the specified end date

start_date
required
date

Start date of the contract

end_date
required
date

End date of the contract

amount
required
decimal

Total amount charged for all instances of this contract

billed_date
required
date or null

Billed date of the contract

invoice_number
required
string or null

Invoice number for the contract

rate
required
int or null

Rate charged for each contract

quantity
required
int or null

Number of times this contract is being charged

active
required
boolean

If "True" company contract is currently active

currency
required
string

Currency being used for the contract

Responses

Request samples

Content type
application/json
{
  • "product_uuid": "07351d39-753f-45c8-9dc3-93bb8b590710",
  • "customer_uuid": "360c9d77-f5fe-495a-816a-baf8f5fc53b7",
  • "recurring": true,
  • "start_date": "2021-03-01",
  • "end_date": "2021-05-01",
  • "amount": "240.00",
  • "billed_date": "2021-03-01",
  • "invoice_number": "101",
  • "rate": 50,
  • "quantity": 50,
  • "active": true,
  • "currency": "USD"
}

Response samples

Content type
application/json
{
  • "contract_uuid": "13018242-cefb-479f-a0a7-49cd1ba8ccc4",
  • "customer": {
    },
  • "product": {
    },
  • "recurring": true,
  • "start_date": "2021-03-01",
  • "end_date": "2021-05-01",
  • "amount": "240.00",
  • "billed_date": "2021-03-01",
  • "invoice_number": "101",
  • "rate": 50,
  • "quantity": 50,
  • "active": true,
  • "currency": "USD"
}

Bulk Upload Contracts

Post multiple contracts at once

path Parameters
company_pk
required
int
Example: 2

The primary key of the company

Request Body schema: multipart/form-data
Name
required
any

Customer name on contract upload

Customer ID
any or null

Customer ID on contract upload

Product Type
required
any

Product name on contract upload

Product Code
any or null

Product ID on contract upload

Product Description
any or null

Description for product if new product

Recurring
required
any

If "True" contract will recurr after the specified end date

Start Date
required
any

Start date of the contract

End Date
required
any

End date of the contract

Amount
required
any

Total amount charged for all instances of this contract

Billed Date
any or null

Billed date of the contract

Rate
any or null

Rate charged for each contract

Quantity
any or null

Number of times this contract is being charged

Invoice Number
any or null

Invoice number for the contract

Currency
required
any

Currency being used for the contract

Responses

Response samples

Content type
application/json
{
  • "Success": "success",
  • "Invalid rows": [
    ]
}

Put Contract

Update a Contract

path Parameters
contract_pk
required
string
Example: 01802cca-596c-40c2-9ddc-3662d6d8f6d8

The uuid assocaited with the contract

company_pk
required
int
Example: 2

The primary key of the company

Request Body schema: application/json
product_uuid
required
string

The uuid assocaited with a product

customer_uuid
required
string

The uuid assocaited with a customer

recurring
required
boolean

If "True" contract will recurr after the specified end date

start_date
required
date

Start date of the contract

end_date
required
date

End date of the contract

amount
required
decimal

Total amount charged for all instances of this contract

billed_date
required
date or null

Billed date of the contract

invoice_number
required
string or null

Invoice number for the contract

rate
required
int or null

Rate charged for each contract

quantity
required
int or null

Number of times this contract is being charged

active
required
boolean

If "True" company contract is currently active

currency
required
string

Currency being used for the contract

Responses

Request samples

Content type
application/json
{
  • "product_uuid": "07351d39-753f-45c8-9dc3-93bb8b590710",
  • "customer_uuid": "360c9d77-f5fe-495a-816a-baf8f5fc53b7",
  • "recurring": true,
  • "start_date": "2021-03-01",
  • "end_date": "2021-05-01",
  • "amount": "240.00",
  • "billed_date": "2021-03-01",
  • "invoice_number": "101",
  • "rate": 50,
  • "quantity": 50,
  • "active": true,
  • "currency": "USD"
}

Response samples

Content type
application/json
{
  • "contract_uuid": "13018242-cefb-479f-a0a7-49cd1ba8ccc4",
  • "customer": {
    },
  • "product": {
    },
  • "recurring": true,
  • "start_date": "2021-03-01",
  • "end_date": "2021-05-01",
  • "amount": "240.00",
  • "billed_date": "2021-03-01",
  • "invoice_number": "101",
  • "rate": 50,
  • "quantity": 50,
  • "active": true,
  • "currency": "USD"
}

List Company Contracts

Retrieves a list of all Contracts for a specific company.

path Parameters
company_pk
required
int
Example: 2

The primary key of the company

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Delete Company Contracts

Updates any amount of contracts to active = "false"

path Parameters
company_pk
required
int
Example: 2

The primary key of the company

Request Body schema: application/json
contracts
Array of strings

Array of contracts to be deleted

Responses

Request samples

Content type
application/json
{
  • "contracts": [
    ]
}

Response samples

Content type
application/json
{
  • "total_updated": 2
}

Post Company Customer

Creates a company customer

path Parameters
company_pk
required
int
Example: 2

The primary key of the company

Request Body schema: application/json
customer_name
required
string

Name of the customer

customer_id
required
string or null

Code for referencing the customer

Responses

Request samples

Content type
application/json
{
  • "customer_name": "Customer 1",
  • "customer_id": "Cust1"
}

Response samples

Content type
application/json
{
  • "customer_uuid": "360c9d77-f5fe-495a-816a-baf8f5fc53b7",
  • "name": "Customer 1",
  • "customer_identifier": "Cust1",
  • "active": true
}

List Company Customers

Retrieves a list of all customers for a specific company.

path Parameters
company_pk
required
int
Example: 2

The primary key of the company

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Post Company Product

Creates a company product

path Parameters
company_pk
required
int
Example: 2

The primary key of the company

Request Body schema: application/json
product_name
required
string

Name of the product

product_description
required
string or null

Description of the product

prodcut_code
required
string or null

Code for referencing the product

Responses

Request samples

Content type
application/json
{
  • "product_name": "Monthly Service",
  • "product_description": "Standard monthly service fee",
  • "prodcut_code": "MSF1"
}

Response samples

Content type
application/json
{
  • "product_uuid": "07351d39-753f-45c8-9dc3-93bb8b590710",
  • "name": "Monthly Service",
  • "product_code": "MSF1",
  • "description": "Standard monthly service fee",
  • "active": true
}

List Company Products

Retrieves a list of all products for a specific company.

path Parameters
company_pk
required
int
Example: 2

The primary key of the company

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Groupings

Groupings consists of one parent grouping and many child groupings.

A grouping and its customer are unique, no customer can be a part of 2 grouping.

Post Grouping

Create a parent or child grouping.

path Parameters
company_pk
required
int
Example: 2

The primary key of the company

Request Body schema: application/json
One of
customer_uuid
required
string

The uuid associated with a customer.

Responses

Request samples

Content type
application/json
Example
{
  • "customer_uuid": "80818220-aaef-4e29-ab60-bb9cadada8a6"
}

Response samples

Content type
application/json
Example
{
  • "pk": 1,
  • "company": 1,
  • "customer_name": "John Smith",
  • "customer_uuid": "80818220-aaef-4e29-ab60-bb9cadada8a6"
}

Patch Grouping

Update a parent or child grouping.

path Parameters
company_pk
required
int
Example: 2

The primary key of the company

Request Body schema: application/json
One of
customer_uuid
required
string

The uuid associated with a customer.

parent_grouping_pk
required
int

The pk associated with the parent grouping.

Responses

Request samples

Content type
application/json
Example
{
  • "customer_uuid": "80818220-aaef-4e29-ab60-bb9cadada8a6",
  • "parent_grouping_pk": 1
}

Response samples

Content type
application/json
Example
{
  • "pk": 1,
  • "company": 1,
  • "customer_name": "John Smith",
  • "customer_uuid": "80818220-aaef-4e29-ab60-bb9cadada8a6"
}

Delete Grouping

Delete a parent or child grouping.

path Parameters
company_pk
required
int
Example: 2

The primary key of the company

Request Body schema: application/json
One of
parent_grouping_pk
required
int

The pk associated with a parent grouping.

Responses

Request samples

Content type
application/json
Example
{
  • "parent_grouping_pk": 1
}

Response samples

Content type
application/json
{
  • "success": "success"
}

List Parent and Child groupings

Retrieves a list of parent and child groupings for a specific company.

path Parameters
company_pk
required
int
Example: 2

The primary key of the company

Responses

Response samples

Content type
application/json
[
  • [
    ]
]

Reporting

The dashboard associated with a company.

Post Dashboard

Create a dashboard for a specified company

Request Body schema: application/json
name
required
string

The name of the dashboard.

company_id
required
int

The id of the company assocaited with the dashboard.

panels
required
array

An array of dashboard panel configurations.

widgets
required
array

An array of dashboard widget configurations.

Responses

Request samples

Content type
application/json
{
  • "name": "A Test Board",
  • "company_id": 2,
  • "panels": [
    ],
  • "widgets": [
    ]
}

Response samples

Content type
application/json
{
  • "id": 1
}

List Company Dashboards

Retrieves an array of dashboards for a company

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Patch Dashboard

Updates a specfic dashboard for a company

Request Body schema: application/json
name
required
string

The name of the dashboard.

panels
required
array

An array of dashboard panel configurations.

widgets
required
array

An array of dashboard widget configurations.

Responses

Request samples

Content type
application/json
{
  • "name": "A Test Board",
  • "panels": [
    ],
  • "widgets": [
    ]
}

Response samples

Content type
application/json
{
  • "id": 1
}

Get Dashboard

Retrieves a specfic dashboard for a company

Responses

Response samples

Content type
application/json
{
  • "pk": 1,
  • "name": "A Test Board",
  • "panels": [
    ],
  • "widgets": [
    ]
}

GET Mongo Metadata

Retrieves metadata from kpi_dashboard_report on MongoDB by company_report_model_id

Responses

Response samples

Content type
application/json
{
  • "report_model_pk": [
    ],
  • "categories": [
    ]
}

List Company Report Status

Retrieves a list of report statuses for a company

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Post Company Report Status

Creates a company report status when generating a report

Request Body schema: application/json
workflow_identifier
string

String representation of the specific workflow to be used

version
string

The version of the workflow to be used

object

User settings to apply when executing the workflow

Responses

Request samples

Content type
application/json
{
  • "workflow_identifier": "mrr",
  • "version": "1.3",
  • "runtime_inputs": {
    }
}

Response samples

Content type
application/json
{
  • "report_status": {
    },
  • "stepfunction_response": {
    }
}

Forecasting

The Forecasting module consists of multiple pieces. A Company Forecast Scenario is the root of a particular forecast.

A Company Forecast Scenario has a 1 to 1 ratio with Forecast Scenarios and the Forecast Scenarios define how the CFSs will be setup and used.

A Company Forecast Scenario consists of multiple forecasts, where each forecast will have an accompanying forecast type.

List Forecast Types

Retrieves a list of Forecast Types available for forecast_scenario

Request Body schema: application/json
company_forecast_scenario_pk
required
int

The id of the company forecast scenario associated with the forecast types.

Responses

Request samples

Content type
application/json
{
  • "company_forecast_scenario_pk": 2
}

Response samples

Content type
application/json
{
  • "data": {
    },
  • "total": 1
}

List Forecast Scenarios

Retrieves a list of Forecast Scenarios available for forecast_scenario

Request Body schema: application/json
is_active
bool

Classifies if a Forecast Scenario is Active.

Responses

Request samples

Content type
application/json
{
  • "is_active": true
}

Response samples

Content type
application/json
{
  • "data": {
    },
  • "total": 1
}

Post Company Forecast Scenario

Create a company forecast scenario

Request Body schema: application/json
company_forecast_name
required
string

The name of the Company Forecast Scenario.

forecast_scenario
required
int

The id of the forecast scenario assigned to the CFS.

coverage_start_date
required
string

The start date of where the user will forecast.

coverage_end_date
required
string

The end date cutoff of how far the user would like to forecast.

forecast_owner
required
int

The id of the owner assigned to the CFS.

Responses

Request samples

Content type
application/json
{
  • "company_forecast_name": "CFS 1",
  • "forecast_scenario": 2,
  • "coverage_start_date": "2020-07-28T08:08:55.79Z",
  • "coverage_end_date": "2022-07-28T08:08:55.79Z",
  • "forecast_owner": 11
}

Response samples

Content type
application/json
{
  • "id": 10
}

Patch Company Forecast Scenario

Update a company forecast scenario

Request Body schema: application/json
pk
required
int

The id of the Company Forecast Scenario.

name
string

The name of the Company Forecast Scenario.

coverage_start_date
string

The start date of where the user will forecast.

coverage_end_date
string

The end date cutoff of how far the user would like to forecast.

updated_on
string

The date the Company Forecast Scenario was updated on.

updated_by_id
required
int

The id of the User updating the Company Forecast Scenario.

Responses

Request samples

Content type
application/json
{
  • "pk": 2,
  • "name": "Company Forecast Scenario 1",
  • "coverage_start_date": "2020-07-28T08:08:55.79Z",
  • "coverage_end_date": "2022-07-28T08:08:55.79Z",
  • "updated_on": "2010-07-28T08:08:55.79Z",
  • "updated_by_id": 1
}

Response samples

Content type
application/json
{
  • "id": 10
}

Get Forecast

Retrieves a company forecast scenario's forecast

Responses

Response samples

Content type
application/json
{
  • "pk": 2,
  • "name": "Forecast 1",
  • "company_forecast_scenario_id": 23,
  • "forecast_type": {
    },
  • "created_by": {
    },
  • "created_on": "2021-08-25T16:37:51.393876+00:00",
  • "is_active": true,
  • "updated_by": {
    },
  • "updated_on": "2021-10-29T16:37:51.393876+00:00",
  • "company_entity": {
    }
}

Post Forecast

Create a forecast

Request Body schema: application/json
forecast_name
required
string

The name of the new Forecast.

forecast_type
required
int

The id of the forecast type assigned to this forecast.

company_entity
int

The id of the company entity connected to this forecast.

Responses

Request samples

Content type
application/json
{
  • "forecast_name": "Forecast 1",
  • "forecast_type": 4,
  • "company_entity": 12
}

Response samples

Content type
application/json
{
  • "id": 5
}

Investor

Investor information provided for potential clients and vice versa.

Batch Create Company Investors Matches

Creates Matches for multiple investors with one company

query Parameters
send_email
any

If true, sends an email to all connected companies and investors upon match creation

Request Body schema: application/json
investor_pks
required
array

List of investors IDs

Responses

Request samples

Content type
application/json
{
  • "investor_pks": [
    ]
}

Response samples

Content type
application/json
{
  • "company_pk": 2,
  • "success_investor_pks": [
    ],
  • "fail_investor_pks": [ ]
}

List Investor Matched Companies

Retrieves a list of companies who investors can view based on the investor_id.

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "page_num": 1,
  • "num_pages": 1,
  • "Data": 1
}