ClientCasa
API

Inquiries (Lead Capture)

Submit a lead from your own website into a ClientCasa organization. A named-field endpoint — no form-field ids — that creates the lead, seeds the inbox, and sends the owner alert and visitor confirmation, exactly like a hosted ClientCasa form. The one write endpoint in the lead-capture flow; read the results back via Form Submissions.

POST /api/v1/inquiries captures a lead from an external website — your own contact/inquiry form, hosted anywhere — into a ClientCasa organization. It's the server-to-server counterpart of a hosted ClientCasa inquiry form: send a visitor's details from your backend and ClientCasa does the rest.

Use it when you build a site for a ClientCasa user and want their existing form to feed their CRM. Hold the API key on your server (never in the browser) and scope it to inquiries:write only — that key can submit leads and nothing else.

What a submission does

One call runs the full lead lifecycle, identical to a hosted form:

  • Creates the lead (a Client at status new) and its primary Contact, or matches an existing lead by email (returning visitors never create a duplicate).
  • Seeds the organization's inbox with the inquiry as an unread message.
  • Sends the owner alert and the visitor confirmation email.
  • Records an immutable form submission you can read back via Form Submissions (its source is external_api and it has no parent form — the answer schema travels with the submission).

The contract

Send named fields — there are no ClientCasa form-field ids to map. The role fields (name, email, phone, preferredDate, message) map onto the lead's Contact; everything in fields is captured by its label as an extra answer.

curl -X POST https://www.clientcasa.com/api/v1/inquiries \
  -H "x-api-key: $CLIENTCASA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Jane Doe",
    "email": "jane@example.com",
    "phone": "555-1212",
    "preferredDate": "2026-09-12",
    "message": "We are planning a fall wedding and love your work.",
    "fields": {
      "Event Type": "Wedding",
      "Venue": "The Grand Hall",
      "How did you hear about us?": "Instagram"
    }
  }'

With the TypeScript SDK:

import { ClientCasa } from '@clientcasa/sdk'

const cc = new ClientCasa({ apiKey: process.env.CLIENTCASA_API_KEY })

await cc.inquiries.create({
  name: 'Jane Doe',
  email: 'jane@example.com',
  phone: '555-1212',
  preferredDate: '2026-09-12',
  message: 'We are planning a fall wedding and love your work.',
  fields: { 'Event Type': 'Wedding', Venue: 'The Grand Hall' },
})

preferredDate is YYYY-MM-DD. The response returns the created/matched clientId, contactId, and submissionId so you can correlate or deep-link. Pass an Idempotency-Key to make retries safe.

POST
/api/v1/inquiries
x-api-key<token>

In: header

Header Parameters

Idempotency-Key?string

Optional unique key that makes this create safely retryable. Replaying the same key returns the original response instead of creating a duplicate; reusing a key with a different request body returns 409.

Lengthlength <= 255

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://www.clientcasa.com/api/v1/inquiries" \  -H "Content-Type: application/json" \  -d '{    "name": "Jane Doe",    "email": "jane@example.com"  }'
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "status": "received",
  "clientId": "550e8400-e29b-41d4-a716-446655440000",
  "contactId": "550e8400-e29b-41d4-a716-446655440000",
  "submissionId": "550e8400-e29b-41d4-a716-446655440000"
}
{
  "error": {
    "code": "unauthorized",
    "message": "string",
    "requestId": "string",
    "details": {
      "property1": null,
      "property2": null
    }
  }
}
{
  "error": {
    "code": "unauthorized",
    "message": "string",
    "requestId": "string",
    "details": {
      "property1": null,
      "property2": null
    }
  }
}
{
  "error": {
    "code": "unauthorized",
    "message": "string",
    "requestId": "string",
    "details": {
      "property1": null,
      "property2": null
    }
  }
}
{
  "error": {
    "code": "unauthorized",
    "message": "string",
    "requestId": "string",
    "details": {
      "property1": null,
      "property2": null
    }
  }
}
{
  "error": {
    "code": "unauthorized",
    "message": "string",
    "requestId": "string",
    "details": {
      "property1": null,
      "property2": null
    }
  }
}
{
  "error": {
    "code": "unauthorized",
    "message": "string",
    "requestId": "string",
    "details": {
      "property1": null,
      "property2": null
    }
  }
}

On this page