> ## 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 license entry

> This API let’s you to add a license entry



## OpenAPI

````yaml post /license_updates
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:
  /license_updates:
    post:
      tags:
        - Licenses
      summary: Update a license entry
      description: This API let’s you to add a license entry
      operationId: addLicenseUpdateEntry
      requestBody:
        $ref: '#/components/requestBodies/LicenseUpdateRequest'
      responses:
        '200':
          description: Success response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LicenseUpdateResponse'
              examples:
                LicenseUpdateResponse:
                  $ref: '#/components/examples/LicenseUpdateResponse'
        '400':
          description: Bad request. Please check the response message for failure details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: >-
            Credential is not valid. Please check the response message for
            failure details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Credential does not have access to add a license entry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: >-
            Unable to process the query parameters provided. Please check our
            docs for the api limits - https://togai.io/docs/limits.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: >-
            Request throttled. Please check the response message on the failure
            details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
components:
  requestBodies:
    LicenseUpdateRequest:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/LicenseUpdateRequest'
          examples:
            AbsoluteLicenseUpdateRequest:
              value:
                licenseId: addon.21LdC76myzw.uiSWm
                accountId: account#1
                updateType: ABSOLUTE
                quantity: 10
            RelativeLicenseUpdateRequest:
              value:
                licenseId: addon.21JwBhBzM76.9mzoA
                accountId: account#2
                updateType: RELATIVE
                quantity: -5
            AbsoluteLicenseUpdateRequestWithIdempotencyKey:
              value:
                licenseId: addon.21LdC76myzw.uiSWm
                accountId: account#1
                updateType: ABSOLUTE
                quantity: 10
                idempotencyKey: idempotencyKey#1
            RelativeLicenseUpdateRequestWithIdempotencyKey:
              value:
                licenseId: addon.21JwBhBzM76.9mzoA
                accountId: account#2
                updateType: RELATIVE
                quantity: -5
                idempotencyKey: idempotencyKey#2
  schemas:
    LicenseUpdateResponse:
      allOf:
        - $ref: '#/components/schemas/LicenseUpdate'
        - type: object
          additionalProperties: false
          required:
            - createdAt
          properties:
            createdAt:
              type: string
              format: date-time
              example: '2021-03-04T14:25:10Z'
    ErrorResponse:
      type: object
      additionalProperties: false
      required:
        - message
      properties:
        message:
          type: string
          description: error description
          maxLength: 500
    LicenseUpdateRequest:
      description: License update request
      type: object
      additionalProperties: false
      required:
        - licenseId
        - accountId
        - updateType
        - quantity
      properties:
        licenseId:
          type: string
          description: The license id for which the update is requested
          maxLength: 50
          example: lic.fdjsl.313
        accountId:
          type: string
          description: The account id for which the license is being updated
          maxLength: 50
          example: acc.fdjsl.313
        updateType:
          type: string
          description: The type of update to be performed
          enum:
            - RELATIVE
            - ABSOLUTE
        quantity:
          type: number
          description: The quantity to be updated
        effectiveFrom:
          type: string
          description: The effective from date for the update
          format: date-time
          example: '2021-03-04T14:25:10Z'
        idempotencyKey:
          type: string
          description: The idempotency key for uniqueness of the license update request
          example: idempotencyKey#1
        metadata:
          type: object
          additionalProperties:
            type: string
          example:
            key1: value1
            key2: value2
    LicenseUpdate:
      description: License update
      type: object
      additionalProperties: false
      required:
        - licenseId
        - accountId
        - quantity
        - effectiveFrom
      properties:
        licenseId:
          type: string
          maxLength: 50
          example: lic.fdjsl.313
        accountId:
          type: string
          maxLength: 50
          example: acc.fdjsl.313
        quantity:
          description: Absolute quantity of the license
          type: number
          example: 10
        effectiveFrom:
          type: string
          format: date-time
          example: '2021-03-04T14:25:10Z'
        metadata:
          type: object
          additionalProperties:
            type: string
          example:
            key1: value1
            key2: value2
  examples:
    LicenseUpdateResponse:
      summary: example license update response
      value:
        licenseId: lic.fdjsl.313
        accountId: acc.fdjsl.313
        quantity: 10
        effectiveFrom: '2020-01-01T00:00:00Z'
        createdAt: '2021-03-04T14:25:10Z'
  responses:
    ErrorResponse:
      description: Error response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            ErrorResponse:
              summary: Error message
              value:
                message: <Reason message>
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: Bearer <credential>

````