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

# Update citizen notification preferences

> Update notification preferences for a citizen (global and/or category opt-ins)



## OpenAPI

````yaml https://raw.githubusercontent.com/prefeitura-rio/app-rmi/refs/heads/main/docs/openapi-v3.json put /citizen/{cpf}/notification-preferences
openapi: 3.0.0
info:
  description: >-
    API para gerenciamento de dados de cidadãos do Rio de Janeiro, incluindo
    autodeclaração de informações e verificação de contato.
  title: API RMI
  termsOfService: http://swagger.io/terms/
  contact:
    name: Suporte RMI
    url: http://www.rio.rj.gov.br
    email: suporte@rio.rj.gov.br
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  version: '1.0'
servers:
  - url: https://services.pref.rio/rmi/v1
    description: Production
  - url: https://services.staging.app.dados.rio/rmi/v1
    description: Staging
security: []
tags:
  - description: >-
      Operações relacionadas a cidadãos, incluindo consulta e atualização de
      dados autodeclarados
    name: citizen
  - description: Operações relacionadas a departamentos/unidades administrativas (UA)
    name: departments
  - description: Gerenciamento de categorias de notificação (admin) e listagem pública
    name: notification-categories
  - description: Gerenciamento de preferências de notificação por CPF e telefone
    name: notification-preferences
  - description: Operações de verificação de saúde da API
    name: health
paths:
  /citizen/{cpf}/notification-preferences:
    put:
      tags:
        - notification-preferences
      summary: Update citizen notification preferences
      description: >-
        Update notification preferences for a citizen (global and/or category
        opt-ins)
      parameters:
        - description: CPF number
          name: cpf
          in: path
          required: true
          schema:
            type: string
      requestBody:
        $ref: '#/components/requestBodies/models.UpdateNotificationPreferencesRequest'
      responses:
        '200':
          description: Preferences updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/models.NotificationPreferencesResponse'
        '400':
          description: Invalid CPF format or request body
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/handlers.ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/handlers.ErrorResponse'
        '403':
          description: Access denied
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/handlers.ErrorResponse'
        '422':
          description: Invalid category ID
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/handlers.ErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/handlers.ErrorResponse'
      security:
        - bearerAuth: []
components:
  requestBodies:
    models.UpdateNotificationPreferencesRequest:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/models.UpdateNotificationPreferencesRequest'
      description: Updated preferences
      required: true
  schemas:
    models.NotificationPreferencesResponse:
      type: object
      properties:
        category_opt_ins:
          type: object
          additionalProperties:
            type: boolean
        cpf:
          type: string
        opt_in:
          type: boolean
        updated_at:
          type: string
    handlers.ErrorResponse:
      type: object
      properties:
        error:
          type: string
    models.UpdateNotificationPreferencesRequest:
      type: object
      required:
        - channel
      properties:
        category_opt_ins:
          type: object
          additionalProperties:
            type: boolean
        channel:
          type: string
        opt_in:
          type: boolean
        reason:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````