Create Goal
curl --request POST \
--url https://api.omi.me/v1/dev/user/goals \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "<string>",
"current_value": 123,
"desired_outcome": "<string>",
"horizon_at": "2023-11-07T05:31:56Z",
"max_value": 123,
"min_value": 123,
"success_criteria": [
"<string>"
],
"target_value": 123,
"unit": "<string>",
"why_it_matters": "<string>"
}
'import requests
url = "https://api.omi.me/v1/dev/user/goals"
payload = {
"title": "<string>",
"current_value": 123,
"desired_outcome": "<string>",
"horizon_at": "2023-11-07T05:31:56Z",
"max_value": 123,
"min_value": 123,
"success_criteria": ["<string>"],
"target_value": 123,
"unit": "<string>",
"why_it_matters": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: '<string>',
current_value: 123,
desired_outcome: '<string>',
horizon_at: '2023-11-07T05:31:56Z',
max_value: 123,
min_value: 123,
success_criteria: ['<string>'],
target_value: 123,
unit: '<string>',
why_it_matters: '<string>'
})
};
fetch('https://api.omi.me/v1/dev/user/goals', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.omi.me/v1/dev/user/goals",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'title' => '<string>',
'current_value' => 123,
'desired_outcome' => '<string>',
'horizon_at' => '2023-11-07T05:31:56Z',
'max_value' => 123,
'min_value' => 123,
'success_criteria' => [
'<string>'
],
'target_value' => 123,
'unit' => '<string>',
'why_it_matters' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.omi.me/v1/dev/user/goals"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"current_value\": 123,\n \"desired_outcome\": \"<string>\",\n \"horizon_at\": \"2023-11-07T05:31:56Z\",\n \"max_value\": 123,\n \"min_value\": 123,\n \"success_criteria\": [\n \"<string>\"\n ],\n \"target_value\": 123,\n \"unit\": \"<string>\",\n \"why_it_matters\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.omi.me/v1/dev/user/goals")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"current_value\": 123,\n \"desired_outcome\": \"<string>\",\n \"horizon_at\": \"2023-11-07T05:31:56Z\",\n \"max_value\": 123,\n \"min_value\": 123,\n \"success_criteria\": [\n \"<string>\"\n ],\n \"target_value\": 123,\n \"unit\": \"<string>\",\n \"why_it_matters\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.omi.me/v1/dev/user/goals")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"<string>\",\n \"current_value\": 123,\n \"desired_outcome\": \"<string>\",\n \"horizon_at\": \"2023-11-07T05:31:56Z\",\n \"max_value\": 123,\n \"min_value\": 123,\n \"success_criteria\": [\n \"<string>\"\n ],\n \"target_value\": 123,\n \"unit\": \"<string>\",\n \"why_it_matters\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"created_at": "2023-11-07T05:31:56Z",
"current_value": 123,
"desired_outcome": "<string>",
"goal_id": "<string>",
"goal_type": "<string>",
"id": "<string>",
"is_active": true,
"max_value": 123,
"min_value": 123,
"source": "<string>",
"status": "<string>",
"target_value": 123,
"title": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"focus_rank": 123,
"horizon_at": "2023-11-07T05:31:56Z",
"metric": {
"current": 123,
"target": 123,
"type": "boolean",
"max": 123,
"min": 123,
"unit": "<string>"
},
"success_criteria": [
"<string>"
],
"unit": "<string>",
"why_it_matters": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Goals
Create Goal
Create a durable goal. Metrics are optional and other goals are never changed implicitly.
- title: The goal title/description (1-500 characters)
- goal_type: Optional metric type: boolean, scale, or numeric
- target_value: Optional target value
- current_value: Optional current progress
- min_value: Optional minimum scale value
- max_value: Optional maximum scale value
- unit: Optional unit label (e.g., ‘users’, ‘points’)
Omit all metric fields to create a qualitative goal.
POST
/
v1
/
dev
/
user
/
goals
Create Goal
curl --request POST \
--url https://api.omi.me/v1/dev/user/goals \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"title": "<string>",
"current_value": 123,
"desired_outcome": "<string>",
"horizon_at": "2023-11-07T05:31:56Z",
"max_value": 123,
"min_value": 123,
"success_criteria": [
"<string>"
],
"target_value": 123,
"unit": "<string>",
"why_it_matters": "<string>"
}
'import requests
url = "https://api.omi.me/v1/dev/user/goals"
payload = {
"title": "<string>",
"current_value": 123,
"desired_outcome": "<string>",
"horizon_at": "2023-11-07T05:31:56Z",
"max_value": 123,
"min_value": 123,
"success_criteria": ["<string>"],
"target_value": 123,
"unit": "<string>",
"why_it_matters": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: '<string>',
current_value: 123,
desired_outcome: '<string>',
horizon_at: '2023-11-07T05:31:56Z',
max_value: 123,
min_value: 123,
success_criteria: ['<string>'],
target_value: 123,
unit: '<string>',
why_it_matters: '<string>'
})
};
fetch('https://api.omi.me/v1/dev/user/goals', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.omi.me/v1/dev/user/goals",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'title' => '<string>',
'current_value' => 123,
'desired_outcome' => '<string>',
'horizon_at' => '2023-11-07T05:31:56Z',
'max_value' => 123,
'min_value' => 123,
'success_criteria' => [
'<string>'
],
'target_value' => 123,
'unit' => '<string>',
'why_it_matters' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.omi.me/v1/dev/user/goals"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"current_value\": 123,\n \"desired_outcome\": \"<string>\",\n \"horizon_at\": \"2023-11-07T05:31:56Z\",\n \"max_value\": 123,\n \"min_value\": 123,\n \"success_criteria\": [\n \"<string>\"\n ],\n \"target_value\": 123,\n \"unit\": \"<string>\",\n \"why_it_matters\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.omi.me/v1/dev/user/goals")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"current_value\": 123,\n \"desired_outcome\": \"<string>\",\n \"horizon_at\": \"2023-11-07T05:31:56Z\",\n \"max_value\": 123,\n \"min_value\": 123,\n \"success_criteria\": [\n \"<string>\"\n ],\n \"target_value\": 123,\n \"unit\": \"<string>\",\n \"why_it_matters\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.omi.me/v1/dev/user/goals")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"<string>\",\n \"current_value\": 123,\n \"desired_outcome\": \"<string>\",\n \"horizon_at\": \"2023-11-07T05:31:56Z\",\n \"max_value\": 123,\n \"min_value\": 123,\n \"success_criteria\": [\n \"<string>\"\n ],\n \"target_value\": 123,\n \"unit\": \"<string>\",\n \"why_it_matters\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"created_at": "2023-11-07T05:31:56Z",
"current_value": 123,
"desired_outcome": "<string>",
"goal_id": "<string>",
"goal_type": "<string>",
"id": "<string>",
"is_active": true,
"max_value": 123,
"min_value": 123,
"source": "<string>",
"status": "<string>",
"target_value": 123,
"title": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"focus_rank": 123,
"horizon_at": "2023-11-07T05:31:56Z",
"metric": {
"current": 123,
"target": 123,
"type": "boolean",
"max": 123,
"min": 123,
"unit": "<string>"
},
"success_criteria": [
"<string>"
],
"unit": "<string>",
"why_it_matters": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Send Authorization: Bearer <omi_developer_api_key>.
Body
application/json
The goal title/description
Required string length:
1 - 500Optional current progress
Maximum string length:
2000Optional metric type
Available options:
boolean, scale, numeric Optional maximum scale value
Optional minimum scale value
Maximum array length:
20Optional target value
Unit label (e.g., 'users', 'points')
Maximum string length:
2000Response
Successful Response
Show child attributes
Show child attributes