Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
303 changes: 303 additions & 0 deletions openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14367,6 +14367,192 @@ paths:
"422":
$ref: '#/components/responses/UnprocessableEntity'

/impact_frameworks/{id}/measurement_plan:
get:
tags: [Library]
summary: Get an Impact Framework's Measurement Plan
operationId: getImpactFrameworkMeasurementPlan
description: |
The Measurement Plan of an Impact Framework (Template): for each metric on it, why it is measured,
how it is collected and how often. It is what the framework page's **Measurement plan** view shows.
A metric can sit on many frameworks, so the plan belongs to the framework, not the metric.

Rows come in the framework's order: stage by stage (`stage`), with an Outcome's Indicators together
under that Outcome (`outcome`). `kind` says what the metric counts: `count` (an Activity or Engagement
tracker), `achievement`, `scale` or `quantity` (an Indicator), or `tracker` (a Cohort, Workflow or
Formula Tracker). `description` is the framework's own reason for measuring the metric, or the
metric's description until the framework gives one. `frequency` and `methods` are empty until someone
plans them.

A `survey` method names the Survey (Story Category) used. The other methods are `timeline` (posts on
a contact's timeline or the Newsfeed), `event_register`, `spreadsheet` (an import) and `integration`.

You must be able to view the framework. For a project's Theory of Change, use
`GET /projects/{project_id}/measurement_plan`. Anything else answers `404`.
security: [{tokenAuth: []}]
parameters:
- name: id
in: path
required: true
description: The id of the Impact Framework (Template)
schema:
type: integer
example: 7174
- $ref: '#/components/parameters/Page'
- $ref: '#/components/parameters/PerPage'
responses:
"200":
$ref: '#/components/responses/MeasurementPlan'
"401":
$ref: '#/components/responses/Unauthorized'
"404":
$ref: '#/components/responses/NotFound'

patch:
tags: [Library]
summary: Change a metric on an Impact Framework's Measurement Plan
operationId: updateImpactFrameworkMeasurementPlan
description: |
Changes the plan for one metric on an Impact Framework: why it is measured (`description`), how often (`frequency`,
with `custom_frequency` when it is `custom`), how it is collected (`methods`). Give only
the parts to change; the others stay as they are. All of them are saved, or none.

`methods` replaces the metric's methods. `methods.survey_ids` must be Surveys (Story Categories) that
already ask about the metric and are yours, your organisation's, or already chosen. To add
the metric to a Survey first, use [Add metric to](#add-metric-to). Trackers can't be asked in a Survey.
Colleagues are assigned on each project's plan, so `assignee_user_ids` answers `422` here.

You need to be able to edit the plan: the framework's creator, or an Organisation Editor of its organisation. Someone who can read the plan but not edit it gets `403`.
security: [{tokenAuth: []}]
parameters:
- name: id
in: path
required: true
description: The id of the Impact Framework (Template)
schema:
type: integer
example: 7174
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/MeasurementPlanChange'
example:
metric_type: Indicator
metric_id: 9921
description: Shows whether the sessions build confidence
frequency: start_and_end
methods: { survey_ids: [812], types: [event_register] }
responses:
"200":
description: The metric's plan as it now stands
content:
application/json:
schema:
type: object
properties:
impact_framework: { $ref: '#/components/schemas/MeasurementPlanFramework' }
data: { $ref: '#/components/schemas/MeasurementPlanRow' }
"401":
$ref: '#/components/responses/Unauthorized'
"403":
$ref: '#/components/responses/Forbidden'
"404":
$ref: '#/components/responses/NotFound'
"422":
$ref: '#/components/responses/UnprocessableEntity'

/projects/{project_id}/measurement_plan:
get:
tags: [Library, Projects]
summary: Get a project's Measurement Plan
operationId: getProjectMeasurementPlan
description: |
The Measurement Plan of a project's Theory of Change: the Impact Framework that holds the project's
own metrics. It is what the project's Results Canvas shows in its **Measurement plan** view. The
response is the same as `GET /impact_frameworks/{id}/measurement_plan`, with
`impact_framework.project_id` set.

You must be on the project, or in its organisation. Anything else answers `404`.
security: [{tokenAuth: []}]
parameters:
- name: project_id
in: path
required: true
description: The id of the project
schema:
type: integer
example: 2210
- $ref: '#/components/parameters/Page'
- $ref: '#/components/parameters/PerPage'
responses:
"200":
$ref: '#/components/responses/MeasurementPlan'
"401":
$ref: '#/components/responses/Unauthorized'
"404":
$ref: '#/components/responses/NotFound'

patch:
tags: [Library]
summary: Change a metric on a project's Measurement Plan
operationId: updateProjectMeasurementPlan
description: |
Changes the plan for one metric on a project's Theory of Change: why it is measured (`description`), how often (`frequency`,
with `custom_frequency` when it is `custom`), how it is collected (`methods`) and who measures it (`assignee_user_ids`). Give only
the parts to change; the others stay as they are. All of them are saved, or none.

`methods` replaces the metric's methods. `methods.survey_ids` must be Surveys (Story Categories) that
already ask about the metric and are yours, your organisation's, the project's, or already chosen. To add
the metric to a Survey first, use [Add metric to](#add-metric-to). Trackers can't be asked in a Survey.

`assignee_user_ids` replaces who measures the metric, from the project's editors and reporters. A
reporter assigned or unassigned here is assigned or unassigned on the project's Assign Metrics page too,
so an unassigned reporter can no longer record that metric.

You need to be able to edit the plan: a Project Editor of the project, or an Organisation Editor of its organisation. Someone who can read the plan but not edit it gets `403`.
security: [{tokenAuth: []}]
parameters:
- name: project_id
in: path
required: true
description: The id of the project
schema:
type: integer
example: 2210
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/MeasurementPlanChange'
example:
metric_type: Indicator
metric_id: 9921
description: Shows whether the sessions build confidence
frequency: start_and_end
methods: { survey_ids: [812], types: [event_register] }
assignee_user_ids: [4410]
responses:
"200":
description: The metric's plan as it now stands
content:
application/json:
schema:
type: object
properties:
impact_framework: { $ref: '#/components/schemas/MeasurementPlanFramework' }
data: { $ref: '#/components/schemas/MeasurementPlanRow' }
"401":
$ref: '#/components/responses/Unauthorized'
"403":
$ref: '#/components/responses/Forbidden'
"404":
$ref: '#/components/responses/NotFound'
"422":
$ref: '#/components/responses/UnprocessableEntity'

/impact_frameworks/{id}/additions:
get:
tags: [Library]
Expand Down Expand Up @@ -22332,6 +22518,40 @@ components:
description: Also include Indicators or Outcomes from the public library shared by all organisations (default false)

responses:
MeasurementPlan:
description: The Measurement Plan's rows, in the framework's order
content:
application/json:
schema:
type: object
properties:
impact_framework: { $ref: '#/components/schemas/MeasurementPlanFramework' }
page: { type: integer }
page_size: { type: integer }
page_count: { type: integer }
total_count: { type: integer }
data:
type: array
items: { $ref: '#/components/schemas/MeasurementPlanRow' }
example:
impact_framework: { id: 7174, name: Youth Club Theory of Change, project_id: 2210, can_edit: true }
page: 1
page_size: 1
page_count: 1
total_count: 1
data:
- metric: { type: Indicator, id: 9921, name: Feels confident speaking up }
stage: { id: 3, name: Short-term outcomes }
outcome: { id: 5521, title: Improved confidence }
kind: scale
description: Shows whether the sessions build confidence
frequency: start_and_end
custom_frequency: null
methods:
- { type: survey, survey: { id: 812, name: Confidence check-in } }
- { type: event_register, survey: null }
assignees:
- { id: 4410, name: Thandi Mokoena }

EventFormatAdminOnly:
description: You are not an Organisation Admin of the organisation that owns the Event Format
Expand Down Expand Up @@ -22565,6 +22785,89 @@ components:
error: "Webhooks are not turned on for this organisation"

schemas:
MeasurementPlanFramework:
type: object
properties:
id: { type: integer }
name: { type: string }
project_id: { type: integer, nullable: true, description: The project whose Theory of Change this is, or null for a framework }
can_edit: { type: boolean, description: Whether you may change this plan }
MeasurementPlanRow:
type: object
properties:
metric:
type: object
properties:
type: { type: string, enum: [Change, Indicator, CohortTracker, WorkflowTracker, FormulaTracker] }
id: { type: integer }
name: { type: string }
stage:
type: object
nullable: true
description: The Impact Scorecard column the framework puts the metric in
properties:
id: { type: integer }
name: { type: string }
outcome:
type: object
nullable: true
description: The Outcome an Indicator is measured under; null for other metrics
properties:
id: { type: integer }
title: { type: string }
kind: { type: string, enum: [count, achievement, scale, quantity, indicator, tracker] }
description: { type: string, nullable: true, description: Why the framework measures this metric }
frequency:
type: string
nullable: true
enum: [every_occasion, start_and_end, start, end, weekly, monthly, quarterly, yearly, custom, null]
custom_frequency: { type: string, nullable: true, description: The frequency in the plan's own words, when frequency is custom }
methods:
type: array
items:
type: object
properties:
type: { type: string, enum: [survey, timeline, event_register, spreadsheet, integration] }
survey:
type: object
nullable: true
description: The Survey (Story Category) used, for a survey method
properties:
id: { type: integer }
name: { type: string }
assignees:
type: array
description: Who measures the metric, on a project's plan. Always empty on a framework, whose colleagues are assigned on each project.
items:
type: object
properties:
id: { type: integer }
name: { type: string }
MeasurementPlanChange:
type: object
required: [metric_type, metric_id]
properties:
metric_type: { type: string, enum: [Change, Indicator, CohortTracker, WorkflowTracker, FormulaTracker] }
metric_id: { type: integer }
description: { type: string, nullable: true, maxLength: 2000, description: Why the framework measures the metric. Empty clears it. }
frequency:
type: string
nullable: true
enum: [every_occasion, start_and_end, start, end, weekly, monthly, quarterly, yearly, custom, null]
description: Empty clears it
custom_frequency: { type: string, maxLength: 255, description: Required when frequency is custom }
methods:
type: object
description: Replaces how the metric is collected
properties:
survey_ids: { type: array, items: { type: integer } }
types:
type: array
items: { type: string, enum: [timeline, event_register, spreadsheet, integration] }
assignee_user_ids:
type: array
description: Replaces who measures the metric (a project's plan only)
items: { type: integer }
OnboardingJourney:
type: object
properties:
Expand Down
Loading
Loading