---
title: Creates list of users with given input array
slug: mihai-tests/creates-list-of-users-with-given-input-array
createdAt: 2024-05-23T13:14:55.472Z
---

{
  "id": "-sT6tJJv93YsXuKdfLZ9W",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "https://petstore3.swagger.io/api/v3/user/createWithList",
    "servers": [
      {
        "url": "https://petstore3.swagger.io/api/v3/user/createWithList"
      }
    ],
    "name": "Creates list of users with given input array",
    "description": "Creates list of users with given input array",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "optional",
          "name": "body",
          "type": "array",
          "customType": "User[]",
          "schema": [
            {
              "name": "id",
              "kind": "optional",
              "type": "integer<int64>",
              "example": 10
            },
            {
              "name": "username",
              "kind": "optional",
              "type": "string",
              "example": "theUser"
            },
            {
              "name": "firstName",
              "kind": "optional",
              "type": "string",
              "example": "John"
            },
            {
              "name": "lastName",
              "kind": "optional",
              "type": "string",
              "example": "James"
            },
            {
              "name": "email",
              "kind": "optional",
              "type": "string",
              "example": "john@email.com"
            },
            {
              "name": "password",
              "kind": "optional",
              "type": "string",
              "example": "12345"
            },
            {
              "name": "phone",
              "kind": "optional",
              "type": "string",
              "example": "12345"
            },
            {
              "name": "userStatus",
              "kind": "optional",
              "type": "integer<int32>",
              "description": "User Status",
              "example": 1
            }
          ],
          "modelRef": "#/components/schemas/User",
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Successful operation",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "customType": "User",
            "schema": [
              {
                "name": "id",
                "kind": "optional",
                "type": "integer<int64>",
                "example": 10
              },
              {
                "name": "username",
                "kind": "optional",
                "type": "string",
                "example": "theUser"
              },
              {
                "name": "firstName",
                "kind": "optional",
                "type": "string",
                "example": "John"
              },
              {
                "name": "lastName",
                "kind": "optional",
                "type": "string",
                "example": "James"
              },
              {
                "name": "email",
                "kind": "optional",
                "type": "string",
                "example": "john@email.com"
              },
              {
                "name": "password",
                "kind": "optional",
                "type": "string",
                "example": "12345"
              },
              {
                "name": "phone",
                "kind": "optional",
                "type": "string",
                "example": "12345"
              },
              {
                "name": "userStatus",
                "kind": "optional",
                "type": "integer<int32>",
                "description": "User Status",
                "example": 1
              }
            ],
            "modelRef": "#/components/schemas/User",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "default",
        "description": "successful operation",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "examples": {
      "languages": [
        {
          "id": "IMXsdUZjaihZ9_dqM0qMN",
          "language": "curl",
          "label": "cURL",
          "code": "curl --location 'https://petstore3.swagger.io/api/v3/user/createWithList' \\\n--header 'Accept: application/json' \\\n--header 'Content-Type: application/json' \\\n--data '[\n  {\n    \"id\": 0,\n    \"username\": \"\",\n    \"firstName\": \"\",\n    \"lastName\": \"\",\n    \"email\": \"\",\n    \"password\": \"\",\n    \"phone\": \"\",\n    \"userStatus\": 0\n  }\n]'"
        },
        {
          "id": "5xpJBRdQuVd7JKsf3FiKr",
          "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   {\n      \"id\": 0,\n      \"username\": \"\",\n      \"firstName\": \"\",\n      \"lastName\": \"\",\n      \"email\": \"\",\n      \"password\": \"\",\n      \"phone\": \"\",\n      \"userStatus\": 0\n   }\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/user/createWithList\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "6Awv_keGnaESxxEguQRv5",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://petstore3.swagger.io/api/v3/user/createWithList\")\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   {\n      \"id\": 0,\n      \"username\": \"\",\n      \"firstName\": \"\",\n      \"lastName\": \"\",\n      \"email\": \"\",\n      \"password\": \"\",\n      \"phone\": \"\",\n      \"userStatus\": 0\n   }\n])\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "5IllijXZ5TMf5snB4xCZ-",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://petstore3.swagger.io/api/v3/user/createWithList\"\n\npayload = json.dumps([\n   {\n      \"id\": 0,\n      \"username\": \"\",\n      \"firstName\": \"\",\n      \"lastName\": \"\",\n      \"email\": \"\",\n      \"password\": \"\",\n      \"phone\": \"\",\n      \"userStatus\": 0\n   }\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": "IMXsdUZjaihZ9_dqM0qMN"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "// Successful operation\n{\n  \"id\": 10,\n  \"username\": \"theUser\",\n  \"firstName\": \"John\",\n  \"lastName\": \"James\",\n  \"email\": \"john@email.com\",\n  \"password\": \"12345\",\n  \"phone\": \"12345\",\n  \"userStatus\": 1\n}"
        },
        {
          "id": "response-1-default",
          "language": "default",
          "code": "// successful operation\n"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "children": [
    {
      "id": "c2E1n8MrmUYZRQhwB5FDw",
      "type": "paragraph",
      "children": [
        {
          "text": "Creates list of users with given input array"
        }
      ]
    }
  ]
}