dambel

دمبل

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

API Docs / gyms / update



PUT /api/v1/gyms/{gym-id}

Updates the information of a specific gym by its ID. All parameters are optional; only provided fields will be updated. You can set fields to null to clear them.


Permissions

PermissionDescription
gyms.updateUpdate your own gym
gyms.update_anyUpdate any gym as an admin
gyms.transfer_ownershipTransfer gym ownership (for user_id field)

Path Parameters

NameTypeRequiredDescriptionExample
gym-idintYesID of the gym to update123

Request Body Parameters

NameTypeRequiredDescriptionExample
namestringNoName of the gym (max 255 characters)"Iron Paradise"
addressstringNoAddress of the gym (max 255 characters)"123 Main St"
location_latfloatNoLatitude coordinate of the gym35.6892
location_lngfloatNoLongitude coordinate of the gym51.3890
is_activeboolNoWhether the gym is activetrue
show_crowdboolNoWhether to display crowd informationfalse
descriptionstringNoDescription of the gym (max 2000 characters)"Best gym..."
user_idintNoUser ID to assign the gym to (requires gyms.transfer_ownership permission)42
city_idintNoID of the city where the gym is located5
major_idsstringNoComma-separated list of major IDs. Use 0 to detach all majors."1,2,3"

Request Example

{
  "name": "Iron Paradise",
  "address": "123 Main St",
  "location_lat": 35.6892,
  "location_lng": 51.3890,
  "is_active": true,
  "show_crowd": false,
  "description": "A premium gym with modern equipment.",
  "user_id": 42,
  "city_id": 5,
  "major_ids": "1,2,3"
}

Response

200 OK

Returns the updated gym resource.

Schema

{
  "gym": { /* Gym Resource */ }
}

Example

{
  "gym": {
    "id": 123,
    "name": "Iron Paradise",
    "address": "123 Main St",
    "location_lat": 35.6892,
    "location_lng": 51.3890,
    "is_active": true,
    "description": "A premium gym with modern equipment.",
    "created_at": "2023-01-01 10:00:00",
    "updated_at": "2023-01-01 10:10:00",
    "show_crowd": false,
    "crowd": null,
    "city": {
      "id": 5,
      "name": "Tehran",
      "state": { "id": 1, "name": "Tehran Province" }
    },
    "majors": [
      { "id": 1, "title": "Bodybuilding" },
      { "id": 2, "title": "Crossfit" }
    ],
    "working_periods": [],
    "working_status": null,
    "boost": null,
    "media": [],
    "rating_count": 0,
    "rating_average": 0
  }
}

For a full schema, see Gym Resource.


Error Responses

StatusDescriptionReference
422Validation errorValidation error
401UnauthorizedAuthentication error
403Forbidden (no permission)Permission error
footer wave
logo

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

LinkedinInstagramXYoutube