Documentación
superleads.mx

Agent Studio

Referencia de la API · ☕ 10 min de lectura
Actualizado el 19 Jun 2026

Agent Studio APIs

Documentation for Agent Studio APIs

Servidor base: https://services.leadconnectorhq.com

Endpoints


POST /agent-studio/agent

Crear agente Creates a new agent with staging versión. The agent will be created with an initial staging versión that can later be promoted to production.

Scopes requeridos: agent-studio.write

Parametros: - Versión (header, string) (requerido) — Versión de la API - source (query, string) —

Cuerpo de la peticion (application/json): - locationId (requerido) — string — Location Id - name — string — Name of the agent - description — string — Description of the agent - agencyId — string — Agency Id - authorId — string — Author Id - authorName — string — Author name - authorEmail — string — Author email - status (requerido) — string — Status of the agent - versión (requerido) — object — Versión data for the agent including nodes, edges, and configuration - nodes — array — Nodes array (deprecated, prefer using versión.nodes) - edges — array — Edges array (deprecated, prefer using versión.edges)

Respuestas: - 201 — Agent created successfully - 400 — Peticion invalida - 401 — No autorizado - 422 — Entidad no procesable - 500 — Error interno del servidor


GET /agent-studio/agent

Listar agentes Lists all active agents for the specified location. locationId is required parameter to ensure optimal performance. Supports pagination using limit and offset. Optionally filter by isPublished=true to return only agents with a published production versión.

Scopes requeridos: agent-studio.readonly

Parametros: - Versión (header, string) (requerido) — Versión de la API - locationId (query, string) (requerido) — - isPublished (query, string) — Optional filter to return only agents with a published production versión - limit (query, string) (requerido) — - offset (query, string) (requerido) — - source (query, string) —

Respuestas: - 200 — Agents retrieved successfully - 400 — Bad Request - locationId is required - 401 — No autorizado - 422 — Entidad no procesable - 500 — Error interno del servidor


PATCH /agent-studio/agent/versions/{versionId}

Actualizar agente Updates a specific agent versión by versionId. Supports updating nodes, edges, variables, and configuration.

Scopes requeridos: agent-studio.write

Parametros: - Versión (header, string) (requerido) — Versión de la API - versionId (path, string) (requerido) — - source (query, string) —

Cuerpo de la peticion (application/json): - locationId (requerido) — string — Location Id for authorization - versionName — string — Versión name - description — string — Description of the versión - nodes — array — Complete array of nodes for the agent workflow. Provide all nodes including unchanged ones. - edges — array — Complete array of edges connecting the nodes. Provide all edges including unchanged ones. - globalVariables — array — Global variables accessible throughout the agent workflow - inputVariables — array — Input variables required from user at execution time - runtimeVariables — array — Runtime variables generated during agent execution - globalConfig — object — Global configuration including prompts and settings - userId — string — User Id performing the update - userName — string — User name performing the update

Respuestas: - 200 — Versión updated successfully - 400 — Peticion invalida - 401 — No autorizado - 404 — Versión not found - 422 — Entidad no procesable - 500 — Error interno del servidor


PATCH /agent-studio/agent/{agentId}

Actualizar Agent Metadata Updates agent metadata such as name, description, and status.

Scopes requeridos: agent-studio.write

Parametros: - Versión (header, string) (requerido) — Versión de la API - agentId (path, string) (requerido) — - source (query, string) —

Cuerpo de la peticion (application/json): - locationId (requerido) — string — Location Id for authorization (cannot be updated) - name — string — Name of the agent - description — string — Description of the agent - status — string — Status of the agent

Respuestas: - 200 — Agent metadata updated successfully - 400 — Peticion invalida - 401 — No autorizado - 404 — Agent not found - 422 — Entidad no procesable - 500 — Error interno del servidor


DELETE /agent-studio/agent/{agentId}

Eliminar agente Deletes an agent and all its versions.

Scopes requeridos: agent-studio.write

Parametros: - Versión (header, string) (requerido) — Versión de la API - agentId (path, string) (requerido) — - locationId (query, string) (requerido) — - source (query, string) —

Respuestas: - 200 — Agent deleted successfully - 400 — Peticion invalida - 401 — No autorizado - 404 — Agent not found - 422 — Entidad no procesable - 500 — Error interno del servidor


GET /agent-studio/agent/{agentId}

Obtener agente Gets a specific agent by its Id for the specified location with all its versions. Returns complete agent metadata and all non-deleted versions (draft, staging, production). locationId is required parameter. The agent must have active status.

Scopes requeridos: agent-studio.readonly

Parametros: - Versión (header, string) (requerido) — Versión de la API - agentId (path, string) (requerido) — - locationId (query, string) (requerido) — - source (query, string) —

Respuestas: - 200 — Agent retrieved successfully - 400 — Bad Request - locationId is required - 401 — No autorizado - 404 — Agent not found or not available - 422 — Entidad no procesable - 500 — Error interno del servidor


POST /agent-studio/agent/versions/{versionId}/publish

Promote to Production Promotes a draft versión to production.

Scopes requeridos: agent-studio.write

Parametros: - Versión (header, string) (requerido) — Versión de la API - versionId (path, string) (requerido) — - source (query, string) —

