---
title: "Create a new goal target"
method: POST
path: "/v1/org/{orgId}/goal/{goalId}/target"
tags: ["goalTarget"]
---

# Create a new goal target

`POST /v1/org/{orgId}/goal/{goalId}/target`

## Request

- Base URL: `https://localhost`
- URL: `https://localhost/v1/org/{orgId}/goal/{goalId}/target`
- Auth: none declared
- TypeScript: <https://skmtc.dev/charthop/apis/charthop-api/docs/v1/org/:orgId/goal/:goalId/target/post.ts> (a function with typed inputs; its response is checked against the schema)

## Path parameters

- `orgId` string, required
- `goalId` string, required

## Request body

- CreateGoalTarget
  - `goalId` string, required: goal id that this target belongs to
  - `label` string: human-readable name of the goal target
  - `labelTr` Translations
    - `values` object, required
  - `slug` string: url-safe slug for the goal target, auto-generated from goal slug and label if not provided
  - `startValue` union: starting point value for this target, as-of the date of the goal
    - string
    - number
    - boolean
  - `targetValues` GoalTargetValue[]: potential target values we're working to achieve
    - `targetValueTypeId` string: the type of the target value (for example, 'Stretch' vs 'Minimum'), extracted from the goal type's targetValues
    - `value` union, required: target value to achieve (should be a numeric value, either number, money, or percentage)
      - string
      - number
      - boolean
  - `direction` 'MINIMIZE' | 'MAXIMIZE' | 'TARGET': direction of the target -- whether we want to minimize or maximize the value
  - `type` 'MILESTONE' | 'MONEY' | 'PERCENT' | 'INTEGER' | 'DECIMAL', required: type of the target value
  - `valueExpr` string: Carrot expression used to compute the current value versus target -- if not provided, GoalProgress will be used to track progress
  - `startDate` string, date, required: start date for this goal target
  - `endDate` string, date, required: end date for this goal target

## Response `201`

created

- GoalTarget
  - `id` string, required: globally unique id
  - `orgId` string, required: parent organization id
  - `goalId` string, required: goal id that this target belongs to
  - `label` string: human-readable name of the goal target
  - `labelTr` Translations
    - `values` object, required
  - `slug` string: url-safe slug for the goal target, auto-generated from goal slug and label if not provided
  - `startValue` union: starting point value for this target, as-of the date of the goal
    - string
    - number
    - boolean
  - `targetValues` GoalTargetValue[]: potential target values we're working to achieve
    - `targetValueTypeId` string: the type of the target value (for example, 'Stretch' vs 'Minimum'), extracted from the goal type's targetValues
    - `value` union, required: target value to achieve (should be a numeric value, either number, money, or percentage)
      - string
      - number
      - boolean
  - `direction` 'MINIMIZE' | 'MAXIMIZE' | 'TARGET': direction of the target -- whether we want to minimize or maximize the value
  - `type` 'MILESTONE' | 'MONEY' | 'PERCENT' | 'INTEGER' | 'DECIMAL', required: type of the target value
  - `valueExpr` string: Carrot expression used to compute the current value versus target -- if not provided, GoalProgress will be used to track progress
  - `startDate` string, date, required: start date for this goal target
  - `endDate` string, date, required: end date for this goal target
  - `createId` string: created by user id
  - `createBehalfId` string: created on behalf of user id
  - `createAttribution` Attribution
    - `principalUserId` string
    - `agentUserIds` string[]
    - `eventId` string
    - `aiChatId` string
    - `aiToolUseId` string
    - `channel` 'WEB' | 'MOBILE' | 'SLACK' | 'TEAMS' | 'MCP'
  - `createAt` string: created timestamp
  - `updateId` string: last updated by user id
  - `updateBehalfId` string: last updated on behalf of user id
  - `updateAttribution` Attribution
    - `principalUserId` string
    - `agentUserIds` string[]
    - `eventId` string
    - `aiChatId` string
    - `aiToolUseId` string
    - `channel` 'WEB' | 'MOBILE' | 'SLACK' | 'TEAMS' | 'MCP'
  - `updateAt` string: last updated timestamp
  - `deleteId` string: deleted by user id
  - `deleteBehalfId` string: deleted on behalf of user id
  - `deleteAttribution` Attribution
    - `principalUserId` string
    - `agentUserIds` string[]
    - `eventId` string
    - `aiChatId` string
    - `aiToolUseId` string
    - `channel` 'WEB' | 'MOBILE' | 'SLACK' | 'TEAMS' | 'MCP'
  - `deleteAt` string: deleted timestamp

## Other responses

- `400`: invalid data
- `401`: not authorized
- `403`: permission denied
- `404`: goal not found

---

[API](https://skmtc.dev/charthop/apis/charthop-api.md) - [All operations](https://skmtc.dev/charthop/apis/charthop-api/llms.txt) - [OpenAPI document](https://skmtc.dev/charthop/apis/charthop-api/revisions/5abf11116bbb?raw)
