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

# Update EndUser P&L layout

> Update the profit and loss layout for the end user, which determines how the profit and loss table is calculated




## OpenAPI

````yaml https://app.herondata.io/swagger put /api/end_users/{end_user_id_or_heron_id}/profit_and_loss_layout
openapi: 3.0.0
info:
  contact:
    email: support@herondata.io
    name: Support
  title: Heron Data API
  version: '2021-07-19'
servers:
  - description: Production
    url: https://app.herondata.io
security:
  - ApiKeyAuth:
      - key_XXX
externalDocs:
  description: Read Tutorial
  url: https://docs.herondata.io/
paths:
  /api/end_users/{end_user_id_or_heron_id}/profit_and_loss_layout:
    put:
      tags:
        - EndUserCalculations
      summary: Update EndUser P&L layout
      description: >
        Update the profit and loss layout for the end user, which determines how
        the profit and loss table is calculated
      parameters:
        - in: path
          name: end_user_id_or_heron_id
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProfitAndLossLayoutUpdateSchema'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProfitAndLossLayoutSchema'
          description: OK
      security:
        - ApiKeyAuth: []
components:
  schemas:
    ProfitAndLossLayoutUpdateSchema:
      properties:
        category_labels:
          description: List of category labels to assign to a different section
          example:
            - Postage
          items:
            type: string
          minItems: 1
          type: array
        section_slug:
          description: Slug of section to assign labels to
          example: operational_expenses
          type: string
      required:
        - category_labels
        - section_slug
      type: object
    ProfitAndLossLayoutSchema:
      properties:
        sections:
          description: Ordered list of P&L sections
          items:
            $ref: '#/components/schemas/PnlSectionLayout'
          type: array
      type: object
    PnlSectionLayout:
      properties:
        labels:
          description: The category labels associated with the section
          items:
            type: string
          type: array
        metrics:
          description: An ordered list of metric layouts
          items:
            $ref: '#/components/schemas/PnlMetricLayout'
          type: array
        name:
          description: Name of P&L section, e.g,. Operating Expenses
          type: string
        slug:
          description: Slugified version of the name
          type: string
      type: object
    PnlMetricLayout:
      properties:
        denominator:
          allOf:
            - $ref: '#/components/schemas/PnlMetricFractionTerm'
          description: >-
            If the metric is a ratio, the denominator of the metric; otherwise
            this is just 1
          nullable: true
        indent:
          description: Indentation level for formatting purposes
          type: integer
        is_growth:
          description: If true, calculates the % growth in the metric over time
          type: boolean
        name:
          description: Name of metric
          type: string
        numerator:
          allOf:
            - $ref: '#/components/schemas/PnlMetricFractionTerm'
          description: The numerator of the metric
      type: object
    PnlMetricFractionTerm:
      properties:
        labels:
          description: List of category labels associated with the fraction term
          items:
            type: string
          type: array
        sections:
          description: List of section slugs associated with the fraction term
          items:
            type: string
          type: array
      type: object
  securitySchemes:
    ApiKeyAuth:
      in: header
      name: x-api-key
      type: apiKey

````