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

# Edit Achievement Definition

> A `PUT` to the `/achievements/definitions/{definitionId}` endpoint allows your application edit an Achievement Definition.



## OpenAPI

````yaml put /v3/achievements/definitions/{definition}
openapi: 3.1.0
info:
  title: Omneo
  version: 0.0.1
servers:
  - url: https://api.{tenant}.getomneo.com/api
    variables:
      tenant:
        default: example
security: []
paths:
  /v3/achievements/definitions/{definition}:
    put:
      tags:
        - Achievement Definition
      summary: Edit Achievement Definition
      description: >-
        A `PUT` to the `/achievements/definitions/{definitionId}` endpoint
        allows your application edit an Achievement Definition.
      operationId: achievements.definitions.update
      parameters:
        - name: definition
          in: path
          required: true
          description: The definition ID
          schema:
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateAchievementDefinition'
      responses:
        '200':
          description: '`AchievementDefinition`'
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/AchievementDefinition'
                required:
                  - data
        '401':
          $ref: '#/components/responses/AuthenticationException'
        '403':
          $ref: '#/components/responses/AuthorizationException'
        '404':
          $ref: '#/components/responses/ModelNotFoundException'
        '422':
          $ref: '#/components/responses/ValidationException'
components:
  schemas:
    UpdateAchievementDefinition:
      type: object
      properties:
        name:
          type: string
        region_id:
          type:
            - integer
            - 'null'
        currency:
          type:
            - string
            - 'null'
          pattern: ^[A-Z]+$
        description:
          type:
            - string
            - 'null'
        internal_notes:
          type:
            - string
            - 'null'
        type:
          type: string
        starts_at:
          type:
            - string
            - 'null'
          format: date
        ends_at:
          type:
            - string
            - 'null'
          format: date
        is_published:
          type: boolean
        display_level:
          type:
            - boolean
            - 'null'
        display_option:
          type:
            - string
            - 'null'
          enum:
            - visible
            - hidden
            - mystery
            - internal
        short_description:
          type:
            - string
            - 'null'
        long_description:
          type:
            - string
            - 'null'
        terms_conditions:
          type:
            - string
            - 'null'
        earn_instructions:
          type:
            - string
            - 'null'
        icon:
          type:
            - string
            - 'null'
          format: uri
        image_url:
          type:
            - string
            - 'null'
          format: uri
        meta:
          type:
            - array
            - 'null'
          items:
            type: string
        enable_annual_earn_cycle:
          type: boolean
        timezone:
          type:
            - string
            - 'null'
        period:
          type:
            - string
            - 'null'
          enum:
            - monthly
            - weekly
            - fortnightly
            - daily
            - yearly
        tags:
          type: array
          items:
            type: string
        levels:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
              display_number:
                type: integer
              description:
                type:
                  - string
                  - 'null'
              trigger:
                type: integer
              repeats:
                type: boolean
              repeat_interval:
                type: integer
              meta:
                type:
                  - array
                  - 'null'
                items:
                  type: string
            required:
              - name
              - display_number
              - trigger
      title: UpdateAchievementDefinition
    AchievementDefinition:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
        handle:
          type: string
        region_id:
          type:
            - integer
            - 'null'
        region:
          type:
            - object
            - 'null'
          properties:
            id:
              type: integer
            name:
              type: string
            handle:
              type: string
          required:
            - id
            - name
            - handle
        currency:
          type:
            - string
            - 'null'
        description:
          type:
            - string
            - 'null'
        internal_notes:
          type:
            - string
            - 'null'
        type:
          type:
            - string
            - 'null'
        starts_at:
          type:
            - string
            - 'null'
          format: date-time
        ends_at:
          type:
            - string
            - 'null'
          format: date-time
        is_published:
          type: boolean
        display_level:
          type: boolean
        display_option:
          type: string
        short_description:
          type:
            - string
            - 'null'
        long_description:
          type:
            - string
            - 'null'
        terms_conditions:
          type:
            - string
            - 'null'
        earn_instructions:
          type:
            - string
            - 'null'
        icon:
          type:
            - string
            - 'null'
        image_url:
          type:
            - string
            - 'null'
        levels:
          type: array
          items:
            $ref: '#/components/schemas/AchievementLevel'
        tags:
          type: array
          items:
            $ref: '#/components/schemas/Tag'
        meta:
          type:
            - array
            - 'null'
          items: {}
        timezone:
          type:
            - string
            - 'null'
        period:
          type:
            - string
            - 'null'
        created_at:
          type: string
        updated_at:
          type: string
        enable_annual_earn_cycle:
          type: boolean
      required:
        - id
        - name
        - handle
        - region_id
        - region
        - currency
        - description
        - internal_notes
        - type
        - starts_at
        - ends_at
        - is_published
        - display_level
        - display_option
        - short_description
        - long_description
        - terms_conditions
        - earn_instructions
        - icon
        - image_url
        - levels
        - tags
        - meta
        - timezone
        - period
        - created_at
        - updated_at
        - enable_annual_earn_cycle
      title: AchievementDefinition
    AchievementLevel:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
        achievement_definition_id:
          type: integer
        display_number:
          type: integer
        description:
          type:
            - string
            - 'null'
        trigger:
          type: integer
        repeats:
          type: boolean
        repeat_interval:
          type:
            - integer
            - 'null'
        allow_multiple_earn:
          type:
            - boolean
            - 'null'
        computed_display_number:
          type: string
        computed_trigger:
          type: string
        meta:
          type:
            - array
            - 'null'
          items: {}
      required:
        - id
        - name
        - achievement_definition_id
        - display_number
        - description
        - trigger
        - repeats
        - repeat_interval
        - allow_multiple_earn
        - computed_display_number
        - computed_trigger
        - meta
      title: AchievementLevel
    Tag:
      type: string
      title: Tag
  responses:
    AuthenticationException:
      description: Unauthenticated
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
    AuthorizationException:
      description: Authorization error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
    ModelNotFoundException:
      description: Not found
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
    ValidationException:
      description: Validation error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Errors overview.
              errors:
                type: object
                description: A detailed description of each field that failed validation.
                additionalProperties:
                  type: array
                  items:
                    type: string
            required:
              - message
              - errors

````