> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sophiabarnes.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Add a plant



## OpenAPI

````yaml /mintlify-demo/v2.0/api-reference/openapi.yaml post /plants
openapi: 3.0.3
info:
  title: Plant Care API
  version: 2.0.0
  description: >-
    A simple API for managing houseplants. Version 2.0 adds single-plant
    retrieval, watering schedule updates, and last-watered tracking.
servers:
  - url: http://localhost:3000/v2
security: []
paths:
  /plants:
    post:
      summary: Add a plant
      operationId: createPlant
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreatePlantRequest'
      responses:
        '201':
          description: Plant created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Plant'
        '400':
          description: Missing required fields
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    CreatePlantRequest:
      type: object
      required:
        - name
        - species
      properties:
        name:
          type: string
          example: Monstera
        species:
          type: string
          example: Monstera deliciosa
        wateringFrequencyDays:
          type: integer
          example: 7
          default: 7
    Plant:
      type: object
      properties:
        id:
          type: integer
          example: 1
        name:
          type: string
          example: Monstera
        species:
          type: string
          example: Monstera deliciosa
        wateringFrequencyDays:
          type: integer
          example: 7
        lastWateredAt:
          type: string
          format: date-time
          nullable: true
          description: When the plant was last watered. Null if never recorded.
          example: '2026-07-28T09:30:00Z'
    Error:
      type: object
      properties:
        error:
          type: string
          example: Plant not found

````