Endpoint#
| Property | Value |
|---|
| Type | mutation |
| Method | POST |
| Path | /api/external/v1/goals/add_target |
| Handler | OperatelyWeb.Api.Goals.AddTarget |
Authentication#
- Requires a valid API token.
- Requires a write-enabled token.
- Read-only tokens return
403.
| Field | Type | Required | Nullable | Default |
|---|
goal_id | id primitive (encoded as string) | Yes | No | - |
name | string | Yes | No | - |
start_value | float | Yes | No | - |
target_value | float | Yes | No | - |
unit | string | Yes | No | - |
Outputs#
| Field | Type | Required | Nullable |
|---|
target_id | id primitive (encoded as string) | Yes | Yes |
success | boolean | Yes | Yes |
cURL Example#
Copiedcurl --request POST \
--url "https://app.operately.com/api/external/v1/goals/add_target" \
--header "Authorization: Bearer ${OPERATELY_API_TOKEN}" \
--header "Content-Type: application/json" \
--data '{"goal_id":"value", "name":"value", "start_value":12.34, "target_value":12.34, "unit":"value"}'
Response Example#
{
"success": true,
"target_id": "value"
}