Box Developer Documentation

A beta version of the new Box developer documentation site is launching soon! Updated Developer Guides, modern API Reference, and AI-powered search are on the way to help you build with Box faster. Stay tuned for more updates.

Create agents

Create agents

Box AI Studio is available only for Enterprise Advanced accounts.

The POST /2.0/ai_agents endpoint allows you to create a new, custom AI agent.

Send a request

To send a request, use the POST /2.0/ai_agents endpoint.

Make sure you have generated the developer token to authorize your app. See getting started with Box AI for details.

Node/TypeScript v10
await client.aiStudio.createAiAgent({
  name: agentName,
  accessState: 'enabled',
  ask: new AiStudioAgentAsk({ accessState: 'enabled', description: 'desc1' }),
} satisfies CreateAiAgentInput);
Python v10
client.ai_studio.create_ai_agent(
    agent_name,
    "enabled",
    ask=AiStudioAgentAsk(access_state="enabled", description="desc1"),
)
.NET v10
await client.AiStudio.CreateAiAgentAsync(requestBody: new CreateAiAgent(name: agentName, accessState: "enabled") { Ask = new AiStudioAgentAsk(accessState: "enabled", description: "desc1") });
Swift v10
try await client.aiStudio.createAiAgent(requestBody: CreateAiAgent(name: agentName, accessState: "enabled", ask: AiStudioAgentAsk(accessState: "enabled", description: "desc1")))
Java v10
client.getAiStudio().createAiAgent(new CreateAiAgent.Builder(agentName, "enabled").ask(new AiStudioAgentAsk("enabled", "desc1")).build())

Parameters

To make a call, you must pass the following parameters. Mandatory parameters are in bold.

ParameterDescriptionExample
typeThe type of agent used to handle queries.ai_agent
nameThe name of the AI Agent.My AI Agent
access_stateThe state of the AI Agent. Value is one of enabled disabled.enabled
icon_referenceThe icon reference of the AI Agent. It should have format of the URL https://cdn01.boxcdn.net/app-assets/aistudio/avatars/<file_name> , where the possible values of file_name are: logo_boxAi.png,logo_stamp.png, logo_legal.png,logo_finance.png,logo_config.png,logo_handshake.png logo_analytics.png,logo_classification.png.https://cdn01.boxcdn.net/app-assets/aistudio/avatars/logo_analytics.svg
allowed_entitiesList of allowed users or groups.
askThe AI Agent to be used for ask.ask
extractThe AI Agent to be used for extraction.
text_genThe AI agent used for generating text.