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

# Insert or update an effluent

> Insert a new effluent record or update an existing one by its unique identifier.



## OpenAPI

````yaml /openapi.json post /api/v1/effluents
openapi: 3.0.3
info:
  title: Manglai Public API
  description: Manglai API for Carbon Footprint Management
  contact:
    email: admin@manglai.io
    name: Manglai Support
    url: https://manglai.io
  termsOfService: https://manglai.io/privacy
  version: '1.0'
servers:
  - url: https://www.manglai.io
    description: Production
security:
  - apiTokenAuth: []
tags: []
paths:
  /api/v1/effluents:
    post:
      tags:
        - effluents
      summary: Insert or update an effluent
      description: >-
        Insert a new effluent record or update an existing one by its unique
        identifier.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: string
                  description: The unique identifier of the effluent.
                companyId:
                  type: string
                  description: The company associated with the effluent.
                buildingIds:
                  type: array
                  items:
                    type: string
                  description: The building IDs associated with the effluent.
                type:
                  type: string
                  description: The type of the effluent.
                  enum:
                    - limit
                    - quality
                year:
                  type: number
                  description: The year of the effluent data.
                dbo:
                  type: number
                  description: Biochemical Oxygen Demand (mg/L).
                dqo:
                  type: number
                  description: Chemical Oxygen Demand (mg/L).
                ss:
                  type: number
                  description: Suspended Solids (mg/L).
                pt:
                  type: number
                  description: Total Phosphorus (mg/L).
                nt:
                  type: number
                  description: Total Nitrogen (mg/L).
        description: The effluent data to be inserted or updated.
      responses:
        '200':
          description: Successfully inserted or updated the effluent.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                    example: ok
        '400':
          description: Bad request, missing required fields or invalid data.
        '500':
          description: Internal server error during upsert operation.
components:
  securitySchemes:
    apiTokenAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````