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

# Update Payment Reminder

> Atualiza um lembrete de pagamento existente. Permite modificar título, valor, datas, padrão de recorrência e status. O usuário só pode atualizar seus próprios lembretes. Requer API key para autenticação e assinatura ativa.

> [!NOTE]
>
> Este endpoint atualiza um lembrete de pagamento existente.

## Descrição

O endpoint `PUT /tools/api/update-payment-reminder` permite modificar título, valor, datas, padrão de recorrência e status de lembretes de pagamento. O usuário só pode atualizar seus próprios lembretes.

## Autenticação

Este endpoint requer autenticação via Bearer token.

**Authorization** `string` *required*

Bearer token com a API key do usuário. Formato: `Bearer sk-your-api-key-here`

## Parâmetros de Query

**s** `string` *required*

Parâmetro interno para indicar requisições via MCP. Use `s=s` para requisições MCP.

## Body Parameters

**reminderId** `string` *required*

ID do lembrete a ser atualizado

**title** `string`

Novo título do lembrete (opcional)

**amount** `number`

Novo valor do pagamento em BRL (opcional)

**dueDate** `string`

Nova data de vencimento no formato YYYY-MM-DD (opcional)

**reminderTime** `string`

Nova data/hora do lembrete em formato ISO 8601 (opcional)

**recurrenceTime** `string`

Novo horário de recorrência (ex: '8h', '14h30') (opcional)

**newStatus** `string`

Novo status: `active`, `completed`, ou `inactive` (opcional)

## Resposta

### Sucesso (200)

```json Success theme={null}
{
  "success": true,
  "data": {
    "id": "pr_123456789",
    "title": "Conta de luz - Residência",
    "amount": 180.00,
    "dueDate": "2024-12-20",
    "reminderTime": "2024-12-19T09:00:00Z",
    "recurrenceTime": "9h",
    "status": "active",
    "isRecurring": false,
    "recurrencePattern": null,
    "createdAt": "2024-11-20T10:00:00Z",
    "updatedAt": "2024-11-27T16:00:00Z"
  },
  "message": "Payment reminder updated successfully",
  "timestamp": "2024-11-27T16:00:00Z"
}
```

### Erro de Validação (400)

```json Error - Missing ID theme={null}
{
  "error": "Invalid or missing reminderId",
  "message": "reminderId must be provided"
}
```

```json Error - Invalid Date theme={null}
{
  "error": "Invalid dueDate format",
  "message": "dueDate must be in YYYY-MM-DD format"
}
```

### Erro de Autenticação (401)

```json Error theme={null}
{
  "error": "Invalid or inactive API key",
  "message": "Please check your API key and try again",
  "type": "invalid_api_key"
}
```

### Erro de Acesso (403)

```json Error theme={null}
{
  "error": "Unauthorized",
  "message": "You do not have permission to update this reminder"
}
```

### Lembrete Não Encontrado (404)

```json Error theme={null}
{
  "error": "Reminder not found",
  "message": "No reminder found with ID: pr_123456789"
}
```

## Campos da Resposta

**success** `boolean` *required*

Indica se a requisição foi bem-sucedida

**data** `object` *required*

Objeto com os dados atualizados do lembrete

**Payment Reminder Object**

**id** `string` *required*

Identificador único do lembrete

**title** `string` *required*

Título atualizado do lembrete

**amount** `number`

Valor atualizado do pagamento em BRL

**dueDate** `string`

Data de vencimento atualizada (YYYY-MM-DD)

**reminderTime** `string`

Data/hora atualizada do lembrete (ISO 8601)

**recurrenceTime** `string`

Horário de recorrência atualizado

**status** `string` *required*

Status atualizado: `active`, `completed`, ou `inactive`

**isRecurring** `boolean` *required*

Se o lembrete é recorrente

**recurrencePattern** `string`

Padrão de recorrência

**createdAt** `string` *required*

Data de criação original (ISO 8601)

**updatedAt** `string` *required*

Data da última atualização (ISO 8601)

**message** `string` *required*

Mensagem de confirmação da atualização

**timestamp** `string` *required*

Timestamp da requisição em formato ISO 8601

## Exemplos de Uso

### cURL

```bash theme={null}
# Atualizar título e valor
curl -X PUT 'https://www.pierre.finance/tools/api/update-payment-reminder' \
  -H 'Authorization: Bearer sk-your-api-key-here' \
  -H 'Content-Type: application/json' \
  -d '{
    "reminderId": "pr_123456789",
    "title": "Conta de luz - Residência",
    "amount": 180.00
  }'

# Atualizar data de vencimento
curl -X PUT 'https://www.pierre.finance/tools/api/update-payment-reminder' \
  -H 'Authorization: Bearer sk-your-api-key-here' \
  -H 'Content-Type: application/json' \
  -d '{
    "reminderId": "pr_123456789",
    "dueDate": "2024-12-20"
  }'

# Marcar como completado
curl -X PUT 'https://www.pierre.finance/tools/api/update-payment-reminder' \
  -H 'Authorization: Bearer sk-your-api-key-here' \
  -H 'Content-Type: application/json' \
  -d '{
    "reminderId": "pr_123456789",
    "newStatus": "completed"
  }'
```

### JavaScript

