API reference

Every Cloud Bridge endpoint, grouped by resource.

Base URL

https://<your-project>.cloudfunctions.net

All endpoints are prefixed with /api.

Health check

GET /api/health

Returns service health status. No authentication required.

Response
{
  "status": "healthy",
  "timestamp": "2026-03-14T12:00:00.000Z"
}

Authentication

POST /api/auth/login

Validate Neural DSP cloud credentials. Free

HeaderValue
x-api-keyYour API key
Content-Typeapplication/json
Request body
{
  "credentials": {
    "email": "user@example.com",
    "password": "..."
  }
}
Response
{ "success": true, "message": "Login successful" }

Account

All account endpoints require a Firebase ID token in the Authorization header.

GET /api/account/credits

Returns your current credit balance.

Response
{ "credits": 250 }
POST /api/account/api-keys

Create a new API key.

Request body
{ "name": "My Store Key" }
Response
{
  "apiKeyId": "key_abc123",
  "apiKey": "ndsp_live_xxxxxxxxxxxxxxxx",
  "keyPreview": "ndsp_...x4f2"
}
GET /api/account/api-keys

List all your API keys.

Response
{
  "items": [
    {
      "id": "key_abc123",
      "name": "My Store Key",
      "keyPreview": "ndsp_...x4f2",
      "createdAt": "Mar 14, 2026",
      "isActive": true
    }
  ]
}
GET /api/account/api-keys/:id/usage

Get usage statistics for a specific API key.

Query paramTypeDefaultDescription
daysnumber30Number of days to look back
Response
{
  "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.

GET /api/account/ndsp-credentials/status

Check if credentials are stored and their validation status.

POST /api/account/ndsp-credentials

Save or update your NDSP credentials. Free

Request body
{
  "email": "ndsp-user@example.com",
  "password": "your-ndsp-password"
}
POST /api/account/ndsp-credentials/validate

Validate your currently stored credentials against Cortex Cloud. Free

DELETE /api/account/ndsp-credentials

Permanently delete your stored credentials.

Store Integrations

Manage webhook integrations for your stores. All endpoints require Firebase authentication.

GET /api/account/store-integrations

List all your store integrations.

POST /api/account/store-integrations

Create a new store integration.

Request body
{
  "name": "My Shopify Store",
  "provider": "shopify",
  "apiKeyId": "key_abc123",
  "itemMappings": [
    {
      "matchType": "sku",
      "externalRef": "STORM-LEAD-V2",
      "resourceType": "preset",
      "resourceId": "abc123-preset-id"
    }
  ]
}
PATCH /api/account/store-integrations/:id

Update an existing store integration (name, mappings, etc.).

POST /api/account/store-integrations/:id/rotate-secret

Rotate the webhook signing secret for an integration.

GET /api/account/store-integrations/:id/deliveries

List delivery attempts for an integration.

Query paramTypeDefaultDescription
limitnumber20Number of records to return
PATCH /api/account/store-integrations/:id/deliveries/:deliveryId

Update a delivery's target NDSP username (for failed deliveries with incorrect usernames).

Request body
{ "targetUsername": "correct_username" }
POST /api/account/store-integrations/:id/deliveries/:deliveryId/retry

Retry a failed or waiting delivery.

Webhooks

POST /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.

GET /api/account/credit-packs

List available credit packs and current operation costs. Public, no authentication required.

GET /api/account/credits

Get the authenticated account credit balance. Requires Firebase authentication.

POST /api/account/credits/checkout

Create a Stripe Checkout session for a credit pack. Requires Firebase authentication.

Request body
{
  "packId": "growth",
  "currency": "usd",
  "successUrl": "https://yoursite.com/success",
  "cancelUrl": "https://yoursite.com/cancel"
}
Response
{
  "sessionId": "cs_live_xxxxx",
  "url": "https://checkout.stripe.com/c/pay/..."
}

Billing

Credit balance and pricing endpoints for API key clients.

GET /api/billing/balance

Get your current credit balance and rate limit info.

GET /api/billing/pricing

Get credit costs for all operations. Public, no authentication required.

Error responses

All errors follow a consistent format:

Error response format
{
  "error": {
    "message": "Human-readable error description",
    "code": "MACHINE_READABLE_CODE"
  }
}
StatusCodeDescription
400BAD_REQUESTInvalid or missing request parameters
401UNAUTHORIZEDMissing or invalid authentication
403FORBIDDENInsufficient permissions
404NOT_FOUNDResource not found
429RATE_LIMIT_EXCEEDEDToo many requests
500INTERNAL_ERRORUnexpected server error