API reference
Every Preset Bridge endpoint, grouped by resource.
Base URL
https://presetbridge.com
All endpoints are prefixed with /api.
Health check
/api/health
Returns service health status. No authentication required.
{
"status": "healthy",
"timestamp": "2026-03-14T12:00:00.000Z"
}
Authentication
/api/auth/login
Validate Neural DSP cloud credentials. Free
| Header | Value |
|---|---|
x-api-key | Your API key |
Content-Type | application/json |
{
"credentials": {
"email": "user@example.com",
"password": "..."
}
}
{ "success": true, "message": "Login successful" }
Account
All account endpoints require a Firebase ID token in the Authorization header.
/api/account/credits
Returns your current credit balance.
{ "credits": 250 }
/api/account/api-keys
Create a new API key.
{ "name": "My Store Key" }
{
"apiKeyId": "key_abc123",
"apiKey": "ndsp_live_xxxxxxxxxxxxxxxx",
"keyPreview": "ndsp_...x4f2"
}
/api/account/api-keys
List all your API keys.
{
"items": [
{
"id": "key_abc123",
"name": "My Store Key",
"keyPreview": "ndsp_...x4f2",
"createdAt": "Mar 14, 2026",
"isActive": true
}
]
}
/api/account/api-keys/:id/usage
Get usage statistics for a specific API key.
| Query param | Type | Default | Description |
|---|---|---|---|
days | number | 30 | Number of days to look back |
{
"totalRequests": 142,
"creditsUsed": 87,
"lastActivity": "2026-03-14T10:30:00Z",
"operationBreakdown": {
"presetShare": 8,
"follow": 3,
"login": 12
}
}
NDSP Credentials
Manage your stored Neural DSP cloud credentials. All endpoints require Firebase authentication.
/api/account/ndsp-credentials/status
Check if credentials are stored and their validation status.
/api/account/ndsp-credentials
Save or update your NDSP credentials. Free
{
"email": "ndsp-user@example.com",
"password": "your-ndsp-password"
}
/api/account/ndsp-credentials/validate
Validate your currently stored credentials against Cortex Cloud. Free
/api/account/ndsp-credentials
Permanently delete your stored credentials.
Store Integrations
Manage webhook integrations for your stores. All endpoints require Firebase authentication.
/api/account/store-integrations
List all your store integrations.
/api/account/store-integrations
Create a new store integration.
{
"name": "Shopify AU",
"provider": "shopify",
"apiKeyId": "key_abc123",
"webhookSecret": "the signing key copied from Shopify",
"usernameFieldKey": "ndsp_username",
"allowedOrderStatuses": ["paid"],
"itemMappings": [
{
"matchType": "sku",
"externalRef": "STORM-LEAD-V2",
"resourceType": "preset",
"resourceId": "abc123-preset-id"
}
]
}
For Shopify, webhookSecret is required and must be copied from that store’s webhook settings. WooCommerce and generic integrations omit it and receive a generated secret in the creation response.
/api/account/store-integrations/:id
Update an existing store integration, including its name, mappings, accepted statuses and Shopify signing key. The provider cannot be changed after creation.
/api/account/store-integrations/:id/rotate-secret
Rotate the generated webhook signing secret for a WooCommerce or generic integration. Shopify controls its signing key, so replace that key with PATCH instead.
/api/account/store-integrations/:id/deliveries
List delivery attempts for an integration.
| Query param | Type | Default | Description |
|---|---|---|---|
limit | number | 20 | Number of records to return |
/api/account/store-integrations/:id/deliveries/:deliveryId
Update a delivery's target NDSP username (for failed deliveries with incorrect usernames).
{ "targetUsername": "correct_username" }
/api/account/store-integrations/:id/deliveries/:deliveryId/retry
Retry a failed or waiting delivery.
/api/account/store-integrations/:id/deliveries/:deliveryId/invalidate
Stop retries and mark a queued, waiting or failed delivery invalid. The request body must contain a reason.
{ "reason": "Customer supplied an email address instead of a Cortex Cloud username." }
/api/account/store-integrations/:id/deliveries/:deliveryId/reopen
Reopen an invalidated delivery for review. Reopening does not start another delivery attempt.
Outbound webhook subscriptions
Manage signed delivery result callbacks. These endpoints require Firebase authentication.
/api/account/store-integrations/webhook-subscriptions
List outbound webhook subscriptions.
/api/account/store-integrations/webhook-subscriptions
Create an outbound webhook subscription. The full signing secret is returned once.
{
"name": "WooCommerce delivery results",
"url": "https://store.example/wp-json/preset-bridge/v1/delivery-events",
"enabledEvents": [
"delivery.completed",
"delivery.action_required",
"delivery.retry_scheduled",
"delivery.failed",
"delivery.ignored",
"delivery.invalidated",
"delivery.reopened"
],
"integrationIds": ["store-integration-id"],
"isActive": true
}
/api/account/store-integrations/webhook-subscriptions/:subscriptionId
Update a subscription’s name, target URL, enabled events, integration scope or active status.
/api/account/store-integrations/webhook-subscriptions/:subscriptionId/rotate-secret
Rotate the outbound signing secret. Update the receiving system before the next callback is sent.
/api/account/store-integrations/webhook-subscriptions/:subscriptionId/deliveries
List recent outbound delivery attempts and response codes for one subscription.
Webhooks
/api/webhooks/:provider/:integrationId
Receive order webhooks from store platforms. Authenticated via HMAC signature verification. See the Webhooks guide for payload formats.
Credit packs
List packs, check account credits, and create one-time Stripe Checkout sessions.
/api/account/credit-packs
List available credit packs and current operation costs. Public, no authentication required.
/api/account/credits
Get the authenticated account credit balance. Requires Firebase authentication.
/api/account/credits/checkout
Create a Stripe Checkout session for a credit pack. Requires Firebase authentication.
{
"packId": "growth",
"currency": "usd",
"successUrl": "https://yoursite.com/success",
"cancelUrl": "https://yoursite.com/cancel"
}
{
"sessionId": "cs_live_xxxxx",
"url": "https://checkout.stripe.com/c/pay/..."
}
Billing
Credit balance and pricing endpoints for API key clients.
/api/billing/balance
Get your current credit balance and rate limit info.
/api/billing/pricing
Get credit costs for all operations. Public, no authentication required.
Error responses
All errors follow a consistent format:
{
"error": {
"message": "Human-readable error description",
"code": "MACHINE_READABLE_CODE"
}
}
| Status | Code | Description |
|---|---|---|
400 | BAD_REQUEST | Invalid or missing request parameters |
401 | UNAUTHORIZED | Missing or invalid authentication |
403 | FORBIDDEN | Insufficient permissions |
404 | NOT_FOUND | Resource not found |
429 | RATE_LIMIT_EXCEEDED | Too many requests |
500 | INTERNAL_ERROR | Unexpected server error |