Skip to main content
The POST /plants endpoint creates a new plant in the store and returns the created Plant object. You must provide a name and an id in the request body. The tag field is optional and can be used to categorize the plant. If the request body is missing required fields or contains invalid data, the API returns a 400 error with a description of the problem.

Request body

name
string
required
Common name of the plant (for example, "Monstera").
tag
string
Optional category tag for the plant (for example, "tropical").
id
integer
required
Unique integer identifier for the new plant. You are responsible for providing a unique value.

Response

200 — success

name
string
required
Common name of the plant that was created.
tag
string
Category tag of the created plant, if one was provided.

400 — error

error
integer
required
Numeric error code identifying the type of failure.
message
string
required
Human-readable description of the error.

Example

curl -X POST "http://sandbox.mintlify.com/plants" \
  -H "Authorization: Bearer <your-token>" \
  -H "Content-Type: application/json" \
  -d '{"name": "Monstera", "tag": "tropical", "id": 1}'
{
  "name": "Monstera",
  "tag": "tropical"
}