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

# Update Goal Status

> Update the status of a goal. The possible values for the status of a goal are `completed`, `in progress`, or `failed`. Returns an empty object when the jwtToken provided is invalid.



## OpenAPI

````yaml post /update-goal-status
openapi: 3.1.0
info:
  title: DolphinFlashcardApp API
  version: '1.0'
  summary: Manage flashcards
  description: >-
    Set up user accounts, create or manage flashcards, set learning goals, and
    track performances with user's heatmap and streak data. Data is available in
    JSON format only. <br></br>**Note**: All parameters are case-sensitive.
    Request body parameters are required, but the query parameters are
    optional. 
  contact:
    name: Dolphin Flashcards
    url: https://dolphinflashcards.com/contact
    email: dolphinflashcards@outlook.com
  license:
    name: MIT
    url: https://github.com/jacob-macleod/Dolphin-Flashcard-App/blob/main/LICENSE
servers:
  - url: http://dolphinflashcards.com/api
    description: baseurl
security: []
tags:
  - name: Account
    description: Groups the endpoints required to create an account.
  - name: Card management
    description: Groups the endpoints required to create and manage flashcards.
  - name: Goal
    description: Groups the endpoints required to create and manage goals.
  - name: Statistics
    description: Groups the endpoints required to track heatmap and streak.
paths:
  /update-goal-status:
    post:
      tags:
        - Goal
      summary: Update Goal Status
      description: >-
        Update the status of a goal. The possible values for the status of a
        goal are `completed`, `in progress`, or `failed`. Returns an empty
        object when the jwtToken provided is invalid.
      operationId: post-update-goal-status
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - jwtToken
              properties:
                jwtToken:
                  type: string
                  x-stoplight:
                    id: z79bhm434n5vx
                  description: An identifier for the user who is updating the goal status.
                  example: >-
                    eyJ0eXAiOiJKV1QiLCJhbGciOiJFUzI1NiIsImtpZCI6ImEzMmZkZDRiMTQ2Njc3NzE5YWIyMzcyODYxYmRlZDg5In0.eyJpc3MiOiJodHRwOi8vZG9scGhpbmZsYXNoY2FyZHMuY29tIiwiYXVkIjoiYXBpIiwic3ViIjoidU5RR2lIencxdk9EaExybTVDRWtaQ1ZoTU93MSIsImFjY2Vzc190b2tlbiI6IjRiZTA2NDNmLTFkOTgtNTczYi05N2NkLWNhOThhNjUzNDdkZCIsImFjY2Vzc190b2tlbl9yYXciOiJ0ZXN0IiwiaWF0IjoxNzI2Nzc0MTYzfQ.F-fxFitPQF-gGHyhGPGxE_zj_b8XJybqe4J_iYG66BC4Dqm4LTb8RpcDLyYUhRCcpphihpWGbdp
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                x-examples:
                  Example 1:
                    '27730416841422320452490899630401426960300250535420717368523585221911685508588':
                      data:
                        cards_revised_so_far: '0'
                        cards_to_revise: '4'
                      end_date: 30/07/2024
                      fail_date: ''
                      status: in progress
                      title: Revise 4 cards by 07/07/2024
                      type: Card
                    '46882192866017507647804408894345572659406282731228567391554804537877046919642':
                      data:
                        goal_xp: '60'
                        start_date: 15/07/2024
                        starting_xp: '0'
                      end_date: 30/07/2024
                      fail_date: ''
                      status: in progress
                      title: Gain 60 XP by 30/07/2024
                      type: XP
                properties:
                  goalID-1:
                    type: object
                    x-stoplight:
                      id: vp5tii3oejq4d
                    description: 'A unique identifier or key associated with each goal. '
                    properties:
                      data:
                        type: object
                        description: ' An object containing goal-specific metrics, such as `goal_xp`, `start_date`, and `starting_xp` for XP goals or `cards_to_revise` and `cards_revised_so_far` for card goals '
                        properties:
                          cards_revised_so_far:
                            type: string
                            description: >-
                              Associated with card goals, this indicates the
                              number of cards revised so far.
                            example: '0'
                          cards_to_revise:
                            type: string
                            description: >-
                              Associated with card goals, this specifies the
                              total number of cards to be revised.
                            example: '4'
                      end_date:
                        type: string
                        example: 30/07/2024
                        description: >-
                          The date by which the current goal must end, in
                          dd/mm/yyyy format.
                      fail_date:
                        type: string
                        example: '" "'
                        description: >-
                          The date on which the goal's status changed to
                          'failed'. This field is only populated if the goal
                          fails; otherwise, it is an empty string.
                      status:
                        type: string
                        example: in progress
                        description: >-
                          The current status of a goal, which can be either
                          `completed`, `in progress`, or `failed`.
                      title:
                        type: string
                        example: Revise 4 cards by 15/07/2024
                        description: 'The name assigned to a goal. '
                      type:
                        type: string
                        example: Card
                        description: ' The nature of a goal. Goals can either be of type `Card` or `XP`. '
                  goalID-2:
                    type: object
                    x-stoplight:
                      id: 4f9jwlnkfq031
                    description: 'A unique identifier or key associated with each goal. '
                    properties:
                      data:
                        type: object
                        description: ' An object containing goal-specific metrics, such as `goal_xp`, `start_date`, and `starting_xp` for XP goals or `cards_to_revise` and `cards_revised_so_far` for card goals '
                        properties:
                          goal_xp:
                            type: string
                            description: >-
                              Associated with XP goals, this specifies the
                              target amount of experience points (XP) the user
                              aims to achieve.
                            example: '60'
                          start_date:
                            type: string
                            description: ' Associated with XP goals, this indicates the date when the XP goal began. '
                            example: 15/07/2024
                          starting_xp:
                            type: string
                            description: >-
                              Associated with XP goals, this indicates the
                              initial amount of experience points (XP) at the
                              beginning of the goal.
                            example: '0'
                      end_date:
                        type: string
                        example: 30/07/2024
                        description: >-
                          The date by which the current goal must end, in
                          dd/mm/yyyy format.
                      fail_date:
                        type: string
                        description: >-
                          The date on which the goal's status changed to
                          'failed'. This field is only populated if the goal
                          fails; otherwise, it is an empty string.
                        example: ' " "'
                      status:
                        type: string
                        example: in progress
                        description: >-
                          The current status of a goal, which can be either
                          `completed`, `in progress`, or `failed`.
                      title:
                        type: string
                        description: 'The name assigned to a goal. '
                        example: Gain 60 XP by 30/07/2024
                      type:
                        type: string
                        description: ' The nature of a goal. Goals can either be of type `Card` or `XP`. '
                        example: XP
        '400':
          description: >-
            A bad request error. Returned when the request body parameter is not
            in the expected JSON format.
          content:
            application/json:
              schema:
                type: object
                x-examples:
                  Example 1:
                    error: >-
                      Your supplied json keys do not match the expected format.
                      The request should be in the format: {'jwtToken':
                      'string'}
                properties:
                  error:
                    type: string
                    example: >-
                      Your supplied json keys do not match the expected format.
                      The request should be in the format: {'jwtToken': ' '} 
                    description: >-
                      Describes the nature of the error and provides a possible
                      solution.

````