Cuerpo de la peticion (application/json): - locationId (requerido) — string — Location Id for authorization - userId — string — User Id performing the promotion action - userName — string — User name performing the promotion action - userEmail — string — User email performing the promotion action

Respuestas: - 200 — Versión promoted and published successfully - 400 — Bad Request - Only draft versions can be promoted - 401 — No autorizado - 404 — Versión not found - 422 — Entidad no procesable - 500 — Error interno del servidor


POST /agent-studio/agent/{agentId}/execute

Execute Agent Executes the specified agent and returns a non-streaming JSON response with the complete agent output. The agent must be in active status and belong to the specified location. locationId is required in the request body.

Session Management: - For the first message in a new session, do not include the executionId in the request payload. - The API will return an executionId along with the agent response, which uniquely identifies this conversation session. - To continue the conversation within the same session, include the executionId from the previous response in subsequent requests. This allows the agent to maintain conversation context and history across multiple interactions.

Scopes requeridos: agent-studio.write

Parametros: - Versión (header, string) (requerido) — Versión de la API - agentId (path, string) (requerido) — - source (query, string) —

Cuerpo de la peticion (application/json): - message (requerido) — string — Message to send to the agent - executionId — string — Unique session identifier that maintains conversational context across multiple interactions within the same agent session. Omit this field for the first message in a new session. Include the executionId returned from the previous response to maintain context in subsequent messages. - inputVariables — object — Input variables to pass to the agent. These should match the input variables defined in the agent configuration. - versionId — string — Published versión Id to execute. If not provided, the latest published production versión will be used. - attachments — array — Attachments for the message - type (requerido) — string — Type of attachment - imageUrl (requerido) — string — URL of the image attachment - locationId (requerido) — string — Location Id - contactId — string — Contact Id to associate with this execution. When provided, contact data will be hydrated and made available to the agent.

Respuestas: - 200 — Agent executed successfully - 400 — Agent is not active or invalid request - locationId is required - 401 — No autorizado - 403 — User does not have required scopes to execute this agent - 404 — Agent not found - 422 — Entidad no procesable - 500 — Error interno del servidor


GET /agent-studio/public-api/agents

Listar Agents (Deprecated) Deprecated endpoint - use GET /agent instead. Lists all active agents that have a published production versión for the specified location. locationId is required parameter. Supports pagination using limit and offset.

Scopes requeridos: agent-studio.readonly

Parametros: - Versión (header, string) (requerido) — Versión de la API - locationId (query, string) (requerido) — - limit (query, string) (requerido) — - offset (query, string) (requerido) — - source (query, string) —

Respuestas: - 200 — Agents retrieved successfully - 400 — Bad Request - locationId is required - 401 — No autorizado - 422 — Entidad no procesable - 500 — Error interno del servidor


GET /agent-studio/public-api/agents/{agentId}

Obtener Agent (Deprecated) Deprecated endpoint - use GET /agent/:agentId instead. Gets a specific agent by its Id for the specified location with all its versions. locationId is required parameter. The agent must have active status.

Scopes requeridos: agent-studio.readonly

Parametros: - Versión (header, string) (requerido) — Versión de la API - agentId (path, string) (requerido) — - locationId (query, string) (requerido) — - source (query, string) —

Respuestas: - 200 — Agent retrieved successfully - 400 — Bad Request - locationId is required - 401 — No autorizado - 404 — Agent not found or not available - 422 — Entidad no procesable - 500 — Error interno del servidor


POST /agent-studio/public-api/agents/{agentId}/execute

Execute Agent (Deprecated) Deprecated endpoint - use POST /agent/:agentId/execute instead. Executes the specified agent and returns a non-streaming JSON response with the complete agent output. The agent must be in active status and belong to the specified location. locationId is required in the request body.

Session Management: - For the first message in a new session, do not include the executionId in the request payload. - The API will return an executionId along with the agent response, which uniquely identifies this conversation session. - To continue the conversation within the same session, include the executionId from the previous response in subsequent requests.

Scopes requeridos: agent-studio.write

Parametros: - Versión (header, string) (requerido) — Versión de la API - agentId (path, string) (requerido) — - source (query, string) —

Cuerpo de la peticion (application/json): - message (requerido) — string — Message to send to the agent - executionId — string — Unique session identifier that maintains conversational context across multiple interactions within the same agent session. Omit this field for the first message in a new session. Include the executionId returned from the previous response to maintain context in subsequent messages. - inputVariables — object — Input variables to pass to the agent. These should match the input variables defined in the agent configuration. - versionId — string — Published versión Id to execute. If not provided, the latest published production versión will be used. - attachments — array — Attachments for the message - type (requerido) — string — Type of attachment - imageUrl (requerido) — string — URL of the image attachment - locationId (requerido) — string — Location Id - contactId — string — Contact Id to associate with this execution. When provided, contact data will be hydrated and made available to the agent.

Respuestas: - 200 — Agent executed successfully - 400 — Agent is not active or invalid request - locationId is required - 401 — No autorizado - 403 — User does not have required scopes to execute this agent - 404 — Agent not found - 422 — Entidad no procesable - 500 — Error interno del servidor