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

# Atualizar Preferências de Presentes

> Atualiza as preferências do usuário sobre recebimento de presentes

## Descrição

Atualiza as preferências do usuário sobre recebimento de presentes das missões.

## Request Body

<ParamField body="email" type="string" required>
  Email do leitor
</ParamField>

<ParamField body="wantsToReceiveTheGifts" type="string" required>
  Preferência de recebimento: NEVER\_REPLIED, DONT\_WANT, ou WANT
</ParamField>

## Response

<ResponseField name="success" type="boolean">
  Indica se a operação foi bem-sucedida
</ResponseField>

<ResponseField name="message" type="string">
  Mensagem informativa sobre o resultado
</ResponseField>

<ResponseField name="data" type="object">
  <Expandable title="properties">
    <ResponseField name="email" type="string">
      Email do usuário
    </ResponseField>

    <ResponseField name="previousPreference" type="string">
      Preferência anterior
    </ResponseField>

    <ResponseField name="newPreference" type="string">
      Nova preferência definida
    </ResponseField>

    <ResponseField name="updatedAt" type="string">
      Data e hora da atualização
    </ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```bash theme={null}
  curl --request POST \
    --url https://backend.testeswaffle.org/streaks/missions/preferences \
    --header 'Content-Type: application/json' \
    --data '{
      "email": "leitor@exemplo.com",
      "wantsToReceiveTheGifts": "WANT"
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json theme={null}
  {
    "success": true,
    "message": "Preferências de presentes atualizadas com sucesso",
    "data": {
      "email": "leitor@exemplo.com",
      "previousPreference": "NEVER_REPLIED",
      "newPreference": "WANT",
      "updatedAt": "2024-01-20T16:45:00Z"
    }
  }
  ```
</ResponseExample>

## Valores Aceitos

* **NEVER\_REPLIED**: Usuário nunca respondeu sobre preferências
* **DONT\_WANT**: Usuário não quer receber presentes físicos
* **WANT**: Usuário quer receber presentes físicos


## OpenAPI

````yaml POST /streaks/missions/preferences
openapi: 3.1.0
info:
  title: Streaks API
  description: API para gerenciamento de streaks e gamificação de leitura do the news
  version: 1.0.0
servers:
  - url: https://backend.testeswaffle.org
security:
  - bearerAuth: []
paths:
  /streaks/missions/preferences:
    post:
      tags:
        - Missions
      summary: Atualizar Preferências de Presentes
      description: Atualiza as preferências do usuário sobre recebimento de presentes
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - email
                - wantsToReceiveTheGifts
              properties:
                email:
                  type: string
                  format: email
                  description: Email do leitor
                wantsToReceiveTheGifts:
                  type: string
                  enum:
                    - NEVER_REPLIED
                    - DONT_WANT
                    - WANT
                  description: Preferência de recebimento
      responses:
        '200':
          description: Preferências atualizadas com sucesso
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  message:
                    type: string
                  data:
                    type: object
                    properties:
                      email:
                        type: string
                      previousPreference:
                        type: string
                      newPreference:
                        type: string
                      updatedAt:
                        type: string
                        format: date-time
      security: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````