---
title: Create a Weight for Pet
slug: create-a-weight-for-pet
docTags: 
createdAt: 2026-04-21T15:22:49.957Z
---

{
  "id": "SLKFcs41in_hilD4egArT",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "https://developer.digitail.io/api/v1/pets/{id}/weights",
    "servers": [
      {
        "url": "https://developer.digitail.io/api/v1/pets/{id}/weights",
        "description": "Sandbox server (uses test data)"
      },
      {
        "url": "https://vet.digitail.io/api/v1/pets/{id}/weights",
        "description": "Production server (uses live data)"
      }
    ],
    "name": "Create a Weight for Pet",
    "description": "<p>Permissions needed: ACCESS_PATIENTS\nStore weights for Pet</p>",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "body",
          "type": "object",
          "description": "<p>For measurement_unit_id:1 - kg ; 2 - lbs</p>",
          "schema": [
            {
              "name": "clinic_id",
              "kind": "optional",
              "type": "integer",
              "description": "Clinic ID",
              "example": 766
            },
            {
              "name": "vet_id",
              "kind": "optional",
              "type": "integer",
              "nullable": true,
              "description": "Vet ID",
              "example": ""
            },
            {
              "name": "value",
              "kind": "optional",
              "type": "number",
              "description": "Weight value",
              "example": 12
            },
            {
              "name": "measurement_unit_id",
              "kind": "optional",
              "type": "number",
              "description": "<p>Measurement unit id (1 - kg ; 2 - lbs)</p>",
              "example": 1,
              "enum": [
                "1",
                "2"
              ]
            },
            {
              "name": "date",
              "kind": "optional",
              "type": "string<date>",
              "nullable": true,
              "description": "<p>Measurement date( Y-m-d)</p>",
              "example": "",
              "format": "date"
            }
          ],
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "passport",
          "name": "passport",
          "kind": "optional",
          "type": "oauth2",
          "description": "Laravel passport oauth2 security.",
          "oauth2Flows": {
            "authorizationCode": {
              "authorizationUrl": "https://digitail.test/oauth/authorize",
              "tokenUrl": "https://digitail.test/oauth/token",
              "refreshUrl": "https://digitail.test/oauth/token"
            }
          }
        },
        {
          "id": "Bearer",
          "name": "Bearer",
          "kind": "optional",
          "type": "http",
          "scheme": "bearer"
        }
      ],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "201",
        "description": "successful operation",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "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": "NluE3m1cYRsYjAIjl_xcx",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url https://developer.digitail.io/api/v1/pets/{id}/weights \\\n     --header 'accept: application/json'"
        },
        {
          "id": "d_IXrzJC-IDDi9yLCe8Mv",
          "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: 'POST',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"https://developer.digitail.io/api/v1/pets/{id}/weights\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "dZmLl5DR20k6zF1EpBjnB",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://developer.digitail.io/api/v1/pets/{id}/weights\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Post.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "ELUcfwoMRltf4yV7DM9D1",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://developer.digitail.io/api/v1/pets/{id}/weights\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "NluE3m1cYRsYjAIjl_xcx"
    },
    "results": {
      "languages": [
        {
          "id": "5511pdZmtO_9oqlVnfeP8",
          "language": "201",
          "code": "// successful operation\n"
        },
        {
          "id": "GS9Xq_pKJ67Tsc_6UaDB9",
          "language": "422",
          "code": "// Bad request\n\"{\\\"message\\\":\\\"The given data was invalid.\\\",\\\"errors\\\":{\\\"measurement_id\\\":[\\\"The selected measurement id is invalid.\\\"]}}\""
        }
      ],
      "selectedLanguageId": "5511pdZmtO_9oqlVnfeP8"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}