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

# Update a streak config by id

> Update a streak config by id.



## OpenAPI

````yaml /openapi/admin.json patch /streaks/configs/{id}
openapi: 3.1.0
info:
  title: Nudj Admin API
  version: 1.0.0
servers:
  - url: https://{subdomain}.nudj.cx/api/v2/admin
    description: Organization API Server
    variables:
      subdomain:
        description: Your organization's subdomain (required)
        default: your-org
security:
  - ApiToken: []
paths:
  /streaks/configs/{id}:
    patch:
      tags:
        - Streak
      summary: Update a streak config by id
      description: Update a streak config by id.
      operationId: updateStreakConfig
      parameters:
        - in: path
          name: id
          description: The id of the streak config to update
          schema:
            type: string
            pattern: ^[0-9a-fA-F]{24}$
            description: The id of the streak config to update
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                isEnabled:
                  type: boolean
                  description: >-
                    Whether the streak is enabled and users can start and extend
                    streaks.
                triggerEvents:
                  type: object
                  properties:
                    platform:
                      type: array
                      items:
                        type: string
                        enum:
                          - achievement-completion
                          - facebook-comment
                          - facebook-follow
                          - facebook-like
                          - image-analysis-object-detection
                          - image-analysis-receipt-detection
                          - instagram-follow
                          - instagram-like
                          - instagram-comment
                          - instagram-share
                          - instagram-post
                          - interaction-engage-with-content
                          - interaction-external-link
                          - interaction-image-upload
                          - interaction-spot-object
                          - platform-comment-on-post
                          - platform-complete-achievement
                          - platform-generative-action
                          - platform-like-post
                          - platform-play-game
                          - platform-validate-event
                          - question-multiple-choice
                          - question-open-ended
                          - question-rate-your-experience
                          - question-secret-access-code
                          - question-select-date
                          - question-select-from-images
                          - question-select-value-in-range
                          - question-select-from-list
                          - question-closed-ended
                          - question-vote
                          - spotify-follow
                          - spotify-listen
                          - spotify-save
                          - tiktok-follow
                          - tiktok-watch
                          - tiktok-post
                          - youtube-like
                          - youtube-comment
                          - youtube-subscribe
                          - action-completion
                          - skip-action
                          - 42-school
                          - api-auth-link
                          - api-token-link
                          - apple
                          - asgardeo
                          - atlassian
                          - auth0
                          - authentik
                          - azure-ad-b2c
                          - azure-ad
                          - azure-devops
                          - battlenet
                          - beyondidentity
                          - box
                          - boxyhq-saml
                          - bungie
                          - click-up
                          - cognito
                          - coinbase
                          - descope
                          - discord
                          - dribbble
                          - dropbox
                          - duende-identity-server6
                          - email
                          - eveonline
                          - facebook
                          - faceit
                          - foursquare
                          - freshbooks
                          - fusionauth
                          - github
                          - gitlab
                          - google
                          - hubspot
                          - identity-server4
                          - instagram
                          - kakao
                          - keycloak
                          - line
                          - linkedin
                          - mailchimp
                          - mailru
                          - mastodon
                          - mattermost
                          - medium
                          - naver
                          - netlify
                          - notion
                          - okta
                          - onelogin
                          - organisation-oidc
                          - osso
                          - osu
                          - passage
                          - patreon
                          - pinterest
                          - pipedrive
                          - reddit
                          - salesforce
                          - slack
                          - spotify
                          - strava
                          - tiktok
                          - todoist
                          - trakt
                          - twitch
                          - twitter
                          - united-effects
                          - vk
                          - wikimedia
                          - wordpress
                          - workos
                          - yandex
                          - youtube
                          - zitadel
                          - zoho
                          - zoom
                          - blog-comment
                          - blog-like
                          - blog-share
                          - blog-view
                          - challenge-started
                          - challenge-completion
                          - challenge-unlock
                          - community-visit
                          - parental-approval-requested
                          - parental-approval-approved
                          - parental-approval-rejected
                          - custom
                          - game-started
                          - game-completed
                          - leaderboard-finish
                          - invite-admin-user
                          - points-credit
                          - points-spend
                          - post-comment
                          - post-like
                          - post-view
                          - reward-redemption
                          - reward-allocation-purchase
                          - reward-giveaway-winner
                          - reward-claim
                          - reward-distribution
                          - manual-distribution
                          - referral-link-used
                          - shop-purchase
                          - share-challenge-details
                          - share-challenge-results
                          - share-community
                          - share-reward
                          - share-post
                          - share-profile
                          - share-anything
                          - streak-extended
                          - profile-picture-added
                          - bio-added
                          - variable-captured
                          - xp-gained
                          - xp-total
                          - xp-leaderboard-topper
                      description: >-
                        The Nudj platform events that trigger the streak to be
                        extended for a user. For example, challenge completions.
                    custom:
                      type: array
                      items:
                        type: string
                      description: >-
                        The custom events that trigger the streak to be extended
                        for a user.
                  required:
                    - platform
                    - custom
              description: The input required to update a streak config
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StreakConfig'
        '400':
          description: Invalid input data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.BAD_REQUEST'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.NOT_FOUND'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.INTERNAL_SERVER_ERROR'
