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

# Update a lead

> Update the editable fields of a lead. Send only the fields that change. `metadata` is merged key-by-key onto the stored object (a key set to `null` is removed; `metadata: null` clears every key). The request body must be JSON without repeated keys, and any unknown field is rejected with `400 BAD_REQUEST`.



## OpenAPI

````yaml /openapi/openapi.gauss.json patch /leads/{id}
openapi: 3.0.0
info:
  title: Nomos API
  version: 2026-09-08.gauss
servers:
  - url: https://api.nomos.energy
    description: production
security: []
tags:
  - name: Plans
  - name: Leads
  - name: Subscriptions
  - name: Customers
  - name: Households
  - name: Assets
  - name: Usage
  - name: Prices
  - name: Invoices
  - name: Smart Meter Orders
  - name: Grid Fee Reductions
  - name: Market Partners
  - name: Events
  - name: Authentication
paths:
  /leads/{id}:
    patch:
      tags:
        - Leads
      summary: Update a lead
      description: >-
        Update the editable fields of a lead. Send only the fields that change.
        `metadata` is merged key-by-key onto the stored object (a key set to
        `null` is removed; `metadata: null` clears every key). The request body
        must be JSON without repeated keys, and any unknown field is rejected
        with `400 BAD_REQUEST`.
      parameters:
        - schema:
            type: string
            example: lead_mi4f0oda6x9m7gcsvjk0ole1
          required: true
          name: id
          in: path
      requestBody:
        description: The lead fields to update
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateLead'
      responses:
        '200':
          description: The updated lead
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Lead'
        '400':
          description: >-
            The request is invalid: a field fails validation, breaks a business
            rule, or the body is not valid JSON. `errors` lists every problem
            with its field.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrBadRequest'
              examples:
                Body is not valid JSON:
                  $ref: '#/components/examples/400-body-is-not-valid-json'
                Unsupported version header:
                  $ref: '#/components/examples/400-unsupported-version-header'
        '401':
          description: The access token is missing, expired or invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrUnauthorized'
              examples:
                No token:
                  $ref: '#/components/examples/401-no-token'
                Expired token:
                  $ref: '#/components/examples/401-expired-token'
                Invalid token:
                  $ref: '#/components/examples/401-invalid-token'
        '403':
          description: The access token is valid but not allowed to use this endpoint.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrForbidden'
              examples:
                Role without access:
                  $ref: '#/components/examples/403-role-without-access'
                Token without scope:
                  $ref: '#/components/examples/403-token-without-scope'
                Customer token without customer:
                  $ref: '#/components/examples/403-customer-token-without-customer'
        '404':
          description: >-
            A resource in the path or the body does not exist or belongs to
            another organization, or the endpoint does not exist in the API
            version of your token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrNotFound'
              examples:
                Unknown lead:
                  $ref: '#/components/examples/404-unknown-lead'
                Endpoint not in your API version:
                  summary: Endpoint not in your API version
                  value:
                    code: NOT_FOUND
                    message: >-
                      There is no PATCH /leads/{id} in API version
                      2025-12-01.chucky.
                    requestId: 37a04f8f-e791-491c-81e1-86cd304649bb
                    docs: https://docs.nomos.energy/api-references/errors/NOT_FOUND
        '500':
          description: >-
            Something went wrong on our side. Retry later, and send us the
            `requestId` if it persists.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrInternalServerError'
              examples:
                Unexpected error:
                  $ref: '#/components/examples/500-unexpected-error'
      security:
        - Bearer: []
