Skip to main content
PATCH
/
v1
/
dev
/
user
/
goals
/
{goal_id}
/
progress
Update Goal Progress
curl --request PATCH \
  --url https://api.omi.me/v1/dev/user/goals/{goal_id}/progress \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://api.omi.me/v1/dev/user/goals/{goal_id}/progress"

headers = {"Authorization": "Bearer <token>"}

response = requests.patch(url, headers=headers)

print(response.text)
const options = {method: 'PATCH', headers: {Authorization: 'Bearer <token>'}};

fetch('https://api.omi.me/v1/dev/user/goals/{goal_id}/progress', 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/{goal_id}/progress",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://api.omi.me/v1/dev/user/goals/{goal_id}/progress"

req, _ := http.NewRequest("PATCH", url, nil)

req.Header.Add("Authorization", "Bearer <token>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.patch("https://api.omi.me/v1/dev/user/goals/{goal_id}/progress")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.omi.me/v1/dev/user/goals/{goal_id}/progress")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'

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,
    "max": 123,
    "min": 123,
    "unit": "<string>"
  },
  "success_criteria": [
    "<string>"
  ],
  "unit": "<string>",
  "why_it_matters": "<string>"
}
{
"detail": "<string>"
}
{
"detail": "<string>"
}
{
"detail": "<string>"
}
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}

Authorizations

Authorization
string
header
required

Send Authorization: Bearer <omi_developer_api_key>.

Path Parameters

goal_id
string
required

Query Parameters

current_value
number
required

New progress value

Response

Successful Response

created_at
string<date-time>
required
current_value
number
required
desired_outcome
string
required
goal_id
string
required
goal_type
string
required
id
string
required
is_active
boolean
required
max_value
number
required
min_value
number
required
source
string
required
status
string
required
target_value
number
required
title
string
required
updated_at
string<date-time>
required
focus_rank
integer | null
horizon_at
string<date-time> | null
metric
GoalMetric · object | null
success_criteria
string[]
unit
string | null
why_it_matters
string | null