---
title: "Update the goal of a user habit"
method: PUT
path: "/api/v5/habits/user-habits/goal"
tags: ["User Habits"]
---

# Update the goal of a user habit

`PUT /api/v5/habits/user-habits/goal`

## Request

- Base URL: `https://api.pavlok.com`
- URL: `https://api.pavlok.com/api/v5/habits/user-habits/goal`
- Auth: API key in header `Authorization`
- TypeScript: <https://skmtc.dev/pavlok/apis/pavlok-api-v5/docs/api/v5/habits/user-habits/goal/put.ts> (a function with typed inputs; its response is checked against the schema)

Update the goal of an already existing user habit

## Request body

- BodyUserHabitsUpdateGoalApiV5HabitsUserHabitsGoalPut
  - `habit_goal` UserHabitInUpdateGoal, required
    - `habitId` integer, required
    - `goalValue` integer, required
    - `inputDate` string, date, required

## Response `200`

Successful Response

- UserHabitInResponseWithGoal
  - `userHabit` UserHabit, required
    - `createdAt` string, date-time
    - `updatedAt` string, date-time
    - `deletedAt` string, date-time
    - `id` integer
    - `userId` integer, required
    - `habitId` integer, required
    - `price` number
    - `reminderTime` string, time
  - `habitGoal` HabitGoal, required
    - `createdAt` string, date-time
    - `updatedAt` string, date-time
    - `deletedAt` string, date-time
    - `id` integer
    - `userHabitId` integer, required
    - `date` string, date, required
    - `goalValue` integer
    - `currentValue` integer
    - `achievedAt` string, date-time

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/pavlok/apis/pavlok-api-v5.md) - [All operations](https://skmtc.dev/pavlok/apis/pavlok-api-v5/llms.txt) - [OpenAPI document](https://skmtc.dev/pavlok/apis/pavlok-api-v5/revisions/3d192098b1ac?raw)
