Swagger Petstore - OpenAPI 3.0
SSwagger Petstore - OpenAPI 3.0
API ReferenceChangelog
GETList plants/plantsPOSTCreate a plant/plantsDELETEDelete a plant/plants/{id}
llms.txtPowered by Octri
POST/plants

Create a plant

Creates a new plant in the store. Provide name and id; tag can specify the plant type. A 200 response returns the created plant object.

  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

3 body fields

Plant details to add to the store. Include the required name and id; tag is optional.

namestringrequired

The name of the plant

tagstringoptional

Tag to specify the type

idintegerrequired

Identification number of the plant

2 status codes
200Returns the created plant object, including its name and optional tag.
namestringrequired

The name of the plant

tagstringoptional

Tag to specify the type

400Returned when an unexpected error occurs.
errorintegerrequired
messagestringrequired

Error handling

name and id are required; provide name as a string and id as an integer. A 400 is returned for an unexpected error.

import { OpenAPIPlantStore } from "swagger-petstore---openapi-3-0-sdk";

const client = new OpenAPIPlantStore({
  baseUrl: "/api/v3",
  auth: { bearerAuth: process.env.OPEN_API_TOKEN! },
});

const result = await client.plants.create({
  name: "Untitled",
  id: 4355,
});
Response
{
  "name": "Example Name",
  "tag": "example_value"
}
PreviousList plantsNextDelete a plant