curl -X PATCH https://api.postbuddy.nl/v1/templates/tpl_01J9Y2K8QF4T6W8Z0B2D4F6H8K/mapping-presets/mp_01J9Y2K8QF4T6W8Z0B2D4F6H8K \
-H "Authorization: Bearer $POSTBUDDY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Welcome card",
"headers": [
"Example"
],
"mapping": {
"key": "first_name"
}
}'
import { PostBuddyClient } from '@postbuddy/sdk';
const client = new PostBuddyClient({ apiKey: process.env.POSTBUDDY_API_KEY! });
const result = await client.mappingPresets.update('tpl_01J9Y2K8QF4T6W8Z0B2D4F6H8K', 'mp_01J9Y2K8QF4T6W8Z0B2D4F6H8K', {
body: {
name: 'Welcome card',
headers: [
'Example',
],
mapping: {
key: 'first_name',
},
},
});
import os
from postbuddy import Client
client = Client(os.environ["POSTBUDDY_API_KEY"])
result = client.mapping_presets.update("tpl_01J9Y2K8QF4T6W8Z0B2D4F6H8K", "mp_01J9Y2K8QF4T6W8Z0B2D4F6H8K", {
"name": "Welcome card",
"headers": [
"Example",
],
"mapping": {
"key": "first_name",
},
})
{
"id": "mp_01J9Y2K8QF4T6W8Z0B2D4F6H8K",
"templateId": "tpl_01J9Y2K8QF4T6W8Z0B2D4F6H8K",
"name": "Welcome card",
"headers": [
"Example"
],
"mapping": {
"key": "first_name"
},
"createdByType": "USER",
"createdById": "obj_01J9Y2K8QF4T6W8Z0B2D4F6H8K",
"lastUsedAt": "2026-10-16T09:14:02.000Z",
"createdAt": "2026-10-16T09:14:02.000Z",
"updatedAt": "2026-10-16T09:14:02.000Z"
}
{
"type": "https://docs.postbuddy.nl/errors/not_found",
"title": "Not found",
"status": 404,
"code": "not_found",
"detail": "Not found",
"requestId": "req_01J9Y2K8QF4T6W8Z0B2D4F6H8K"
}
{
"type": "https://docs.postbuddy.nl/errors/validation_failed",
"title": "Validation failed",
"status": 422,
"code": "validation_failed",
"detail": "Validation failed",
"requestId": "req_01J9Y2K8QF4T6W8Z0B2D4F6H8K",
"errors": [
{
"field": "recipient.postalCode",
"code": "invalid_string",
"message": "Invalid postal code"
}
]
}