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 agentId = "ag_Lad8YCGGiDLiqIZPWRXmc2ix";
const { interaction } = await proficient.interactions.create({ agentId });
{
"interaction": {
"id": "<string>",
"object": "interaction",
"agent_id": "<string>",
"archived": true,
"created_at": 123,
"initial_turn": "user",
"name": "<string>",
"total_message_count": 123,
"updated_at": 123,
"user_id": "<string>"
},
"messages": [
{
"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>"
}
}Interactions
Create an interaction
Creates a new Interaction with an agent.
POST
/
interactions
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 agentId = "ag_Lad8YCGGiDLiqIZPWRXmc2ix";
const { interaction } = await proficient.interactions.create({ agentId });
{
"interaction": {
"id": "<string>",
"object": "interaction",
"agent_id": "<string>",
"archived": true,
"created_at": 123,
"initial_turn": "user",
"name": "<string>",
"total_message_count": 123,
"updated_at": 123,
"user_id": "<string>"
},
"messages": [
{
"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>"
}
}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 agentId = "ag_Lad8YCGGiDLiqIZPWRXmc2ix";
const { interaction } = await proficient.interactions.create({ agentId });
Authorizations
Body
application/json
The data with which an interaction is created.
The unique identifier of the agent
Response
An object that contains the initial interaction data including the Interaction object itself and the initial messages associated with it.

