---
title: Update weights
slug: import-test-pdf/update-weights
createdAt: 2025-10-28T16:28:34.264Z
---

{
  "id": "PcRN988K64mpaCab0jfyi",
  "type": "api-oas-v2",
  "data": {
    "method": "PATCH",
    "url": "/api/v1/pets/{id}/weights/{measurement_id}",
    "servers": [],
    "name": "Update weights",
    "description": "Update weights Weights for Pet",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "measurement_id",
          "type": "integer",
          "description": "Measurement Id"
        }
      ],
      "headerParameters": [],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "body",
          "type": "object",
          "description": "For <b>measurement_unit_id</b>:<i>1 - kg ; 2 - lbs</i>",
          "schema": [
            {
              "name": "vet_id",
              "kind": "optional",
              "type": "integer",
              "description": "Vet ID",
              "example": ""
            },
            {
              "name": "value",
              "kind": "optional",
              "type": "number",
              "description": "Weight value",
              "example": 12.5
            },
            {
              "name": "measurement_unit_id",
              "kind": "optional",
              "type": "integer",
              "description": "Measurement unit id (<i>1 - kg ; 2 - lbs</i>)",
              "example": 1
            },
            {
              "name": "date",
              "kind": "optional",
              "type": "string<date>",
              "description": "Measurement date(Y-m-d)",
              "example": ""
            }
          ],
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": []
    },
    "responses": [
      {
        "statusCode": "422",
        "description": "Bad request",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "undefined",
            "example": "{\"message\":\"The given data was invalid.\",\"errors\":{\"measurement_id\":[\"The selected measurement id is invalid.\"]}}",
            "description": "",
            "isExpanded": true
          }
        ]
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "example-0-curl",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request PATCH \\\n     --url /api/v1/pets/{id}/weights/{measurement_id} \\\n     --header 'accept: application/json'"
        },
        {
          "id": "example-1-javascript",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\n\nvar requestOptions = {\n   method: 'PATCH',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"/api/v1/pets/{id}/weights/{measurement_id}\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "example-2-ruby",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"/api/v1/pets/{id}/weights/{measurement_id}\")\n\nhttp = Net::HTTP.new(url.host, url.port);\nrequest = Net::HTTP::Patch.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\n\nresponse = http.request(request)\nputs response.read_body\n"
        },
        {
          "id": "example-3-python",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"/api/v1/pets/{id}/weights/{measurement_id}\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"PATCH\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "example-0-curl"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-422",
          "language": "422",
          "code": "// Bad request\n\"{\\\"message\\\":\\\"The given data was invalid.\\\",\\\"errors\\\":{\\\"measurement_id\\\":[\\\"The selected measurement id is invalid.\\\"]}}\""
        }
      ],
      "selectedLanguageId": "response-0-422"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}