```javascript theme={null}
const API_KEY = 'sk-your-api-key-here';
const BASE_URL = 'https://www.pierre.finance/tools/api';

async function updatePaymentReminder(reminderId, updates) {
  const response = await fetch(`${BASE_URL}/update-payment-reminder`, {
    method: 'PUT',
    headers: {
      'Authorization': `Bearer ${API_KEY}`,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({ reminderId, ...updates })
  });
  
  return await response.json();
}

// Exemplos de uso
updatePaymentReminder('pr_123456789', { 
  title: 'Conta de luz - Residência',
  amount: 180 
});

updatePaymentReminder('pr_123456789', { 
  dueDate: '2024-12-20' 
});

updatePaymentReminder('pr_123456789', { 
  newStatus: 'completed' 
});
```

### Python

```python theme={null}
import requests

API_KEY = 'sk-your-api-key-here'
BASE_URL = 'https://www.pierre.finance/tools/api'

headers = {
    'Authorization': f'Bearer {API_KEY}',
    'Content-Type': 'application/json'
}

def update_payment_reminder(reminder_id, **updates):
    data = {'reminderId': reminder_id, **updates}
    response = requests.put(f'{BASE_URL}/update-payment-reminder',
                           headers=headers, json=data)
    return response.json()

# Exemplos de uso
update_payment_reminder('pr_123456789', 
                       title='Conta de luz - Residência',
                       amount=180)

update_payment_reminder('pr_123456789', 
                       dueDate='2024-12-20')

update_payment_reminder('pr_123456789', 
                       newStatus='completed')
```

## Códigos de Status

* `200`: Sucesso - Lembrete atualizado
* `400`: Parâmetros inválidos
* `401`: Erro de autenticação ou assinatura
* `403`: Acesso negado - lembrete pertence a outro usuário
* `404`: Lembrete não encontrado
* `500`: Erro interno do servidor

## Status Disponíveis

* **active**: Lembrete ativo e enviando notificações
* **completed**: Pagamento realizado, lembrete completado
* **inactive**: Lembrete desativado, não envia notificações

> [!NOTE]
>
> Ao marcar um lembrete como `completed`, ele não conta mais para o limite de quota do plano. Lembretes recorrentes são renovados automaticamente mesmo após completados.

> [!TIP]
>
> Use `newStatus: 'inactive'` para pausar temporariamente um lembrete sem excluí-lo. Você pode reativá-lo depois alterando o status para `active`.


## OpenAPI

````yaml PUT /tools/api/update-payment-reminder
openapi: 3.1.0
info:
  title: Pierre Finance API
  description: >-
    API para acessar dados financeiros do Pierre Finance, incluindo contas,
    transações, parcelas e sincronização.
  version: v1.0.0
servers:
  - url: https://www.pierre.finance
security: []
tags:
  - name: Authentication
    description: API key management and authentication
  - name: Accounts
    description: Financial accounts management
  - name: Transactions
    description: Financial transactions
  - name: Installments
    description: Credit card installments and purchases
  - name: Bills
    description: Credit card bills and current bill summaries
  - name: Balance
    description: Account balance information
  - name: Closing Dates
    description: Credit card closing date management
  - name: Sync
    description: Account synchronization
  - name: Spending Limits
    description: Personal spending limits and alerts management
  - name: Payment Reminders
    description: Payment reminders management with WhatsApp and Email notifications
  - name: Analytics
    description: Financial analytics and insights
  - name: Memories
    description: User memory management for personalized AI interactions
  - name: Open Finance
    description: Open Finance connection and integration
paths:
  /tools/api/update-payment-reminder:
    put:
      tags:
        - Payment Reminders
      description: >-
        Atualiza um lembrete de pagamento existente. Permite modificar título,
        valor, datas, padrão de recorrência e status. O usuário só pode
        atualizar seus próprios lembretes. Requer API key para autenticação e
        assinatura ativa.
      operationId: updatePaymentReminder
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdatePaymentReminderRequest'
      responses:
        '200':
          description: Lembrete de pagamento atualizado com sucesso
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    $ref: '#/components/schemas/PaymentReminder'
                  message:
                    type: string
                    example: Payment reminder updated successfully
                  timestamp:
                    type: string
                    format: date-time
        '400':
          description: Parâmetros inválidos
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: Invalid or missing reminderId
                  message:
                    type: string
        '401':
          $ref: '#/components/responses/AuthError'
        '403':
          description: Acesso negado
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: Unauthorized
                  message:
                    type: string
                    example: You do not have permission to update this reminder
        '404':
          description: Lembrete não encontrado
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: Reminder not found
                  message:
                    type: string
        '500':
          $ref: '#/components/responses/ServerError'
      security:
        - BearerAuth: []
components:
  schemas:
    UpdatePaymentReminderRequest:
      type: object
      required:
        - reminderId
      properties:
        reminderId:
          type: string
        title:
          type: string
        amount:
          type: number
        dueDate:
          type: string
          format: date
        reminderTime:
          type: string
          format: date-time
        newStatus:
          type: string
          enum:
            - active
            - completed
            - inactive
    PaymentReminder:
      type: object
      properties:
        id:
          type: string
        title:
          type: string
        amount:
          type: number
          nullable: true
        dueDate:
          type: string
          format: date
          nullable: true
        reminderTime:
          type: string
          format: date-time
          nullable: true
        status:
          type: string
          enum:
            - active
            - completed
            - inactive
        isRecurring:
          type: boolean
        recurrencePattern:
          type: string
          nullable: true
        createdAt:
          type: string
          format: date-time
    AuthError: {}
    ServerError: {}
  responses:
    AuthError:
      description: Authentication or subscription error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AuthError'
    ServerError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ServerError'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: string
      description: 'API key in Bearer token format. Example: Bearer sk-your-api-key-here'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.