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

# Update points triggers

> Update points triggers in bulk. Maximum 100 triggers per request. Only provided fields are updated; omitted fields are preserved.



## OpenAPI

````yaml https://admin.trophy.so/v1/openapi patch /points/{systemId}/triggers
openapi: 3.1.0
info:
  title: Trophy
  version: 1.19.0
servers:
  - x-fern-server-name: Admin API
    url: https://admin.trophy.so/v1
    description: Admin API
security: []
paths:
  /points/{systemId}/triggers:
    servers:
      - url: https://admin.trophy.so/v1
        description: Admin API
    parameters:
      - $ref: '#/components/parameters/TenantId'
    patch:
      tags:
        - Admin
      summary: Update points triggers
      description: >-
        Update points triggers in bulk. Maximum 100 triggers per request. Only
        provided fields are updated; omitted fields are preserved.
      operationId: admin_points_triggers_update
      parameters:
        - name: systemId
          in: path
          description: The UUID of the points system.
          required: true
          schema:
            type: string
            format: uuid
          example: 550e8400-e29b-41d4-a716-446655440000
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchPointsTriggersRequest'
      responses:
        '200':
          description: Successfully processed the update request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PatchPointsTriggersResponse'
              examples:
                Updated triggers:
                  value:
                    updated:
                      - id: 550e8400-e29b-41d4-a716-446655440000
                        type: metric
                        points: 20
                        status: active
                        userAttributes: []
                        metricId: 660f9500-f30c-42e5-b827-557766550001
                        metricThreshold: 5
                        eventAttributes: []
                        blockIfOutOfPoints: false
                    issues: []
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AdminErrorBody'
        '404':
          description: Not Found (points system not found)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AdminErrorBody'
        '422':
          description: Unprocessible Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AdminErrorBody'
      security:
        - ApiKeyAuth: []
      x-codeSamples:
        - lang: javascript
          source: >
            import { TrophyApiClient } from '@trophyso/node';


            const trophy = new TrophyApiClient({
              apiKey: 'YOUR_API_KEY'
            });


            const result = await
            trophy.admin.points.triggers.update('system-uuid', [
              { id: 'trigger-uuid', points: 20 }
            ]);
        - lang: python
          source: |
            from trophy import TrophyApi

            client = TrophyApi(api_key='YOUR_API_KEY')

            result = client.admin.points.triggers.update(
              system_id='system-uuid',
              request=[{'id': 'trigger-uuid', 'points': 20}]
            )
        - lang: go
          source: >
            import (
              "context"

              api "github.com/trophyso/trophy-go"
              trophyclient "github.com/trophyso/trophy-go/client"
              "github.com/trophyso/trophy-go/option"
            )


            client := trophyclient.NewClient(
              option.WithApiKey("YOUR_API_KEY"),
            )


            response, err := client.Admin.Points.Triggers.Update(context.TODO(),
            "system-uuid", api.PatchPointsTriggersRequest{})
