Delete goal by ID
curl --request DELETE \
--url https://app.hipp.health/api/v1/goals/{goalId}import requests
url = "https://app.hipp.health/api/v1/goals/{goalId}"
response = requests.delete(url)
print(response.text)const options = {method: 'DELETE'};
fetch('https://app.hipp.health/api/v1/goals/{goalId}', 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://app.hipp.health/api/v1/goals/{goalId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$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://app.hipp.health/api/v1/goals/{goalId}"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://app.hipp.health/api/v1/goals/{goalId}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.hipp.health/api/v1/goals/{goalId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body{
"success": true
}{
"message": "Validation Error",
"statusCode": 400,
"validationErrors": [
{
"code": "invalid_type",
"message": "Required",
"path": [
"email"
]
}
]
}{
"error": "An unexpected error occurred",
"statusCode": 500
}Goals
Delete Goal
Delete a goal by goalId. Works for all goal types (behavior, skill, rating, or interval)
DELETE
/
v1
/
goals
/
{goalId}
Delete goal by ID
curl --request DELETE \
--url https://app.hipp.health/api/v1/goals/{goalId}import requests
url = "https://app.hipp.health/api/v1/goals/{goalId}"
response = requests.delete(url)
print(response.text)const options = {method: 'DELETE'};
fetch('https://app.hipp.health/api/v1/goals/{goalId}', 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://app.hipp.health/api/v1/goals/{goalId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$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://app.hipp.health/api/v1/goals/{goalId}"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://app.hipp.health/api/v1/goals/{goalId}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.hipp.health/api/v1/goals/{goalId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body{
"success": true
}{
"message": "Validation Error",
"statusCode": 400,
"validationErrors": [
{
"code": "invalid_type",
"message": "Required",
"path": [
"email"
]
}
]
}{
"error": "An unexpected error occurred",
"statusCode": 500
}Delete Goal
Delete a goal by goalId. Works for all goal types (frequency_duration, opportunity, rating, or interval).Path Parameters
goalId(required): The goal’s public identifier
Headers
Authorization: Bearer <your-api-key>
Success Response (200)
{
"success": true
}
Error Responses
400 - Validation Error
{
"error": "Validation error",
"details": [
{
"code": "invalid_type",
"message": "Invalid goal ID format",
"path": ["goalId"]
}
]
}
404 - Not Found
{
"error": "Resource not found"
}
500 - Internal Server Error
{
"error": "An unexpected error occurred"
}
Examples
cURL Example
# Delete a goal
curl -X DELETE "https://app.hipp.health/api/v1/goals/goal_123" \
-H "Authorization: Bearer your-api-key"
JavaScript Example
const deleteGoal = async (goalId) => {
const response = await fetch(`/api/v1/goals/${goalId}`, {
method: "DELETE",
headers: {
Authorization: "Bearer your-api-key",
},
});
if (!response.ok) {
const error = await response.json();
throw new Error(error.error || "Failed to delete goal");
}
return true;
};
// Delete a goal
try {
await deleteGoal("goal_123");
console.log("Goal deleted successfully");
} catch (error) {
console.error("Error deleting goal:", error.message);
}