API Reference

Objects and arrays are fundamental data structures in JavaScript. Objects store data in key-value pairs, while arrays hold ordered collections of values.

SketricGen Agent Response API

Overview

The SketricGen Agent Response API allows you to send messages to your SketricGen AI agents and receive AI-powered responses. This API enables seamless integration between your applications and SketricGen conversational AI.

Base Information

  • EndpointPOST https://api.sketricgen.ai/v1/agent-response

  • Authentication: API Key + User ID

  • Content Typeapplication/json

  • Method: POST

Authentication

All requests must include authentication headers:

Header

Type

Required

Description

X-API-KEY

string

User’s API key for authentication

X-USER-ID

string

User’s UUID for identification

Request Schema

Headers

{
  "X-API-KEY": "your_api_key_here",
  "X-USER-ID": "your_user_uuid_here",
  "Content-Type": "application/json"
}

Accessing Object Properties

{
  "message": "string",
  "agent_id": "string",
  "contact_id": "string" // optional
}

Parameters

Parameter

Type

Required

Description

message

string

The user’s message text to process

agent_id

string

SketricGen agent identifier

contact_id

string

Unique identifier for the contact/conversation. If not provided, a random ID will be generated

Response Schema

Success Response (200)

{
  "success": true,
  "agent_response": "Hello! I'd be happy to help you with your order. Could you please provide me with your order number?",
  "contact_id": "customer_67890"
}

Response Fields

Field

Type

Description

success

boolean

Indicates if the request was successful

agent_response

string

AI-generated response from your SketricGen agent

contact_id

string

Contact identifier for conversation continuity

Error Responses

Authentication Required (401)

{
  "success": false,
  "message": "Authentication failed"
}

Invalid Request (400)

{
  "success": false,
  "message": "Missing required parameters"
}

Testing

cURL Example

curl -X POST https://api.sketricgen.ai/v1/agent-response \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: your_api_key_here" \
  -H "X-USER-ID: your_user_uuid_here" \
  -d '{
    "message": "Hello, I need help with my order",
    "agent_id": "agent_12345",
    "contact_id": "customer_67890"
  }'

Getting Started

1. Obtain API Credentials

  • Get your API key from your SketricGen dashboard

  • Note your User ID from your account settings

2. Set Up Your Agent

  • Create and configure your AI agent in the SketricGen platform

  • Note the agent_id for API calls