dambel

دمبل

shevron
ورود | ثبت نام

API Docs / tracker / shares / update



PUT /api/v1/tracker/shares/{shared-tracker-id}

Update an existing shared tracker configuration.


Permissions

PermissionDescription
shared_trackers.updateUpdate shared tracker
shared_trackers.viewView shared tracker

URL Parameters

NameTypeRequiredDescription
sharedTrackerintegerYesID of the shared tracker to update

Request Body Parameters

NameTypeRequiredDescription
start_datestringNoStart date for the sharing period (YYYY-MM-DD format)
end_datestringNoEnd date for the sharing period (YYYY-MM-DD format)
include_wakeupbooleanNoWhether to include wakeup data
include_weightbooleanNoWhether to include weight data
include_waterbooleanNoWhether to include water intake data
include_sleepbooleanNoWhether to include sleep data
include_supplementbooleanNoWhether to include supplement data
include_mealbooleanNoWhether to include meal data
include_workoutbooleanNoWhether to include workout data
notify_wakeupbooleanNoWhether to notify the viewer about new wakeup data
notify_weightbooleanNoWhether to notify the viewer about new weight data
notify_waterbooleanNoWhether to notify the viewer about new water intake data
notify_sleepbooleanNoWhether to notify the viewer about new sleep data
notify_supplementbooleanNoWhether to notify the viewer about new supplement data
notify_mealbooleanNoWhether to notify the viewer about new meal data
notify_workoutbooleanNoWhether to notify the viewer about new workout data
descriptionstringNoOptional description for the shared tracker (max: 2000 characters)

Note: If both start_date and end_date are provided, end_date must be after start_date.

Note: The viewer user can only change notify_* fields.

Note: The owner user can only change all fields EXCEPT notify_* fields.


Response

200 OK

<shared tracker resource>

Error Responses

StatusError TypeReference
422Validation ErrorValidation error
401UnauthorizedAuthentication error
403ForbiddenPermission error
404Not FoundNot found error

Example Request

curl -X PUT "https://api.example.com/api/v1/tracker/shares/1" \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -d '{
    "description": "Updated January fitness tracking data",
    "include_weight": true,
    "notify_workout": true
  }'

Example Response

{
  "data": <shared tracker resource>
}

See Shared Tracker Resource for the complete response structure.


Notes

  • Users can only update shared trackers where they are either the owner (user_id) or the viewer (viewer_user_id)
  • Only the fields provided in the request will be updated
  • The user_id and viewer_user_id fields cannot be modified
  • Partial updates are supported - only include the fields you want to change
  • The end_date validation rule only applies when both start_date and end_date are provided
footer wave
logo

دمبل، دنیای هوشمند ورزش و تغذیه

LinkedinInstagramXYoutube