components:
  schemas:
    StreakConfig:
      type: object
      properties:
        id:
          type: string
          pattern: ^[0-9a-fA-F]{24}$
          description: The id of the streak config
        organisationId:
          type: string
          pattern: ^[0-9a-fA-F]{24}$
          description: The id of the organisation this streak config belongs to
        communityId:
          type:
            - string
            - 'null'
          pattern: ^[0-9a-fA-F]{24}$
          description: >-
            The id of the community this streak config belongs to. No community
            means this is an organisation level streak config.
        isEnabled:
          type: boolean
          description: >-
            Whether the streak is enabled and users can start and extend
            streaks.
        triggerEvents:
          type: object
          properties:
            platform:
              type: array
              items:
                type: string
                enum:
                  - achievement-completion
                  - facebook-comment
                  - facebook-follow
                  - facebook-like
                  - image-analysis-object-detection
                  - image-analysis-receipt-detection
                  - instagram-follow
                  - instagram-like
                  - instagram-comment
                  - instagram-share
                  - instagram-post
                  - interaction-engage-with-content
                  - interaction-external-link
                  - interaction-image-upload
                  - interaction-spot-object
                  - platform-comment-on-post
                  - platform-complete-achievement
                  - platform-generative-action
                  - platform-like-post
                  - platform-play-game
                  - platform-validate-event
                  - question-multiple-choice
                  - question-open-ended
                  - question-rate-your-experience
                  - question-secret-access-code
                  - question-select-date
                  - question-select-from-images
                  - question-select-value-in-range
                  - question-select-from-list
                  - question-closed-ended
                  - question-vote
                  - spotify-follow
                  - spotify-listen
                  - spotify-save
                  - tiktok-follow
                  - tiktok-watch
                  - tiktok-post
                  - youtube-like
                  - youtube-comment
                  - youtube-subscribe
                  - action-completion
                  - skip-action
                  - 42-school
                  - api-auth-link
                  - api-token-link
                  - apple
                  - asgardeo
                  - atlassian
                  - auth0
                  - authentik
                  - azure-ad-b2c
                  - azure-ad
                  - azure-devops
                  - battlenet
                  - beyondidentity
                  - box
                  - boxyhq-saml
                  - bungie
                  - click-up
                  - cognito
                  - coinbase
                  - descope
                  - discord
                  - dribbble
                  - dropbox
                  - duende-identity-server6
                  - email
                  - eveonline
                  - facebook
                  - faceit
                  - foursquare
                  - freshbooks
                  - fusionauth
                  - github
                  - gitlab
                  - google
                  - hubspot
                  - identity-server4
                  - instagram
                  - kakao
                  - keycloak
                  - line
                  - linkedin
                  - mailchimp
                  - mailru
                  - mastodon
                  - mattermost
                  - medium
                  - naver
                  - netlify
                  - notion
                  - okta
                  - onelogin
                  - organisation-oidc
                  - osso
                  - osu
                  - passage
                  - patreon
                  - pinterest
                  - pipedrive
                  - reddit
                  - salesforce
                  - slack
                  - spotify
                  - strava
                  - tiktok
                  - todoist
                  - trakt
                  - twitch
                  - twitter
                  - united-effects
                  - vk
                  - wikimedia
                  - wordpress
                  - workos
                  - yandex
                  - youtube
                  - zitadel
                  - zoho
                  - zoom
                  - blog-comment
                  - blog-like
                  - blog-share
                  - blog-view
                  - challenge-started
                  - challenge-completion
                  - challenge-unlock
                  - community-visit
                  - parental-approval-requested
                  - parental-approval-approved
                  - parental-approval-rejected
                  - custom
                  - game-started
                  - game-completed
                  - leaderboard-finish
                  - invite-admin-user
                  - points-credit
                  - points-spend
                  - post-comment
                  - post-like
                  - post-view
                  - reward-redemption
                  - reward-allocation-purchase
                  - reward-giveaway-winner
                  - reward-claim
                  - reward-distribution
                  - manual-distribution
                  - referral-link-used
                  - shop-purchase
                  - share-challenge-details
                  - share-challenge-results
                  - share-community
                  - share-reward
                  - share-post
                  - share-profile
                  - share-anything
                  - streak-extended
                  - profile-picture-added
                  - bio-added
                  - variable-captured
                  - xp-gained
                  - xp-total
                  - xp-leaderboard-topper
              description: >-
                The Nudj platform events that trigger the streak to be extended
                for a user. For example, challenge completions.
            custom:
              type: array
              items:
                type: string
              description: >-
                The custom events that trigger the streak to be extended for a
                user.
          required:
            - platform
            - custom
        createdBy:
          type: string
          description: The admin user who created this streak config
        updatedBy:
          type: string
          description: The admin user who last updated this streak config
      required:
        - id
        - organisationId
        - isEnabled
        - triggerEvents
        - createdBy
        - updatedBy
      description: A streak config
      title: Streak Config
    error.BAD_REQUEST:
      type: object
      properties:
        message:
          type: string
          description: The error message
          example: Invalid input data
        code:
          type: string
          description: The error code
          example: BAD_REQUEST
        issues:
          type: array
          items:
            type: object
            properties:
              message:
                type: string
            required:
              - message
          description: An array of issues that were responsible for the error
          example: []
      required:
        - message
        - code
      title: Error
      description: The error information
      example:
        code: BAD_REQUEST
        message: Invalid input data
        issues: []
    error.NOT_FOUND:
      type: object
      properties:
        message:
          type: string
          description: The error message
          example: Not found
        code:
          type: string
          description: The error code
          example: NOT_FOUND
        issues:
          type: array
          items:
            type: object
            properties:
              message:
                type: string
            required:
              - message
          description: An array of issues that were responsible for the error
          example: []
      required:
        - message
        - code
      title: Error
      description: The error information
      example:
        code: NOT_FOUND
        message: Not found
        issues: []
    error.INTERNAL_SERVER_ERROR:
      type: object
      properties:
        message:
          type: string
          description: The error message
          example: Internal server error
        code:
          type: string
          description: The error code
          example: INTERNAL_SERVER_ERROR
        issues:
          type: array
          items:
            type: object
            properties:
              message:
                type: string
            required:
              - message
          description: An array of issues that were responsible for the error
          example: []
      required:
        - message
        - code
      title: Error
      description: The error information
      example:
        code: INTERNAL_SERVER_ERROR
        message: Internal server error
        issues: []
  securitySchemes:
    ApiToken:
      type: apiKey
      in: header
      name: x-api-token

````