cURL
curl --request DELETE \
--url https://www.pierre.finance/tools/api/delete-spending-limit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"limitId": "<string>"
}
'import requests
url = "https://www.pierre.finance/tools/api/delete-spending-limit"
payload = { "limitId": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.delete(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({limitId: '<string>'})
};
fetch('https://www.pierre.finance/tools/api/delete-spending-limit', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://www.pierre.finance/tools/api/delete-spending-limit",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_POSTFIELDS => json_encode([
'limitId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://www.pierre.finance/tools/api/delete-spending-limit"
payload := strings.NewReader("{\n \"limitId\": \"<string>\"\n}")
req, _ := http.NewRequest("DELETE", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://www.pierre.finance/tools/api/delete-spending-limit")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"limitId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.pierre.finance/tools/api/delete-spending-limit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"limitId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Spending limit for \"Alimentação\" deleted successfully",
"deletedLimit": {
"id": "limit_123456789",
"category": "Alimentação",
"limitAmount": 1000.00,
"period": "monthly"
},
"timestamp": "2024-11-04T15:30:00Z"
}
Spending Limits
Delete Spending Limit
Exclui permanentemente um limite de gastos. O usuário só pode excluir seus próprios limites. Esta operação não pode ser desfeita. Requer API key para autenticação e assinatura ativa.
DELETE
/
tools
/
api
/
delete-spending-limit
cURL
curl --request DELETE \
--url https://www.pierre.finance/tools/api/delete-spending-limit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"limitId": "<string>"
}
'import requests
url = "https://www.pierre.finance/tools/api/delete-spending-limit"
payload = { "limitId": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.delete(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'DELETE',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({limitId: '<string>'})
};
fetch('https://www.pierre.finance/tools/api/delete-spending-limit', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://www.pierre.finance/tools/api/delete-spending-limit",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_POSTFIELDS => json_encode([
'limitId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://www.pierre.finance/tools/api/delete-spending-limit"
payload := strings.NewReader("{\n \"limitId\": \"<string>\"\n}")
req, _ := http.NewRequest("DELETE", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://www.pierre.finance/tools/api/delete-spending-limit")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"limitId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.pierre.finance/tools/api/delete-spending-limit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"limitId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Spending limit for \"Alimentação\" deleted successfully",
"deletedLimit": {
"id": "limit_123456789",
"category": "Alimentação",
"limitAmount": 1000.00,
"period": "monthly"
},
"timestamp": "2024-11-04T15:30:00Z"
}
Este endpoint deleta permanentemente um alerta de gastos existente.
Descrição
O endpointDELETE /tools/api/delete-spending-limit remove permanentemente um alerta de gastos do sistema. Esta ação não pode ser desfeita.
Autenticação
Este endpoint requer autenticação via Bearer token.string
required
Bearer token com a API key do usuário. Formato:
Bearer sk-your-api-key-hereParâmetros de Query
string
required
Parâmetro interno para indicar requisições via MCP. Use
s=s para requisições MCP.Body Parameters
string
required
ID do alerta a ser deletado
Resposta
Sucesso (200)
{
"success": true,
"message": "Spending limit for \"Alimentação\" deleted successfully",
"deletedLimit": {
"id": "limit_123456789",
"category": "Alimentação",
"limitAmount": 1000.00,
"period": "monthly"
},
"timestamp": "2024-11-04T15:30:00Z"
}
Erro de Validação (400)
{
"error": "Invalid or missing limitId",
"message": "limitId must be a non-empty string"
}
Erro de Autenticação (401)
{
"error": "Invalid or inactive API key",
"message": "Please check your API key and try again",
"type": "invalid_api_key"
}
Erro de Permissão (403)
{
"error": "Access denied",
"message": "You can only delete your own spending limits"
}
Erro - Alerta Não Encontrado (404)
{
"error": "Spending limit not found",
"message": "No spending limit found with ID: limit_123456789"
}
Campos da Resposta
boolean
required
Indica se a requisição foi bem-sucedida
string
required
Mensagem de confirmação da deleção
object
required
Objeto com informações básicas do alerta deletado
string
required
Timestamp da requisição em formato ISO 8601
Exemplos de Uso
cURL
# Deletar um alerta
curl -X DELETE 'https://www.pierre.finance/tools/api/delete-spending-limit' \
-H 'Authorization: Bearer sk-your-api-key-here' \
-H 'Content-Type: application/json' \
-d '{
"limitId": "limit_123456789"
}'
JavaScript
const API_KEY = 'sk-your-api-key-here';
const BASE_URL = 'https://www.pierre.finance/tools/api';
async function deleteSpendingLimit(limitId) {
const response = await fetch(`${BASE_URL}/delete-spending-limit`, {
method: 'DELETE',
headers: {
'Authorization': `Bearer ${API_KEY}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({ limitId })
});
return await response.json();
}
// Exemplo de uso
deleteSpendingLimit('limit_123456789');
Python
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 delete_spending_limit(limit_id):
data = {'limitId': limit_id}
response = requests.delete(f'{BASE_URL}/delete-spending-limit',
headers=headers, json=data)
return response.json()
# Exemplo de uso
result = delete_spending_limit('limit_123456789')
print(result['message'])
Códigos de Status
200: Sucesso - Alerta deletado400: limitId inválido ou ausente401: Erro de autenticação403: Acesso negado - alerta pertence a outro usuário404: Alerta não encontrado500: Erro interno do servidor
Esta ação é irreversível! Uma vez deletado, o alerta não pode ser recuperado. Todos os dados relacionados ao histórico de alertas também serão removidos. Se você deseja apenas pausar temporariamente um alerta, considere usar o endpoint
update-spending-limit com isActive: false ao invés de deletar.Você só pode deletar alertas que pertencem ao seu usuário. Tentar deletar alertas de outros usuários resultará em erro 403 (Access denied).
Após deletar um alerta, o slot na quota do seu plano fica disponível imediatamente para criar um novo alerta.
Authorizations
API key in Bearer token format. Example: Bearer sk-your-api-key-here
Body
application/json
ID do limite de gastos a ser excluído

