trackResponse()

Creates a response inside EnterestOS.

2 minPrerequisites: Client created

Problem: You have a client but are not sure what parameters trackResponse() requires or how the response object looks.

Solution: Pass a type string and a payload object — both required. Metadata is optional.

Signature

typescript
trackResponse(input: {
  type: string;                    // Required: response label
  payload: Record<string, any>;   // Required: form data
  metadata?: Record<string, any>; // Optional: page URL, source, etc.
}): Promise<Response>

Example

typescript
const response = await enterestos.trackResponse({
  type: 'demo_request',
  payload: {
    name: 'John Doe',
    email: '[email protected]',
    company: 'Acme Inc'
  },
  metadata: {
    pageUrl: '/pricing',
    source: 'pricing_page'
  }
});

console.log(response.id);     // 'resp_abc123'
console.log(response.status); // 'reply'

Lifecycle Rule

Every submission is created with status reply automatically. You cannot override this — a submission exists because someone showed interest and has not yet been contacted.

Result: The submission is now in your Inbox with status Reply.

Common Questions

How do I send a submission to EnterestOS?

Call trackResponse() with a type string and a payload object containing your form data. Metadata is optional. The submission appears in your Inbox as Reply immediately.

Why can I not set status to completed when creating a submission?

All responses start as Reply by design. A response exists because someone showed interest and has not yet been contacted. The lifecycle enforces that you respond before marking anything done.