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

# Create a feature

> This endpoint creates a boolean, config, or metered feature in your product catalog.



## OpenAPI

````yaml /nozle-openapi.yaml post /features
openapi: 3.1.0
info:
  title: Nozle Billing API
  description: >-
    Nozle Billing API allows your application to push customer information and
    metrics (events) from your application to the billing engine.
  version: 1.49.0
  license:
    name: AGPLv3
    url: https://github.com/nozle-dev/core/blob/main/LICENSE
  contact:
    email: support@nozle.app
servers:
  - url: https://core.nozle.app/api/v1
    description: Nozle Billing API
security:
  - bearerAuth: []
tags:
  - name: Activity Logs
    description: Everything about Activity logs
    externalDocs:
      description: Find out more
      url: https://docs.nozle.app/api-reference
  - name: Analytics
    description: Everything about Analytics
  - name: API Logs
    description: Everything about API logs
    externalDocs:
      description: Find out more
      url: https://docs.nozle.app/api-reference
  - name: Features
    description: Everything about Feature collection
    externalDocs:
      description: Find out more
      url: https://docs.nozle.app/api-reference
  - name: Entitlements
    description: Everything about Entitlement collection
    externalDocs:
      description: Find out more
      url: https://docs.nozle.app/api-reference
  - name: Billing Entities
    description: Everything about Billing Entities
    externalDocs:
      description: Find out more
      url: https://docs.nozle.app/api-reference
  - name: Customers
    description: Everything about Customer collection
    externalDocs:
      description: Find out more
      url: https://docs.nozle.app/api-reference
  - name: Plans
    description: Everything about Plan collection
    externalDocs:
      description: Find out more
      url: https://docs.nozle.app/api-reference
  - name: Subscriptions
    description: Everything about Subscription collection
    externalDocs:
      description: Find out more
      url: https://docs.nozle.app/api-reference
  - name: Events
    description: Everything about Event collection
    externalDocs:
      description: Find out more
      url: https://docs.nozle.app/api-reference
  - name: Organizations
    description: Everything about Organization collection
    externalDocs:
      description: Find out more
      url: https://docs.nozle.app/api-reference
  - name: Taxes
    description: Everything about Tax collection
    externalDocs:
      description: Find out more
      url: https://docs.nozle.app/api-reference
  - name: Coupons
    description: Everything about Coupon collection
    externalDocs:
      description: Find out more
      url: https://docs.nozle.app/api-reference
  - name: Add-ons
    description: Everything about Add-on collection
    externalDocs:
      description: Find out more
      url: https://docs.nozle.app/api-reference
  - name: Fees
    description: Everything about Fees
    externalDocs:
      description: Find out more
      url: https://docs.nozle.app/api-reference
  - name: Invoices
    description: Everything about Invoice collection
    externalDocs:
      description: Find out more
      url: https://docs.nozle.app/api-reference
  - name: Wallets
    description: Everything about Wallet collection
    externalDocs:
      description: Find out more
      url: https://docs.nozle.app/api-reference
  - name: Credit Notes
    description: Everything about Credit notes collection
    externalDocs:
      description: Find out more
      url: https://docs.nozle.app/api-reference
  - name: Webhooks
    description: Everything about Webhooks
    externalDocs:
      description: Find out more
      url: https://docs.nozle.app/api-reference
  - name: Webhook Endpoints
    description: Everything about Webhook Endpoints
    externalDocs:
      description: Find out more
      url: https://docs.nozle.app/api-reference
  - name: Payment Receipts
    description: Everything about Payment receipts
    externalDocs:
      description: Find out more
      url: https://docs.nozle.app/api-reference
  - name: Payment Requests
    description: Everything about PaymentRequests
    externalDocs:
      description: Find out more
      url: https://docs.nozle.app/api-reference
  - name: Payments
    description: Everything about Payments
    externalDocs:
      description: Find out more
      url: https://docs.nozle.app/api-reference
  - name: Payment Methods
    description: Everything about Payment Methods
    externalDocs:
      description: Find out more
      url: https://docs.nozle.app/api-reference
