---
title: Add a new pet to the store
slug: mihai-tests/eEvG-add-a-new-pet-to-the-store
createdAt: 2024-05-23T13:14:55.472Z
---

{
  "id": "9fiRxMTLbG5Zyn-AOEAjh",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "https://petstore3.swagger.io/api/v3/pet",
    "servers": [
      {
        "url": "https://petstore3.swagger.io/api/v3/pet"
      }
    ],
    "name": "Add a new pet to the store",
    "description": "<p>This is a very long sentence\nthat spans several lines in the YAML\nbut which will be rendered as a string\nwith newlines preserved.</p>\n<h2>Hints</h2>\n<div><pre><code>  ## 2asdasdas \n  asdas asd We would love you to contribute to `@octokit/rest`, pull requests are very welcome! Please see CONTRIBUTING.md for more information.\n</code></pre></div>",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "body",
          "type": "object",
          "description": "Create a new pet in the store",
          "customType": "Pet",
          "schema": [
            {
              "name": "id",
              "kind": "optional",
              "type": "integer<int64>",
              "example": 10
            },
            {
              "name": "name",
              "kind": "required",
              "type": "string",
              "example": "doggie"
            },
            {
              "name": "category",
              "kind": "optional",
              "type": "object",
              "modelRef": "#/components/schemas/Category",
              "customType": "Category",
              "schema": [
                {
                  "name": "id",
                  "kind": "optional",
                  "type": "integer<int64>",
                  "example": 1
                },
                {
                  "name": "name",
                  "kind": "optional",
                  "type": "string",
                  "example": "Dogs"
                }
              ]
            },
            {
              "name": "photoUrls",
              "kind": "required",
              "type": "array",
              "example": "",
              "itemType": "string",
              "customType": "string[]",
              "itemExample": "",
              "itemDefault": ""
            },
            {
              "name": "tags",
              "kind": "optional",
              "type": "array",
              "modelRef": "#/components/schemas/Tag",
              "customType": "Tag[]",
              "schema": [
                {
                  "name": "id",
                  "kind": "optional",
                  "type": "integer<int64>",
                  "example": 0
                },
                {
                  "name": "name",
                  "kind": "optional",
                  "type": "string",
                  "example": ""
                }
              ]
            },
            {
              "name": "status",
              "kind": "optional",
              "type": "string<available | pending | sold>",
              "description": "pet status in the store",
              "example": ""
            }
          ],
          "modelRef": "#/components/schemas/Pet",
          "isExpanded": true
        }
      ],
      "formDataParameters": [
        {
          "name": "id",
          "kind": "optional",
          "type": "integer<int64>",
          "example": 10
        },
        {
          "name": "name",
          "kind": "required",
          "type": "string",
          "example": "doggie"
        },
        {
          "name": "category",
          "kind": "optional",
          "type": "object",
          "modelRef": "#/components/schemas/Category",
          "customType": "Category",
          "schema": [
            {
              "name": "id",
              "kind": "optional",
              "type": "integer<int64>",
              "example": 1
            },
            {
              "name": "name",
              "kind": "optional",
              "type": "string",
              "example": "Dogs"
            }
          ]
        },
        {
          "name": "photoUrls",
          "kind": "required",
          "type": "array",
          "example": "",
          "itemType": "string",
          "customType": "string[]",
          "itemExample": "",
          "itemDefault": ""
        },
        {
          "name": "tags",
          "kind": "optional",
          "type": "array",
          "modelRef": "#/components/schemas/Tag",
          "customType": "Tag[]",
          "schema": [
            {
              "name": "id",
              "kind": "optional",
              "type": "integer<int64>",
              "example": 0
            },
            {
              "name": "name",
              "kind": "optional",
              "type": "string",
              "example": ""
            }
          ]
        },
        {
          "name": "status",
          "kind": "optional",
          "type": "string<available | pending | sold>",
          "description": "pet status in the store",
          "example": ""
        }
      ],
      "oAuthParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Successful operation",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "customType": "Pet",
            "schema": [
              {
                "name": "id",
                "kind": "optional",
                "type": "integer<int64>",
                "example": 10
              },
              {
                "name": "name",
                "kind": "required",
                "type": "string",
                "example": "doggie"
              },
              {
                "name": "category",
                "kind": "optional",
                "type": "object",
                "modelRef": "#/components/schemas/Category",
                "customType": "Category",
                "schema": [
                  {
                    "name": "id",
                    "kind": "optional",
                    "type": "integer<int64>",
                    "example": 1
                  },
                  {
                    "name": "name",
                    "kind": "optional",
                    "type": "string",
                    "example": "Dogs"
                  }
                ]
              },
              {
                "name": "photoUrls",
                "kind": "required",
                "type": "array",
                "example": "",
                "itemType": "string",
                "customType": "string[]",
                "itemExample": "",
                "itemDefault": ""
              },
              {
                "name": "tags",
                "kind": "optional",
                "type": "array",
                "modelRef": "#/components/schemas/Tag",
                "customType": "Tag[]",
                "schema": [
                  {
                    "name": "id",
                    "kind": "optional",
                    "type": "integer<int64>",
                    "example": 0
                  },
                  {
                    "name": "name",
                    "kind": "optional",
                    "type": "string",
                    "example": ""
                  }
                ]
              },
              {
                "name": "status",
                "kind": "optional",
                "type": "string<available | pending | sold>",
                "description": "pet status in the store",
                "example": ""
              }
            ],
            "modelRef": "#/components/schemas/Pet",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "405",
        "description": "Invalid input",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "examples": {
      "languages": [
        {
          "id": "ZVgqo2JQ5cocCdxm9BMti",
          "language": "curl",
          "label": "cURL",
          "code": "curl --location 'https://petstore3.swagger.io/api/v3/pet' \\\n--header 'Accept: application/json' \\\n--header 'Content-Type: application/json' \\\n--data '{\n  \"id\": 0,\n  \"name\": \"\",\n  \"category\": {\n    \"id\": 0,\n    \"name\": \"\"\n  },\n  \"photoUrls\": [\n    \"\"\n  ],\n  \"tags\": [\n    {\n      \"id\": 0,\n      \"name\": \"\"\n    }\n  ],\n  \"status\": \"\"\n}'"
        },
        {
          "id": "dLrdGujqokmu7zpJVwAwR",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"Accept\", \"application/json\");\nmyHeaders.append(\"Content-Type\", \"application/json\");\n\nvar raw = JSON.stringify({\n   \"id\": 0,\n   \"name\": \"\",\n   \"category\": {\n      \"id\": 0,\n      \"name\": \"\"\n   },\n   \"photoUrls\": [\n      \"\"\n   ],\n   \"tags\": [\n      {\n         \"id\": 0,\n         \"name\": \"\"\n      }\n   ],\n   \"status\": \"\"\n});\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   body: raw,\n   redirect: 'follow'\n};\n\nfetch(\"https://petstore3.swagger.io/api/v3/pet\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "2izQ4EjZ5ncf55cvcMEUg",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://petstore3.swagger.io/api/v3/pet\")\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\"\nrequest.body = JSON.dump({\n   \"id\": 0,\n   \"name\": \"\",\n   \"category\": {\n      \"id\": 0,\n      \"name\": \"\"\n   },\n   \"photoUrls\": [\n      \"\"\n   ],\n   \"tags\": [\n      {\n         \"id\": 0,\n         \"name\": \"\"\n      }\n   ],\n   \"status\": \"\"\n})\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "zGDIS2CnF6VdXlZqSqXnq",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://petstore3.swagger.io/api/v3/pet\"\n\npayload = json.dumps({\n   \"id\": 0,\n   \"name\": \"\",\n   \"category\": {\n      \"id\": 0,\n      \"name\": \"\"\n   },\n   \"photoUrls\": [\n      \"\"\n   ],\n   \"tags\": [\n      {\n         \"id\": 0,\n         \"name\": \"\"\n      }\n   ],\n   \"status\": \"\"\n})\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": "ZVgqo2JQ5cocCdxm9BMti"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "// Successful operation\n{\n  \"id\": 10,\n  \"name\": \"doggie\",\n  \"category\": {\n    \"id\": 1,\n    \"name\": \"Dogs\"\n  },\n  \"photoUrls\": [\n    \"\"\n  ],\n  \"tags\": [\n    {\n      \"id\": \"\",\n      \"name\": \"\"\n    }\n  ],\n  \"status\": \"\"\n}"
        },
        {
          "id": "response-1-405",
          "language": "405",
          "code": "// Invalid input\n"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "children": [
    {
      "id": "sOJvSf3ZgUHJQF7cBwL_p",
      "type": "paragraph",
      "children": [
        {
          "text": "This is a very long sentence\nthat spans several lines in the YAML\nbut which will be rendered as a string\nwith newlines preserved."
        }
      ]
    },
    {
      "id": "yZq498NPc5ogN44rTGcPW",
      "type": "h2",
      "children": [
        {
          "text": "Hints"
        }
      ]
    },
    {
      "id": "4fXp26H_XiuCRe6N7eOQO",
      "type": "callout-v2",
      "data": {},
      "children": [
        {
          "id": "hKf7RV7SAvr907IUP_B4q",
          "type": "code-editor-v2",
          "data": {
            "languages": [
              {
                "id": "WL9ObT_zJxjENRKd1jYjI",
                "language": "Text",
                "code": "  ## 2asdasdas \n  asdas asd We would love you to contribute to `@octokit/rest`, pull requests are very welcome! Please see CONTRIBUTING.md for more information."
              }
            ],
            "selectedLanguageId": "WL9ObT_zJxjENRKd1jYjI"
          },
          "children": [
            {
              "text": ""
            }
          ]
        }
      ]
    }
  ]
}