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

# Update a Feature

> Update an existing feature and its eventSchema associations




## OpenAPI

````yaml patch /features/{feature_id}
openapi: 3.0.3
info:
  version: '1.0'
  title: Togai Apis
  contact:
    email: engg@togai.com
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  description: APIs for Togai App
servers:
  - description: Api endpoint
    url: https://api.togai.com/
  - description: Sandbox api endpoint
    url: https://sandbox-api.togai.com/
security:
  - bearerAuth: []
tags:
  - name: Customers
    description: Customer level calls
  - name: Accounts
    description: Account level calls
  - name: Event Schemas
    description: Event Schema level calls
  - name: Usage Meters
    description: Usage Meter level calls
  - name: Price Plans
    description: (DEPRECATED) Price Plan level calls
  - name: PricePlanV2
    description: Price Plan V2 level calls
  - name: Schedules
    description: Account Schedule level calls
  - name: Pricing Rules
    description: Pricing Rules level calls
  - name: Settings
    description: Settings
  - name: Price Experimentation
    description: Price Experimentation apis
  - name: InvoiceGroups
    description: Invoice Group level calls
  - name: Organization
    description: Organization level calls
  - name: FileStorage
    description: File Storage level calls
  - name: Aliases
    description: Alias level calls
  - name: Reports
    description: Report level calls
  - name: ReportTemplates
    description: Report Template level calls
  - name: Customer Portal
    description: Portal level calls
  - name: Alerts
    description: Alert level calls
  - name: Event Management
    description: APIs for getting events ingested in Togai
    externalDocs:
      description: docs
      url: https://togai.com/docs/billing/events
  - name: Metrics
    description: APIs for getting Togai metrics
    externalDocs:
      description: docs
      url: https://togai.com/docs/metrics
  - name: Licenses
    description: APIs for getting or updating license records in Togai
  - name: Entitlements
    description: APIs related to entitlements
  - name: Invoices
    description: Invoices API
  - name: Credits
    description: Credits API
  - name: Wallet
    description: Wallet API
  - name: InvoiceTemplates
    description: InvoiceTemplates API
  - name: InvoiceSequence
    description: InvoiceSequence API
  - name: Payments
    description: Payments API
  - name: Authentication
    description: Authentication API
externalDocs:
  description: Find out more about Togai
  url: https://docs.togai.com/docs
paths:
  /features/{feature_id}:
    patch:
      tags:
        - Feature
      summary: Update a Feature
      description: |
        Update an existing feature and its eventSchema associations
      operationId: updateFeature
      parameters:
        - $ref: '#/components/parameters/feature_id'
      requestBody:
        $ref: '#/components/requestBodies/UpdateFeatureRequest'
      responses:
        '200':
          $ref: '#/components/responses/FeatureResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
components:
  parameters:
    feature_id:
      in: path
      description: feature_id corresponding to a feature
      name: feature_id
      required: true
      schema:
        type: string
        maxLength: 50
        example: feat.fdjskl.sdkjl
  requestBodies:
    UpdateFeatureRequest:
      description: Payload to update a Feature along the associations with event_schemas
      required: true
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UpdateFeatureRequest'
          examples:
            UpdateFeatureRequest:
              $ref: '#/components/examples/UpdateFeatureRequest'
  responses:
    FeatureResponse:
      description: Response for Create and Get Feature requests
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Feature'
          examples:
            FeatureResponse:
              $ref: '#/components/examples/FeatureResponse'
    ErrorResponse:
      description: Error response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            ErrorResponse:
              summary: Error message
              value:
                message: <Reason message>
  schemas:
    UpdateFeatureRequest:
      description: Update a Feature properties
      type: object
      additionalProperties: false
      properties:
        name:
          description: Name of the feature
          type: string
          maxLength: 255
        billableName:
          description: >-
            Billable name of addon. Billable name takes precedence over name to
            display in invoice.
          type: string
          maxLength: 255
        schemaAssociations:
          $ref: '#/components/schemas/SchemaFeature'
    Feature:
      type: object
      description: Represents a Feature
      additionalProperties: false
      required:
        - id
        - name
        - displayName
        - schemaAssociations
        - createdAt
      properties:
        id:
          type: string
        name:
          type: string
        billableName:
          type: string
          maxLength: 255
        displayName:
          description: >
            Display name of feature. This is an auto-generated field which
            contains billableName of feature.

            If billableName is not provided, name will be used as display name.
          type: string
          maxLength: 255
        schemaAssociations:
          $ref: '#/components/schemas/SchemaFeature'
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    ErrorResponse:
      type: object
      additionalProperties: false
      required:
        - message
      properties:
        message:
          type: string
          description: error description
          maxLength: 500
    SchemaFeature:
      description: Association of a feature with event_schemas
      type: array
      maxItems: 50
      items:
        $ref: '#/components/schemas/EventSchemasForFeature'
      uniqueItems: true
    EventSchemasForFeature:
      description: event_schema details that are in association with feature
      type: object
      required:
        - schemaName
        - attributeName
      properties:
        schemaName:
          type: string
          pattern: ^[\sa-zA-Z0-9_-]*$
        attributeName:
          type: string
  examples:
    UpdateFeatureRequest:
      value:
        name: DiscountCredits
        schemaAssociations:
          - event_schema1
          - event_schema3
    FeatureResponse:
      value:
        id: feature.1zYnCiM9Bpg.lv25y
        name: DiscountCredits
        displayName: DiscountCredits
        schemaAssociations:
          - schemaName: event_schema1
            attributeName: distance
          - schemaName: event_schema2
            attributeName: time
        createdAt: '2020-01-01T00:00:00Z'
        updatedAt: '2020-01-01T00:00:00Z'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: Bearer <credential>

````