components:
  parameters:
    TenantId:
      name: Tenant-ID
      in: header
      description: >-
        The tenant identifier for multi-tenant organisations. Required when the
        organisation has multi-tenancy enabled. Pass your own internal customer
        ID for the tenant. Ignored for single-tenant organisations.
      required: false
      schema:
        type: string
      example: customer_12345
  schemas:
    PatchPointsTriggersRequest:
      title: PatchPointsTriggersRequest
      type: array
      description: Array of points trigger patches. Maximum 100 per request.
      items:
        type: object
        properties:
          id:
            type: string
            format: uuid
            description: The UUID of the trigger to update.
          type:
            type: string
            enum:
              - metric
              - achievement
              - streak
              - time
              - user_creation
            description: >-
              Updated trigger type. Can only be changed when the trigger is
              inactive. Required fields for the new type must be provided.
          points:
            type: integer
            description: Updated points value.
          status:
            type: string
            enum:
              - active
              - inactive
            description: Updated status.
          userAttributes:
            type:
              - array
              - 'null'
            description: Updated user attribute filters. Set to null to clear.
            items:
              type: object
              properties:
                attributeId:
                  type: string
                  format: uuid
                attributeValue:
                  type: string
              required:
                - attributeId
                - attributeValue
          metricId:
            type: string
            format: uuid
            description: Updated metric ID. Only permitted for metric triggers.
          metricThreshold:
            type: integer
            minimum: 1
            description: Updated metric threshold. Only permitted for metric triggers.
          eventAttributes:
            type:
              - array
              - 'null'
            description: >-
              Updated event attribute filters. Only permitted for metric
              triggers. Set to null to clear.
            items:
              type: object
              properties:
                attributeId:
                  type: string
                  format: uuid
                attributeValue:
                  type: string
              required:
                - attributeId
                - attributeValue
          achievementId:
            type: string
            format: uuid
            description: Updated achievement ID. Only permitted for achievement triggers.
          streakLength:
            type: integer
            minimum: 1
            description: Updated streak length. Only permitted for streak triggers.
          timeUnit:
            type: string
            enum:
              - hours
              - days
            description: Updated time unit. Only permitted for time triggers.
          timeInterval:
            type: integer
            minimum: 1
            description: Updated time interval. Only permitted for time triggers.
          blockIfOutOfPoints:
            type: boolean
            description: Updated block-if-out-of-points setting.
        required:
          - id
      maxItems: 100
      minItems: 1
    PatchPointsTriggersResponse:
      title: PatchPointsTriggersResponse
      type: object
      description: Response containing updated triggers and any issues encountered.
      properties:
        updated:
          type: array
          items:
            $ref: '#/components/schemas/AdminPointsTrigger'
          description: Array of successfully updated triggers.
        issues:
          type: array
          items:
            $ref: '#/components/schemas/AdminIssue'
          description: Array of issues encountered during trigger updates.
      required:
        - updated
        - issues
    AdminErrorBody:
      title: AdminErrorBody
      type: object
      properties:
        error:
          type: string
      required:
        - error
    AdminPointsTrigger:
      title: AdminPointsTrigger
      type: object
      description: A points trigger as returned from admin endpoints.
      properties:
        id:
          type: string
          format: uuid
          description: The UUID of the trigger.
        type:
          type: string
          enum:
            - metric
            - achievement
            - streak
            - time
            - user_creation
          description: The type of trigger.
        points:
          type: integer
          description: The number of points awarded or deducted when the trigger fires.
        status:
          type: string
          enum:
            - active
            - inactive
          description: The status of the trigger.
        userAttributes:
          type: array
          description: User attribute filters applied to the trigger.
          items:
            type: object
            properties:
              attributeId:
                type: string
                format: uuid
              attributeValue:
                type: string
            required:
              - attributeId
              - attributeValue
        metricId:
          type: string
          format: uuid
          description: The UUID of the metric. Only present for metric triggers.
        metricThreshold:
          type: integer
          description: The metric threshold. Only present for metric triggers.
        eventAttributes:
          type: array
          description: >-
            Event attribute filters applied to the trigger. Only present for
            metric triggers.
          items:
            type: object
            properties:
              attributeId:
                type: string
                format: uuid
              attributeValue:
                type: string
            required:
              - attributeId
              - attributeValue
        achievementId:
          type: string
          format: uuid
          description: The UUID of the achievement. Only present for achievement triggers.
        streakLength:
          type: integer
          description: The streak length. Only present for streak triggers.
        timeUnit:
          type: string
          enum:
            - hours
            - days
          description: The time unit. Only present for time triggers.
        timeInterval:
          type: integer
          description: The time interval. Only present for time triggers.
        blockIfOutOfPoints:
          type: boolean
          description: >-
            Whether metric events that would reduce the user's points below zero
            are blocked.
      required:
        - id
        - type
        - points
        - status
        - userAttributes
        - blockIfOutOfPoints
    AdminIssue:
      title: AdminIssue
      type: object
      description: An issue encountered while processing an item in an admin API request.
      properties:
        id:
          type: string
          description: The ID of the resource the issue relates to, when applicable.
          example: 550e8400-e29b-41d4-a716-446655440000
        userId:
          type: string
          description: The ID of the user the issue relates to, when applicable.
          example: user-123
        boostId:
          type: string
          description: The ID of the points boost the issue relates to, when applicable.
          example: 550e8400-e29b-41d4-a716-446655440000
        index:
          type: integer
          description: >-
            The zero-based index of the item the issue relates to, when no
            resource ID exists yet.
          example: 0
        severity:
          type: string
          enum:
            - error
            - warning
          description: The severity level of the issue.
          example: warning
        message:
          type: string
          description: A human-readable description of the issue.
          example: Would exceed maximum freeze limit
      required:
        - severity
        - message
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY

````