Objectives
Create objective
Create a new objective for a year. Can be yearly (quarter=null) or quarterly (quarter=1-4).
ProductionStagingUAT
POSThttps://ankiren.com/api/me/okr/{yearId}/objectives
Parameters
Path Parameters
- yearIdintegerpathRequired
OKR year ID
Request Body
Bắt buộc.
- titlestringRequired
Objective title
- descriptionstring
Optional detailed description
- quarternull | 1 | 2 | …?
null = yearly, 1-4 = quarterly
- sortOrderinteger
Display order
application/json
{ "title": "Improve health and fitness", "description": "string", "quarter": null, "sortOrder": 0 }
Responses
201 · Objective created
- objectiveOkrObjective
- idinteger
- yearIdinteger
- userIdstring
- titlestring
- descriptionstring?
- quarternull | 1 | 2 | …?
null = yearly, 1-4 = quarterly
- sortOrderinteger
- status"active" | "completed" | "cancelled"
Status of the OKR item
- createdAtstring<date-time>
- updatedAtstring<date-time>
application/json
{ "objective": { "id": 0, "yearId": 0, "userId": "string", "title": "string", "description": "string", "quarter": null, "sortOrder": 0, "status": "active", "createdAt": "2026-01-01T00:00:00.000Z", "updatedAt": "2026-01-01T00:00:00.000Z" } }
Sample Code
Đổi ngôn ngữ ở ô Language trên thanh Documentation.
cURL
curl -X POST 'https://ankiren.com/api/me/okr/{yearId}/objectives' \
-H 'Authorization: Bearer <token>' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"title": "Improve health and fitness",
"description": "string",
"quarter": null,
"sortOrder": 0
}'