import { ProficientClient } from "@proficient/client";
const proficient = new ProficientClient({
apiKey: process.env.PROFICIENT_AI_PUBLISHABLE_KEY,
userExternalId: "...", // The user's unique ID in your system
});
const interactionId = "int_53mfKtX0Da6zaJCp5bNnzxDaEg1xptWvQDr2";
const message = await proficient.messages.create({
interactionId,
content: "Hello! Tell me something about Anaximander.",
});
{
"id": "<string>",
"object": "message",
"content": "<string>",
"created_at": 123,
"depth": 123,
"interaction_id": "<string>",
"sent_by": "user",
"parent_id": "<string>"
}{
"error": {
"code": "invalid_request",
"message": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>"
}
}Messages
Create a message in an interaction
Creates a new Message in a given Interaction
POST
/
messages
import { ProficientClient } from "@proficient/client";
const proficient = new ProficientClient({
apiKey: process.env.PROFICIENT_AI_PUBLISHABLE_KEY,
userExternalId: "...", // The user's unique ID in your system
});
const interactionId = "int_53mfKtX0Da6zaJCp5bNnzxDaEg1xptWvQDr2";
const message = await proficient.messages.create({
interactionId,
content: "Hello! Tell me something about Anaximander.",
});
{
"id": "<string>",
"object": "message",
"content": "<string>",
"created_at": 123,
"depth": 123,
"interaction_id": "<string>",
"sent_by": "user",
"parent_id": "<string>"
}{
"error": {
"code": "invalid_request",
"message": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>"
}
}import { ProficientClient } from "@proficient/client";
const proficient = new ProficientClient({
apiKey: process.env.PROFICIENT_AI_PUBLISHABLE_KEY,
userExternalId: "...", // The user's unique ID in your system
});
const interactionId = "int_53mfKtX0Da6zaJCp5bNnzxDaEg1xptWvQDr2";
const message = await proficient.messages.create({
interactionId,
content: "Hello! Tell me something about Anaximander.",
});
Body
application/json
Response
Each interaction holds a number of messages and every message belongs to an interaction. The `sent_by` property of a message indicates whether a message was created by an agent or a user.

