POST /plants to add a new plant to the store. Provide a JSON body with the plant’s name and optional tag.
Request body
The name of the plant. This field is required.
An optional tag to categorize the plant (e.g., “tropical”, “desert”).
Example request
Example response
Response fields
Unique identifier assigned to the newly created plant.
The name of the plant.
The tag associated with the plant, if provided.
Error responses
| Status code | Description |
|---|---|
400 Bad Request | The name field is missing from the request body. |
401 Unauthorized | The request is missing a valid Bearer token. |