externalDocs:
  description: Nozle Github
  url: https://github.com/nozle-dev
paths:
  /features:
    post:
      tags:
        - Features
      summary: Create a feature
      description: >-
        This endpoint creates a boolean, config, or metered feature in your
        product catalog.
      operationId: createFeature
      requestBody:
        description: Feature payload
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FeatureCreateInput'
        required: true
      responses:
        '200':
          description: Feature created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Feature'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
components:
  schemas:
    FeatureCreateInput:
      type: object
      required:
        - feature
      properties:
        feature:
          allOf:
            - $ref: '#/components/schemas/FeatureBaseInput'
            - type: object
              required:
                - code
                - name
                - feature_type
              properties:
                code:
                  type: string
                  example: seats
                  description: Unique code used to identify the feature.
    Feature:
      type: object
      required:
        - feature
      properties:
        feature:
          $ref: '#/components/schemas/FeatureObject'
    FeatureBaseInput:
      type: object
      properties:
        feature_type:
          type: string
          enum:
            - boolean
            - config
            - metered
          description: Immutable Feature behavior selected at creation.
        name:
          type:
            - string
            - 'null'
          example: Number of seats
          description: Name of the feature.
        description:
          type:
            - string
            - 'null'
          example: Number of users of the account
          description: Internal description of the feature.
        privileges:
          type: array
          items:
            type: object
            required:
              - code
            properties:
              code:
                type: string
                example: max
                description: Unique code for the privilege.
              name:
                type:
                  - string
                  - 'null'
                example: Maximum
                description: Display name for the privilege.
              value_type:
                type: string
                enum:
                  - integer
                  - boolean
                  - string
                  - select
                example: integer
                description: 'Data type of the privilege value. Default: string'
              config:
                type: object
                properties:
                  select_options:
                    type: array
                    items:
                      type: string
                    example:
                      - google
                      - okta
                    description: >-
                      Array of string, required only when value_type is
                      `select`.
          example:
            - code: max
              name: Maximum
              value_type: integer
            - code: max_admins
              name: Max Admins
              value_type: integer
            - code: root
              name: Allow root user
              value_type: boolean
            - code: provider
              name: SSO Provider
              value_type: select
              config:
                select_options:
                  - google
                  - okta
          description: Privileges associated with this feature. Can be empty.
        aggregation_type:
          type: string
          enum:
            - count_agg
            - sum_agg
            - max_agg
            - unique_count_agg
            - weighted_sum_agg
            - latest_agg
            - custom_agg
          description: Required for metered Features.
        consumable:
          type: boolean
          description: Required for metered Features.
        recurring:
          type: boolean
          default: false
        field_name:
          type:
            - string
            - 'null'
        expression:
          type:
            - string
            - 'null'
        custom_aggregator:
          type:
            - string
            - 'null'
        weighted_interval:
          type:
            - string
            - 'null'
          enum:
            - seconds
            - null
        rounding_function:
          type:
            - string
            - 'null'
          enum:
            - ceil
            - floor
            - round
            - null
        rounding_precision:
          type:
            - integer
            - 'null'
        filters:
          type: array
          items:
            $ref: '#/components/schemas/FeatureFilterInput'
    FeatureObject:
      type: object
      required:
        - lago_id
        - code
        - name
        - feature_type
        - created_at
      properties:
        lago_id:
          type: string
          format: uuid
          example: 1a901a90-1a90-1a90-1a90-1a901a901a90
          description: Unique identifier of the Feature created by Nozle.
        code:
          type: string
          example: seats
          description: Immutable code used for entitlement checks and metered events.
        name:
          type: string
          example: Number of seats
          description: Name of the feature. Max 255 characters.
        description:
          type:
            - string
            - 'null'
          example: Number of users of the account
          description: Description of the feature. Max 600 characters.
        feature_type:
          type: string
          enum:
            - boolean
            - config
            - metered
          example: metered
          description: >-
            Determines which Feature configuration is active. Immutable after
            creation.
        privileges:
          type: array
          items:
            $ref: '#/components/schemas/FeaturePrivilegeObject'
          example:
            - code: max
              name: Maximum
              value_type: integer
              config: {}
            - code: max_admins
              name: Max Admins
              value_type: integer
              config: {}
            - code: root
              name: Allow root user
              value_type: boolean
              config: {}
            - code: provider
              name: SSO Provider
              value_type: select
              config:
                select_options:
                  - google
                  - okta
          description: >-
            Privileges for boolean and config Features. Config Features require
            at least one.
        aggregation_type:
          type:
            - string
            - 'null'
          enum:
            - count_agg
            - sum_agg
            - max_agg
            - unique_count_agg
            - weighted_sum_agg
            - latest_agg
            - custom_agg
            - null
          example: sum_agg
          description: Aggregation method for a metered Feature.
        consumable:
          type:
            - boolean
            - 'null'
          example: true
          description: >-
            Whether metered usage consumes an allowance or Credit System
            balance.
        recurring:
          type:
            - boolean
            - 'null'
          example: false
          description: Whether accumulated usage carries into the next billing period.
        field_name:
          type:
            - string
            - 'null'
          example: tokens
          description: Event property aggregated by the metered Feature.
        expression:
          type:
            - string
            - 'null'
          example: round((ended_at - started_at) * units)
        custom_aggregator:
          type:
            - string
            - 'null'
          description: >-
            Custom aggregation implementation when aggregation_type is
            custom_agg.
        weighted_interval:
          type:
            - string
            - 'null'
          enum:
            - seconds
            - null
        rounding_function:
          type:
            - string
            - 'null'
          enum:
            - ceil
            - floor
            - round
            - null
        rounding_precision:
          type:
            - integer
            - 'null'
          example: 2
        filters:
          type: array
          items:
            $ref: '#/components/schemas/FeatureFilterObject'
        created_at:
          type: string
          format: date-time
          example: '2025-07-17T12:34:35Z'
          description: Creation date of the feature.
    ApiErrorBadRequest:
      type: object
      required:
        - status
        - error
      properties:
        status:
          type: integer
          format: int32
          example: 400
        error:
          type: string
          example: Bad request
    ApiErrorUnauthorized:
      type: object
      required:
        - status
        - error
      properties:
        status:
          type: integer
          format: int32
          example: 401
        error:
          type: string
          example: Unauthorized
    ApiErrorUnprocessableEntity:
      type: object
      required:
        - status
        - error
        - code
        - error_details
      properties:
        status:
          type: integer
          format: int32
          example: 422
        error:
          type: string
          example: Unprocessable entity
        code:
          type: string
          example: validation_errors
        error_details:
          type: object
    FeatureFilterInput:
      type: object
      required:
        - key
        - values
      properties:
        key:
          type: string
          example: region
        values:
          type: array
          items:
            type: string
          example:
            - us-east-1
    FeaturePrivilegeObject:
      type: object
      required:
        - code
        - name
        - value_type
        - config
      properties:
        code:
          type: string
          example: max
          description: Unique code for the privilege.
        name:
          type:
            - string
            - 'null'
          example: Maximum
          description: Display name for the privilege.
        value_type:
          type: string
          enum:
            - integer
            - boolean
            - string
            - select
          example: integer
          description: 'Data type of the privilege value. Default: string'
        config:
          type: object
          properties:
            select_options:
              type: array
              items:
                type: string
              example:
                - google
                - okta
              description: Array of string, required only when value_type is `select`.
    FeatureFilterObject:
      type: object
      description: Values used to segment metered Feature events.
      required:
        - key
        - values
      properties:
        key:
          type: string
          example: region
        values:
          type: array
          items:
            type: string
          example:
            - us-east-1
  responses:
    BadRequest:
      description: Bad Request error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorBadRequest'
    Unauthorized:
      description: Unauthorized error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorUnauthorized'
    UnprocessableEntity:
      description: Unprocessable entity error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorUnprocessableEntity'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````