swagger: '2.0' info: description: REST API for ChartHop version: V1.0.0 title: ChartHop access goalTarget API contact: name: ChartHop url: https://www.charthop.com email: support@charthop.com host: localhost schemes: - https - http consumes: - application/json produces: - application/json tags: - name: goalTarget paths: /v1/org/{orgId}/goal/{goalId}/target: get: tags: - goalTarget summary: Find goal targets for a goal operationId: findGoalTargets consumes: - application/json produces: - application/json parameters: - name: orgId in: path description: Org identifier (either id or slug) required: true type: string - name: goalId in: path description: Goal id required: true type: string - name: limit in: query description: Number of results to return required: false type: integer format: int32 - name: returnAccess in: query description: 'Return access information -- pass a list of actions to check, for example: create,update,delete' required: false type: string responses: '200': description: successful operation schema: $ref: '#/definitions/ResultsGoalTarget' '400': description: bad request '401': description: not authorized '404': description: not found post: tags: - goalTarget summary: Create a new goal target operationId: createGoalTarget consumes: - application/json produces: - application/json parameters: - name: orgId in: path description: Org identifier (either id or slug) required: true type: string - name: goalId in: path description: Goal id required: true type: string - name: body in: body description: Goal target data to create required: true schema: $ref: '#/definitions/CreateGoalTarget' responses: '201': description: created schema: $ref: '#/definitions/GoalTarget' '400': description: invalid data '401': description: not authorized '403': description: permission denied '404': description: goal not found /v1/org/{orgId}/goal/{goalId}/target/{goalTargetId}: get: tags: - goalTarget summary: Get a goal target by id operationId: getGoalTarget consumes: - application/json produces: - application/json parameters: - name: orgId in: path description: Org identifier (either id or slug) required: true type: string - name: goalId in: path description: Goal id required: true type: string - name: goalTargetId in: path description: Goal target id required: true type: string responses: '200': description: ok schema: $ref: '#/definitions/GoalTarget' '400': description: bad request '401': description: not authorized '404': description: not found patch: tags: - goalTarget summary: Update an existing goal target operationId: updateGoalTarget consumes: - application/json produces: - application/json parameters: - name: orgId in: path description: Org identifier (either id or slug) required: true type: string - name: goalId in: path description: Goal id required: true type: string - name: goalTargetId in: path description: Goal target id required: true type: string - name: body in: body description: Goal target data to update required: true schema: $ref: '#/definitions/UpdateGoalTarget' responses: '200': description: updated schema: $ref: '#/definitions/GoalTarget' '400': description: invalid data '401': description: not authorized '403': description: permission denied '404': description: not found delete: tags: - goalTarget summary: Delete a goal target operationId: deleteGoalTarget consumes: - application/json produces: - application/json parameters: - name: orgId in: path description: Org identifier (either id or slug) required: true type: string - name: goalId in: path description: Goal id required: true type: string - name: goalTargetId in: path description: Goal target id required: true type: string responses: '204': description: deleted '400': description: invalid data '401': description: not authorized '403': description: permission denied '404': description: not found /v1/org/{orgId}/goal/{goalId}/target/{goalTargetId}/actual: get: tags: - goalTarget summary: Get a goal target's current actual value operationId: getGoalTargetActual consumes: - application/json produces: - application/json parameters: - name: orgId in: path description: Org identifier (either id or slug) required: true type: string - name: goalId in: path description: Goal id required: true type: string - name: goalTargetId in: path description: Goal target id required: true type: string - name: date in: query description: Effective date required: false type: string format: date responses: '200': description: ok schema: $ref: '#/definitions/GoalTargetActual' '400': description: bad request '401': description: not authorized '404': description: not found definitions: AccessAction: type: object required: - action properties: action: type: string fields: type: array uniqueItems: true items: type: string types: type: array uniqueItems: true items: type: string GoalTargetActual: type: object required: - goalTargetId properties: goalTargetId: type: string example: 588f7ee98f138b19220041a7 value: anyOf: - type: string - type: number - type: boolean ResultsAccess: type: object required: - allowed properties: ids: type: array uniqueItems: true items: type: string example: 588f7ee98f138b19220041a7 allowed: type: array uniqueItems: true items: $ref: '#/definitions/AccessAction' ResultsGoalTarget: type: object required: - data properties: data: type: array items: $ref: '#/definitions/GoalTarget' next: type: string access: type: array items: $ref: '#/definitions/ResultsAccess' GoalTarget: type: object required: - id - orgId - goalId - type - startDate - endDate properties: id: type: string description: globally unique id example: 588f7ee98f138b19220041a7 orgId: type: string description: parent organization id example: 588f7ee98f138b19220041a7 goalId: type: string description: goal id that this target belongs to example: 588f7ee98f138b19220041a7 label: type: string description: human-readable name of the goal target example: Increase Revenue at least 10% in Q1 slug: type: string description: url-safe slug for the goal target, auto-generated from goal slug and label if not provided startValue: description: starting point value for this target, as-of the date of the goal example: '100000' anyOf: - type: string - type: number - type: boolean targetValues: type: array description: potential target values we're working to achieve items: $ref: '#/definitions/GoalTargetValue' direction: type: string description: direction of the target -- whether we want to minimize or maximize the value enum: - MINIMIZE - MAXIMIZE - TARGET type: type: string description: type of the target value enum: - MILESTONE - MONEY - PERCENT - INTEGER - DECIMAL valueExpr: type: string description: Carrot expression used to compute the current value versus target -- if not provided, GoalProgress will be used to track progress startDate: type: string format: date description: start date for this goal target endDate: type: string format: date description: end date for this goal target createId: type: string description: created by user id example: 588f7ee98f138b19220041a7 createBehalfId: type: string description: created on behalf of user id example: 588f7ee98f138b19220041a7 createAttribution: $ref: '#/definitions/Attribution' createAt: type: string description: created timestamp example: '2017-01-24T13:57:52Z' updateId: type: string description: last updated by user id example: 588f7ee98f138b19220041a7 updateBehalfId: type: string description: last updated on behalf of user id example: 588f7ee98f138b19220041a7 updateAttribution: $ref: '#/definitions/Attribution' updateAt: type: string description: last updated timestamp example: '2017-01-24T13:57:52Z' deleteId: type: string description: deleted by user id example: 588f7ee98f138b19220041a7 deleteBehalfId: type: string description: deleted on behalf of user id example: 588f7ee98f138b19220041a7 deleteAttribution: $ref: '#/definitions/Attribution' deleteAt: type: string description: deleted timestamp example: '2017-01-24T13:57:52Z' Attribution: type: object properties: principalUserId: type: string example: 588f7ee98f138b19220041a7 agentUserIds: type: array items: type: string example: 588f7ee98f138b19220041a7 eventId: type: string example: 588f7ee98f138b19220041a7 aiChatId: type: string example: 588f7ee98f138b19220041a7 aiToolUseId: type: string channel: type: string enum: - WEB - MOBILE - SLACK - TEAMS - MCP UpdateGoalTarget: type: object properties: goalId: type: string description: goal id that this target belongs to example: 588f7ee98f138b19220041a7 label: type: string description: human-readable name of the goal target example: Increase Revenue at least 10% in Q1 slug: type: string description: url-safe slug for the goal target, auto-generated from goal slug and label if not provided startValue: description: starting point value for this target, as-of the date of the goal example: '100000' anyOf: - type: string - type: number - type: boolean targetValues: type: array description: potential target values we're working to achieve items: $ref: '#/definitions/GoalTargetValue' direction: type: string description: direction of the target -- whether we want to minimize or maximize the value enum: - MINIMIZE - MAXIMIZE - TARGET type: type: string description: type of the target value enum: - MILESTONE - MONEY - PERCENT - INTEGER - DECIMAL valueExpr: type: string description: Carrot expression used to compute the current value versus target -- if not provided, GoalProgress will be used to track progress startDate: type: string format: date description: start date for this goal target endDate: type: string format: date description: end date for this goal target CreateGoalTarget: type: object required: - goalId - type - startDate - endDate properties: goalId: type: string description: goal id that this target belongs to example: 588f7ee98f138b19220041a7 label: type: string description: human-readable name of the goal target example: Increase Revenue at least 10% in Q1 slug: type: string description: url-safe slug for the goal target, auto-generated from goal slug and label if not provided startValue: description: starting point value for this target, as-of the date of the goal example: '100000' anyOf: - type: string - type: number - type: boolean targetValues: type: array description: potential target values we're working to achieve items: $ref: '#/definitions/GoalTargetValue' direction: type: string description: direction of the target -- whether we want to minimize or maximize the value enum: - MINIMIZE - MAXIMIZE - TARGET type: type: string description: type of the target value enum: - MILESTONE - MONEY - PERCENT - INTEGER - DECIMAL valueExpr: type: string description: Carrot expression used to compute the current value versus target -- if not provided, GoalProgress will be used to track progress startDate: type: string format: date description: start date for this goal target endDate: type: string format: date description: end date for this goal target GoalTargetValue: type: object required: - value properties: targetValueTypeId: type: string description: the type of the target value (for example, 'Stretch' vs 'Minimum'), extracted from the goal type's targetValues example: 588f7ee98f138b19220041a7 value: description: target value to achieve (should be a numeric value, either number, money, or percentage) example: '100000' anyOf: - type: string - type: number - type: boolean