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
Common name of the plant (for example,
"Monstera").Optional category tag for the plant (for example,
"tropical").Unique integer identifier for the new plant. You are responsible for providing a unique value.
Response
200 — success
Common name of the plant that was created.
Category tag of the created plant, if one was provided.
400 — error
Numeric error code identifying the type of failure.
Human-readable description of the error.