components:
  schemas:
    UpdateLead:
      type: object
      properties:
        customer:
          anyOf:
            - type: object
              nullable: true
              properties:
                type:
                  type: string
                  enum:
                    - person
                  default: person
                  description: Type of the customer, always 'person'
                first_name:
                  type: string
                  minLength: 1
                  maxLength: 100
                  description: Customer's first name
                  example: John
                last_name:
                  type: string
                  minLength: 1
                  maxLength: 100
                  description: Customer's last name
                  example: Doe
                email:
                  type: string
                  format: email
                  description: Email address
                  example: john.doe@example.com
              title: Person
            - type: object
              nullable: true
              properties:
                type:
                  type: string
                  enum:
                    - company
                  description: Type of the customer, always 'company'
                first_name:
                  type: string
                  minLength: 1
                  maxLength: 100
                  description: First name of the customer
                  example: John
                last_name:
                  type: string
                  minLength: 1
                  maxLength: 100
                  description: Last name of the customer
                  example: Doe
                company_name:
                  type: string
                  minLength: 1
                  maxLength: 100
                  description: Company name
                  example: Example GmbH
                email:
                  type: string
                  format: email
                  description: Email address
                  example: gmbh@example.com
              title: Company
            - nullable: true
        address:
          type: object
          properties:
            zip:
              type: string
              minLength: 5
              description: ZIP/Postal code
              example: '10115'
            street:
              type: string
              nullable: true
              minLength: 1
              description: Street name of the address
              example: Torstraße
            city:
              type: string
              nullable: true
              minLength: 1
              description: City name
              example: Berlin
            house_number:
              type: string
              nullable: true
              minLength: 1
              description: House number including any additions
              example: '119'
        meter:
          type: object
          properties:
            estimated_usage:
              type: number
              minimum: 100
              description: Estimated yearly consumption in kWh
              example: 2500
            type:
              type: string
              nullable: true
              enum:
                - smart
                - analog
              description: Type of the meter. Must be 'smart' for feed-in plans
              example: smart
            number:
              type: string
              nullable: true
              minLength: 1
              description: Meter identification number
              example: 1APA0195124010
        payment_method:
          type: object
          nullable: true
          properties:
            type:
              type: string
              enum:
                - sepa_debit
              default: sepa_debit
              description: Type of payment method
              example: sepa_debit
            sepa_debit:
              type: object
              properties:
                iban:
                  type: string
                  nullable: true
                  pattern: ^[A-Z]{2}[0-9]{2}[A-Z0-9]{1,30}$
                  description: >-
                    IBAN number. From API version 2026-09-08.gauss its checksum
                    must be valid, and known test IBANs are accepted in the
                    sandbox only.
                  example: DE68500105178297336485
                account_holder:
                  type: string
                  nullable: true
                  minLength: 1
                  description: Name of the account holder
                  example: John Doe
        previous_supplier:
          type: string
          nullable: true
          description: >-
            ID of the previous supplier, possible to obtain via /suppliers. Only
            supported for consumption plans.
          example: mp_mi4f0oda6x9m7gcsvjk0ole1
        intended_start_date:
          type: string
          nullable: true
          format: date
          description: >-
            Intended start date of the subscription. Must be a date in the
            future. For feed-in plans it must be the first day of a month, at
            least one month in the future; when omitted, the next possible
            production start date is used.
          example: '2024-01-01'
        change_reason:
          type: string
          enum:
            - supplier_change
            - move_in
          description: Reason of changing the supplier
          example: supplier_change
        created_by:
          type: string
          nullable: true
          description: Email of the user who created the lead
          example: john.doe@example.com
        metadata:
          type: object
          nullable: true
          additionalProperties:
            type: string
            nullable: true
          description: >-
            Metadata merged key-by-key onto the stored object. A key set to
            `null` is removed; `metadata: null` clears every key.
          example:
            utm_source: google
      description: >-
        A field left out stays as it is. `metadata` merges key by key, with a
        `null` value removing that key.
      example:
        metadata:
          utm_source: google
    Lead:
      type: object
      properties:
        object:
          type: string
          enum:
            - lead
        id:
          type: string
          description: Unique identifier for the lead
          example: lead_a8n8ol7yd4h0wohx824f0bui
        subscription:
          type: string
          nullable: true
          description: ID of the subscription, if the lead is converted to a subscription
          example: sub_a8n8ol7yd4h0wohx824f0bui
        subscribed_at:
          anyOf:
            - type: string
            - type: string
              format: date-time
            - nullable: true
          description: Timestamp when the lead was converted to a subscription
          example: '2024-03-14T12:00:00Z'
        link:
          type: string
          description: URL of the lead
          example: https://nomos.checkout.energy?id=lead_a8n8ol7yd4h0wohx824f0bui
        created_at:
          anyOf:
            - type: string
            - type: string
              format: date-time
          description: Timestamp when the lead was created
          example: '2024-03-14T12:00:00Z'
        created_by:
          type: string
          nullable: true
          description: Email of the user who created the lead
          example: john.doe@example.com
        last_visited_at:
          anyOf:
            - type: string
            - type: string
              format: date-time
            - nullable: true
          description: Timestamp when the lead was last visited
          example: '2024-03-14T12:00:00Z'
        metadata:
          type: object
          nullable: true
          additionalProperties:
            nullable: true
          description: Metadata of the lead, can be internal data
          example:
            utm_source: google
            utm_campaign: campaign_name
            user_id: '1234567890'
      required:
        - object
        - id
        - link
        - created_at
    ErrBadRequest:
      type: object
      properties:
        code:
          type: string
          enum:
            - BAD_REQUEST
          description: The error code related to the status code.
          example: BAD_REQUEST
        message:
          type: string
          description: A human readable message describing the issue.
        requestId:
          type: string
          description: The request id to be used for debugging and error reporting.
          example: 37a04f8f-e791-491c-81e1-86cd304649bb
        docs:
          type: string
          description: The docs related to the error code.
          example: https://docs.nomos.energy/api-references/errors/BAD_REQUEST
        errors:
          type: array
          items:
            type: object
            properties:
              code:
                type: string
                description: >-
                  What is wrong with the field, such as `invalid_type` or
                  `asset_not_found`. `x-extensible-enum` lists the values known
                  today. New values can be added in any API version, so treat an
                  unknown value like any other error of the response's status.
                example: invalid_type
                x-extensible-enum:
                  - invalid_type
                  - too_big
                  - too_small
                  - invalid_format
                  - not_multiple_of
                  - unrecognized_keys
                  - invalid_union
                  - invalid_key
                  - invalid_element
                  - invalid_value
                  - custom
                  - unserviceable_zip
                  - ended_subscription
                  - duplicate_grid_reduction
                  - missing_smart_meter
                  - missing_module_1
                  - incompatible_grid_reduction
                  - unsupported_product
                  - unsupported_meter_order
                  - duplicate_meter_order
                  - unsupported_meter
                  - out_of_period_meter_reading
                  - unsupported_meter_reading
                  - duplicate_meter_reading
                  - implausible_meter_reading
                  - duplicate_customer_email
                  - invalid_iban
                  - upgrade_api_version
                  - withdrawal_not_allowed
                  - invalid_termination_date
                  - subscription_not_started
                  - terminated_subscription
                  - missing_household
                  - invalid_household_customer
                  - invalid_household_meter
                  - duplicate_consumption_subscription
                  - invalid_inverter
                  - read_only_asset
                  - duplicate_external_id
                  - asset_has_children
                  - asset_decommissioned
                  - asset_not_found
                  - mixed_households
                  - field_not_allowed
                  - invalid_direction
                  - duplicate_timestamp
                  - asset_not_steerable
                  - mode_not_allowed
                  - slot_missing
              field:
                type: string
                example: customer.email
              message:
                type: string
                example: 'Invalid input: expected string, received undefined'
            required:
              - code
              - field
              - message
          description: >-
            Per-field breakdown of a validation or business-rule failure.
            Omitted for API versions before the structured-errors cutoff.
      required:
        - code
        - message
        - requestId
        - docs
    ErrUnauthorized:
      type: object
      properties:
        code:
          type: string
          enum:
            - UNAUTHORIZED
          description: The error code related to the status code.
          example: UNAUTHORIZED
        message:
          type: string
          description: A human readable message describing the issue.
        requestId:
          type: string
          description: The request id to be used for debugging and error reporting.
          example: 37a04f8f-e791-491c-81e1-86cd304649bb
        docs:
          type: string
          description: The docs related to the error code.
          example: https://docs.nomos.energy/api-references/errors/UNAUTHORIZED
      required:
        - code
        - message
        - requestId
        - docs
    ErrForbidden:
      type: object
      properties:
        code:
          type: string
          enum:
            - FORBIDDEN
          description: The error code related to the status code.
          example: FORBIDDEN
        message:
          type: string
          description: A human readable message describing the issue.
        requestId:
          type: string
          description: The request id to be used for debugging and error reporting.
          example: 37a04f8f-e791-491c-81e1-86cd304649bb
        docs:
          type: string
          description: The docs related to the error code.
          example: https://docs.nomos.energy/api-references/errors/FORBIDDEN
      required:
        - code
        - message
        - requestId
        - docs
    ErrNotFound:
      type: object
      properties:
        code:
          type: string
          enum:
            - NOT_FOUND
          description: The error code related to the status code.
          example: NOT_FOUND
        message:
          type: string
          description: A human readable message describing the issue.
        requestId:
          type: string
          description: The request id to be used for debugging and error reporting.
          example: 37a04f8f-e791-491c-81e1-86cd304649bb
        docs:
          type: string
          description: The docs related to the error code.
          example: https://docs.nomos.energy/api-references/errors/NOT_FOUND
        errors:
          type: array
          items:
            type: object
            properties:
              code:
                type: string
                description: >-
                  What is wrong with the field, such as `invalid_type` or
                  `asset_not_found`. `x-extensible-enum` lists the values known
                  today. New values can be added in any API version, so treat an
                  unknown value like any other error of the response's status.
                example: invalid_type
                x-extensible-enum:
                  - invalid_type
                  - too_big
                  - too_small
                  - invalid_format
                  - not_multiple_of
                  - unrecognized_keys
                  - invalid_union
                  - invalid_key
                  - invalid_element
                  - invalid_value
                  - custom
                  - unserviceable_zip
                  - ended_subscription
                  - duplicate_grid_reduction
                  - missing_smart_meter
                  - missing_module_1
                  - incompatible_grid_reduction
                  - unsupported_product
                  - unsupported_meter_order
                  - duplicate_meter_order
                  - unsupported_meter
                  - out_of_period_meter_reading
                  - unsupported_meter_reading
                  - duplicate_meter_reading
                  - implausible_meter_reading
                  - duplicate_customer_email
                  - invalid_iban
                  - upgrade_api_version
                  - withdrawal_not_allowed
                  - invalid_termination_date
                  - subscription_not_started
                  - terminated_subscription
                  - missing_household
                  - invalid_household_customer
                  - invalid_household_meter
                  - duplicate_consumption_subscription
                  - invalid_inverter
                  - read_only_asset
                  - duplicate_external_id
                  - asset_has_children
                  - asset_decommissioned
                  - asset_not_found
                  - mixed_households
                  - field_not_allowed
                  - invalid_direction
                  - duplicate_timestamp
                  - asset_not_steerable
                  - mode_not_allowed
                  - slot_missing
              field:
                type: string
                example: customer.email
              message:
                type: string
                example: 'Invalid input: expected string, received undefined'
            required:
              - code
              - field
              - message
          description: >-
            Per-field breakdown of a validation or business-rule failure.
            Omitted for API versions before the structured-errors cutoff.
      required:
        - code
        - message
        - requestId
        - docs
    ErrInternalServerError:
      type: object
      properties:
        code:
          type: string
          enum:
            - INTERNAL_SERVER_ERROR
          description: The error code related to the status code.
          example: INTERNAL_SERVER_ERROR
        message:
          type: string
          description: A human readable message describing the issue.
        requestId:
          type: string
          description: The request id to be used for debugging and error reporting.
          example: 37a04f8f-e791-491c-81e1-86cd304649bb
        docs:
          type: string
          description: The docs related to the error code.
          example: >-
            https://docs.nomos.energy/api-references/errors/INTERNAL_SERVER_ERROR
      required:
        - code
        - message
        - requestId
        - docs
  examples:
    400-body-is-not-valid-json:
      summary: Body is not valid JSON
      value:
        code: BAD_REQUEST
        message: Malformed JSON in request body
        requestId: 37a04f8f-e791-491c-81e1-86cd304649bb
        docs: https://docs.nomos.energy/api-references/errors/BAD_REQUEST
    400-unsupported-version-header:
      summary: Unsupported version header
      value:
        code: BAD_REQUEST
        message: Version header 2026-01-01.foo is invalid.
        requestId: 37a04f8f-e791-491c-81e1-86cd304649bb
        docs: https://docs.nomos.energy/api-references/errors/BAD_REQUEST
    401-no-token:
      summary: No token
      value:
        code: UNAUTHORIZED
        message: No authorization header provided.
        requestId: 37a04f8f-e791-491c-81e1-86cd304649bb
        docs: https://docs.nomos.energy/api-references/errors/UNAUTHORIZED
    401-expired-token:
      summary: Expired token
      value:
        code: UNAUTHORIZED
        message: Token expired
        requestId: 37a04f8f-e791-491c-81e1-86cd304649bb
        docs: https://docs.nomos.energy/api-references/errors/UNAUTHORIZED
    401-invalid-token:
      summary: Invalid token
      value:
        code: UNAUTHORIZED
        message: Invalid or malformed token
        requestId: 37a04f8f-e791-491c-81e1-86cd304649bb
        docs: https://docs.nomos.energy/api-references/errors/UNAUTHORIZED
    403-role-without-access:
      summary: Role without access
      value:
        code: FORBIDDEN
        message: Forbidden to access this route.
        requestId: 37a04f8f-e791-491c-81e1-86cd304649bb
        docs: https://docs.nomos.energy/api-references/errors/FORBIDDEN
    403-token-without-scope:
      summary: Token without scope
      value:
        code: FORBIDDEN
        message: 'Insufficient scope: write:* required.'
        requestId: 37a04f8f-e791-491c-81e1-86cd304649bb
        docs: https://docs.nomos.energy/api-references/errors/FORBIDDEN
    403-customer-token-without-customer:
      summary: Customer token without customer
      value:
        code: FORBIDDEN
        message: Customer not found.
        requestId: 37a04f8f-e791-491c-81e1-86cd304649bb
        docs: https://docs.nomos.energy/api-references/errors/FORBIDDEN
    404-unknown-lead:
      summary: Unknown lead
      value:
        code: NOT_FOUND
        message: Lead not found
        requestId: 37a04f8f-e791-491c-81e1-86cd304649bb
        docs: https://docs.nomos.energy/api-references/errors/NOT_FOUND
    500-unexpected-error:
      summary: Unexpected error
      value:
        code: INTERNAL_SERVER_ERROR
        message: Internal Server Error
        requestId: 37a04f8f-e791-491c-81e1-86cd304649bb
        docs: https://docs.nomos.energy/api-references/errors/INTERNAL_SERVER_ERROR
  securitySchemes:
    Bearer:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.