import type { EmptyObject, IdRequest, IdResponse, PageIconResponse } from "./common"; /** * Parameters for opening a session stream. */ export type UpdateSessionStreamParameters = { message: string; agent_id?: string | "notion_ai" | "33333333-3333-3333-3333-333333333333"; session_id?: string; attachments?: Array<{ file_upload: { id: string; }; /** * Always `file_upload` */ type?: "file_upload"; name?: string; }>; metadata?: Record; prompt_context?: string; } | { session_id: string; actions: Array<{ action_id: string; /** * One of: `approve`, `reject` */ option_id: "approve" | "reject"; }>; metadata?: Record; } | { session_id: string; continue_from: string; }; /** * An event emitted by a session stream. */ export type UpdateSessionStreamResponse = { /** * Always `session.snapshot` */ type: "session.snapshot"; session: { /** * Always `session` */ object: "session"; id: string; agent_id: string; title: string; /** * One of: `queued`, `in_progress`, `requires_action`, `completed`, `failed`, `canceled`, `terminated` */ status: "queued" | "in_progress" | "requires_action" | "completed" | "failed" | "canceled" | "terminated"; created_at: string; updated_at: string; required_actions?: Array<{ action_id: string; title: string; options: Array<{ /** * One of: `approve`, `reject` */ id: "approve" | "reject"; label: string; }>; }>; error?: { code: string; message: string; retryable: boolean; }; }; } | { /** * Always `event.provisional` */ type: "event.provisional"; event: { /** * Always `session_event` */ object: "session_event"; id: string; session_id: string; created_at: string; /** * Always `agent.message` */ type: "agent.message"; content: Array<{ /** * Always `text` */ type: "text"; text: string; }>; } | { /** * Always `session_event` */ object: "session_event"; id: string; session_id: string; created_at: string; /** * Always `agent.tool_use` */ type: "agent.tool_use"; tool_name: string; }; } | { /** * Always `event.committed` */ type: "event.committed"; event: { /** * Always `session_event` */ object: "session_event"; id: string; session_id: string; sequence: number; created_at: string; /** * Always `user.message` */ type: "user.message"; content: Array<{ /** * Always `text` */ type: "text"; text: string; } | { /** * Always `file` */ type: "file"; file_id: string; }>; metadata?: Record; } | { /** * Always `session_event` */ object: "session_event"; id: string; session_id: string; sequence: number; created_at: string; /** * Always `agent.message` */ type: "agent.message"; content: Array<{ /** * Always `text` */ type: "text"; text: string; }>; } | { /** * Always `session_event` */ object: "session_event"; id: string; session_id: string; sequence: number; created_at: string; /** * Always `agent.tool_use` */ type: "agent.tool_use"; tool_name: string; } | { /** * Always `session_event` */ object: "session_event"; id: string; session_id: string; sequence: number; created_at: string; /** * Always `agent.tool_result` */ type: "agent.tool_result"; tool_use_id: string; tool_name: string; is_error: boolean; } | { /** * Always `session_event` */ object: "session_event"; id: string; session_id: string; sequence: number; created_at: string; /** * Always `session.status` */ type: "session.status"; /** * One of: `queued`, `in_progress`, `requires_action`, `completed`, `failed`, `canceled`, `terminated` */ status: "queued" | "in_progress" | "requires_action" | "completed" | "failed" | "canceled" | "terminated"; required_actions?: Array<{ action_id: string; title: string; options: Array<{ /** * One of: `approve`, `reject` */ id: "approve" | "reject"; label: string; }>; }>; error?: { code: string; message: string; retryable: boolean; }; usage?: { total_tokens: number; input_tokens?: number; output_tokens?: number; }; artifacts?: Array<{ /** * Always `page` */ type: "page"; url: string; title: string; } | { /** * Always `html_artifact` */ type: "html_artifact"; url: string; page_url: string; }>; }; } | { /** * Always `stream.timeout` */ type: "stream.timeout"; session_id: string; message: string; } | { /** * Always `stream.end` */ type: "stream.end"; session_id: string; /** * One of: `requires_action`, `completed`, `failed`, `canceled`, `terminated` */ status: "requires_action" | "completed" | "failed" | "canceled" | "terminated"; } | { /** * Always `stream.error` */ type: "stream.error"; error: { code: string; message: string; /** * One of: `true`, `false` */ retryable: true | false; }; session_id?: string; }; /** * Open a session stream. */ export declare const updateSessionStream: { readonly method: "post"; readonly pathParams: readonly []; readonly queryParams: readonly []; readonly bodyParams: readonly ["message", "agent_id", "session_id", "attachments", "metadata", "prompt_context", "actions", "continue_from"]; readonly headers: { readonly Accept: "text/event-stream"; }; readonly path: () => string; }; type AgentBatchBodyParameters = { operations: Array<{ action: "update_status"; agent_id: IdRequest | "notion_ai" | "33333333-3333-3333-3333-333333333333"; fields: { status: "active" | "disabled"; }; } | { action: "update_credit_limit"; agent_id: IdRequest | "notion_ai" | "33333333-3333-3333-3333-333333333333"; fields: { credit_limit: number | null; }; } | { action: "delete"; agent_id: IdRequest | "notion_ai" | "33333333-3333-3333-3333-333333333333"; }>; }; export type AgentBatchParameters = AgentBatchBodyParameters; export type AgentBatchResponse = { object: "async_task"; id: string; status_url: string; created_time: string; operation: { surface: "rest" | "mcp"; name: string; }; status: "queued" | "running" | "retrying"; poll_after_seconds: number; }; /** * Apply many agent operations */ export declare const agentBatch: { readonly method: "post"; readonly pathParams: readonly []; readonly queryParams: readonly []; readonly bodyParams: readonly ["operations"]; readonly path: () => string; }; type CancelSessionPathParameters = { session_id: IdRequest; }; type CancelSessionBodyParameters = { event_id?: string; }; export type CancelSessionParameters = CancelSessionPathParameters & CancelSessionBodyParameters; export type CancelSessionResponse = { object: "session"; id: string; agent_id: string; title: string; status: "queued" | "in_progress" | "requires_action" | "completed" | "failed" | "canceled" | "terminated"; created_at: string; updated_at: string; required_actions?: Array<{ action_id: string; title: string; options: Array<{ id: "approve" | "reject"; label: string; }>; }>; error?: { code: string; message: string; retryable: boolean; }; }; /** * Cancel a session */ export declare const cancelSession: { readonly method: "post"; readonly pathParams: readonly ["session_id"]; readonly queryParams: readonly []; readonly bodyParams: readonly ["event_id"]; readonly path: (p: CancelSessionPathParameters) => string; }; type ChatWithAgentPathParameters = { agent_id: IdRequest | "notion_ai" | "33333333-3333-3333-3333-333333333333"; }; type ChatWithAgentQueryParameters = { verbose?: boolean; }; type ChatWithAgentBodyParameters = { message?: string; attachments?: Array<{ file_upload: { id: string; }; type?: "file_upload"; name?: string; }>; metadata?: Record; prompt_context?: string; /** @deprecated */ thread_id?: IdRequest; }; export type ChatWithAgentParameters = ChatWithAgentPathParameters & ChatWithAgentQueryParameters & ChatWithAgentBodyParameters; export type ChatWithAgentResponse = { object: "chat.invocation"; agent_id: string; thread_id: string; invocation_id: string; status: "pending"; }; /** * Chat with agent */ export declare const chatWithAgent: { readonly method: "post"; readonly pathParams: readonly ["agent_id"]; readonly queryParams: readonly ["verbose"]; readonly bodyParams: readonly ["message", "attachments", "metadata", "prompt_context", "thread_id"]; readonly path: (p: ChatWithAgentPathParameters) => string; }; type ContinueThreadPathParameters = { thread_id: IdRequest; }; type ContinueThreadBodyParameters = { action_id: IdRequest; option_id: "approve" | "reject"; } | { action_id: IdRequest; option_id: "use_connection"; input: { connection_id: IdRequest; }; }; export type ContinueThreadParameters = ContinueThreadPathParameters & ContinueThreadBodyParameters; export type ContinueThreadResponse = { object: "chat.invocation"; agent_id: string; thread_id: string; invocation_id: string; status: "pending"; }; /** * Continue a thread */ export declare const continueThread: { readonly method: "post"; readonly pathParams: readonly ["thread_id"]; readonly queryParams: readonly []; readonly bodyParams: readonly ["action_id", "option_id", "input"]; readonly path: (p: ContinueThreadPathParameters) => string; }; type CreateExternalAgentStubVaultPathParameters = { agent_id: IdRequest | "33333333-3333-3333-3333-333333333333"; }; type CreateExternalAgentStubVaultBodyParameters = { name: string; credential: { value: string; expires_at: string; }; target: { type: "mcp_server"; server_url: string; authorization: { type: "bearer"; }; }; }; export type CreateExternalAgentStubVaultParameters = CreateExternalAgentStubVaultPathParameters & CreateExternalAgentStubVaultBodyParameters; export type CreateExternalAgentStubVaultResponse = { id: string; name: string; credential: { expires_at: string; }; target: { type: "mcp_server"; server_url: string; authorization: { type: "bearer"; }; }; status: "active" | "expired"; version: number; created_at: string; updated_at: string; }; /** * Create external agent stub vault */ export declare const createExternalAgentStubVault: { readonly method: "post"; readonly pathParams: readonly ["agent_id"]; readonly queryParams: readonly []; readonly bodyParams: readonly ["name", "credential", "target"]; readonly path: (p: CreateExternalAgentStubVaultPathParameters) => string; }; type DeleteAgentPathParameters = { agent_id: IdRequest | "notion_ai" | "33333333-3333-3333-3333-333333333333"; }; export type DeleteAgentParameters = DeleteAgentPathParameters; export type DeleteAgentResponse = { agent_id: IdResponse; status: "deleted"; deleted_at: string; }; /** * Delete agent */ export declare const deleteAgent: { readonly method: "delete"; readonly pathParams: readonly ["agent_id"]; readonly queryParams: readonly []; readonly bodyParams: readonly []; readonly path: (p: DeleteAgentPathParameters) => string; }; type GetAgentPathParameters = { agent_id: IdRequest | "notion_ai" | "33333333-3333-3333-3333-333333333333"; }; type GetAgentQueryParameters = { verbose?: boolean; }; export type GetAgentParameters = GetAgentPathParameters & GetAgentQueryParameters; export type GetAgentResponse = { object: "agent"; id: IdResponse | "notion_ai"; agent_type: "notion_ai" | "custom_agent" | "autofill_custom_agent" | "external"; name: string; description: string | null; instructions_page_id: IdResponse | null; icon: PageIconResponse | { type: "custom_agent_avatar"; custom_agent_avatar: { static_url: string; animated_url: string; }; } | null; model: { mode: "auto"; } | { mode: "pinned"; id: string | null; }; connections: Array<{ type: "notion"; name: string; account: null; permissions: Array<{ target: { type: "page"; id: string; } | { type: "database_property"; data_source_id: string; property_id: string; } | { type: "agent"; id: string; } | { type: "workspace"; } | { type: "owner_private_pages"; } | { type: "web_search"; allowed_domains: Array | null; } | { type: "notion_help_docs_search"; }; scopes: Array; }>; } | { type: "slack"; name: string; account: { type: "slack_workspace"; team_id: string; } | "hidden" | null; permissions: Array<{ target: { type: "slack_channel"; id: string; } | { type: "slack_all_public_channels"; } | { type: "slack_all_channels"; }; scopes: Array; }>; } | { type: "discord"; name: string; account: { type: "discord_server"; id: string; } | "hidden" | null; permissions: Array<{ target: { type: "discord_channel"; id: string; } | { type: "discord_all_channels"; }; scopes: Array; }>; } | { type: "mcp_server"; name: string; account: { type: "mcp_server"; server_host: string; } | "hidden" | null; enabled_tools: Array<{ name: string; title: string | null; }> | "hidden" | null; run_tools_automatically: { read: boolean; write: boolean; }; } | { type: "custom_mcp_server"; name: string; account: { type: "mcp_server"; server_host: string; } | "hidden" | null; enabled_tools: Array<{ name: string; title: string | null; }> | "hidden" | null; run_tools_automatically: { read: boolean; write: boolean; }; } | { type: "asana" | "box" | "browser" | "calendar" | "computer" | "confluence" | "cursor" | "files" | "fs" | "github" | "gmail" | "google_calendar" | "google_drive" | "google_drive_oauth" | "gtm" | "helpdocs" | "images" | "jira" | "linear" | "mail" | "marketplace" | "memory" | "microsoft_teams" | "outlook" | "salesforce" | "search" | "security" | "sharepoint" | "skills" | "system" | "test" | "web" | "webhooks" | "worker" | "workers"; name: string; account: string | null; permissions: Array<{ target: { type: string; id: string; }; scopes: Array; }>; }>; status: "active" | "disabled" | "deleted"; pause_reason: "run_limit" | "credit_limit" | "runaway_credit_usage" | "workspace_credit_limit" | "failure_limit" | "mark_session_failed_autopause" | "disabled_from_workspace_settings" | "disabled_from_api" | "disabled_from_agent_settings" | "disabled_due_to_no_members_with_access" | "disabled_due_to_lack_of_editors" | "disabled_by_notion" | "internal_error" | "needs_user_review" | "tool_unavailable" | null; created_by: { object: "user"; type: "user"; id: IdResponse; } | null; version: { id: IdResponse; number: number; published_at: string; } | null; agent_version: { id: IdResponse; number: number; published_at: string; } | null; has_unpublished_changes: boolean | "hidden"; last_run_time: string | "hidden" | null; last_run_at: string | "hidden" | null; credit_limit: number | "hidden" | null; triggers: Array<{ type: string; enabled: boolean; schedule?: { frequency: string; interval: number; weekdays?: Array; monthdays?: Array; week_numbers?: Array; hour?: number; minute?: number; timezone?: string; start_date?: string; end?: { type: "date"; end_at: string; } | { type: "count"; occurrences: number; }; }; config?: Record>; }>; created_time?: string; last_edited_time?: string; instructions?: string | null; }; /** * Get agent */ export declare const getAgent: { readonly method: "get"; readonly pathParams: readonly ["agent_id"]; readonly queryParams: readonly ["verbose"]; readonly bodyParams: readonly []; readonly path: (p: GetAgentPathParameters) => string; }; type DeleteExternalAgentStubVaultPathParameters = { agent_id: IdRequest | "33333333-3333-3333-3333-333333333333"; vault_id: string; }; export type DeleteExternalAgentStubVaultParameters = DeleteExternalAgentStubVaultPathParameters; export type DeleteExternalAgentStubVaultResponse = EmptyObject; /** * Delete external agent stub vault */ export declare const deleteExternalAgentStubVault: { readonly method: "delete"; readonly pathParams: readonly ["agent_id", "vault_id"]; readonly queryParams: readonly []; readonly bodyParams: readonly []; readonly path: (p: DeleteExternalAgentStubVaultPathParameters) => string; }; type UpdateExternalAgentStubVaultPathParameters = { agent_id: IdRequest | "33333333-3333-3333-3333-333333333333"; vault_id: string; }; type UpdateExternalAgentStubVaultBodyParameters = { expected_version: number; credential: { value: string; expires_at: string; }; }; export type UpdateExternalAgentStubVaultParameters = UpdateExternalAgentStubVaultPathParameters & UpdateExternalAgentStubVaultBodyParameters; export type UpdateExternalAgentStubVaultResponse = { id: string; name: string; credential: { expires_at: string; }; target: { type: "mcp_server"; server_url: string; authorization: { type: "bearer"; }; }; status: "active" | "expired"; version: number; created_at: string; updated_at: string; }; /** * Update external agent stub vault */ export declare const updateExternalAgentStubVault: { readonly method: "patch"; readonly pathParams: readonly ["agent_id", "vault_id"]; readonly queryParams: readonly []; readonly bodyParams: readonly ["expected_version", "credential"]; readonly path: (p: UpdateExternalAgentStubVaultPathParameters) => string; }; type GetInsightsPathParameters = { agent_id: IdRequest | "notion_ai" | "33333333-3333-3333-3333-333333333333"; }; type GetInsightsQueryParameters = { start_time?: number; end_time?: number; }; export type GetInsightsParameters = GetInsightsPathParameters & GetInsightsQueryParameters; export type GetInsightsResponse = { object: "agent_insights"; id: IdResponse | "notion_ai"; name: string; agent_type: "notion_ai" | "custom_agent" | "autofill_custom_agent"; status: "active" | "disabled" | "deleted"; pause_reason: "run_limit" | "credit_limit" | "runaway_credit_usage" | "workspace_credit_limit" | "failure_limit" | "mark_session_failed_autopause" | "disabled_from_workspace_settings" | "disabled_from_api" | "disabled_from_agent_settings" | "disabled_due_to_no_members_with_access" | "disabled_due_to_lack_of_editors" | "disabled_by_notion" | "internal_error" | "needs_user_review" | "tool_unavailable" | null; created_by: { id: string; type: "user" | "bot"; } | null; total_credits_used: number; credit_limit: number | "hidden" | null; runs_completed: number; }; /** * Get agent insights */ export declare const getInsights: { readonly method: "get"; readonly pathParams: readonly ["agent_id"]; readonly queryParams: readonly ["start_time", "end_time"]; readonly bodyParams: readonly []; readonly path: (p: GetInsightsPathParameters) => string; }; type ListAgentsQueryParameters = { name?: string; agent_type?: Array<"notion_ai" | "custom_agent" | "autofill_custom_agent" | "external">; agent_ids?: Array; created_by?: Array; start_cursor?: string | null; page_size?: number; verbose?: boolean; }; export type ListAgentsParameters = ListAgentsQueryParameters; export type ListAgentsResponse = { object: "list"; type: "agent"; results: Array<{ object: "agent"; id: IdResponse | "notion_ai"; agent_type: "notion_ai" | "custom_agent" | "autofill_custom_agent" | "external"; name: string; description: string | null; instructions_page_id: IdResponse | null; icon: PageIconResponse | { type: "custom_agent_avatar"; custom_agent_avatar: { static_url: string; animated_url: string; }; } | null; version: { id: IdResponse; number: number; published_at: string; } | null; agent_version: { id: IdResponse; number: number; published_at: string; } | null; model: { mode: "auto"; } | { mode: "pinned"; id: string | null; }; connections: Array<{ type: "notion"; name: string; account: null; permissions: Array<{ target: { type: "page"; id: string; } | { type: "database_property"; data_source_id: string; property_id: string; } | { type: "agent"; id: string; } | { type: "workspace"; } | { type: "owner_private_pages"; } | { type: "web_search"; allowed_domains: Array | null; } | { type: "notion_help_docs_search"; }; scopes: Array; }>; } | { type: "slack"; name: string; account: { type: "slack_workspace"; team_id: string; } | "hidden" | null; permissions: Array<{ target: { type: "slack_channel"; id: string; } | { type: "slack_all_public_channels"; } | { type: "slack_all_channels"; }; scopes: Array; }>; } | { type: "discord"; name: string; account: { type: "discord_server"; id: string; } | "hidden" | null; permissions: Array<{ target: { type: "discord_channel"; id: string; } | { type: "discord_all_channels"; }; scopes: Array; }>; } | { type: "mcp_server"; name: string; account: { type: "mcp_server"; server_host: string; } | "hidden" | null; enabled_tools: Array<{ name: string; title: string | null; }> | "hidden" | null; run_tools_automatically: { read: boolean; write: boolean; }; } | { type: "custom_mcp_server"; name: string; account: { type: "mcp_server"; server_host: string; } | "hidden" | null; enabled_tools: Array<{ name: string; title: string | null; }> | "hidden" | null; run_tools_automatically: { read: boolean; write: boolean; }; } | { type: "asana" | "box" | "browser" | "calendar" | "computer" | "confluence" | "cursor" | "files" | "fs" | "github" | "gmail" | "google_calendar" | "google_drive" | "google_drive_oauth" | "gtm" | "helpdocs" | "images" | "jira" | "linear" | "mail" | "marketplace" | "memory" | "microsoft_teams" | "outlook" | "salesforce" | "search" | "security" | "sharepoint" | "skills" | "system" | "test" | "web" | "webhooks" | "worker" | "workers"; name: string; account: string | null; permissions: Array<{ target: { type: string; id: string; }; scopes: Array; }>; }>; status: "active" | "disabled" | "deleted"; created_by: { object: "user"; type: "user"; id: IdResponse; } | null; created_time: string | null; last_edited_time: string | null; last_run_time: string | "hidden" | null; last_run_at: string | "hidden" | null; instructions?: string | null; }>; has_more: boolean; next_cursor: string | null; }; /** * List agents */ export declare const listAgents: { readonly method: "get"; readonly pathParams: readonly []; readonly queryParams: readonly ["name", "agent_type", "agent_ids", "created_by", "start_cursor", "page_size", "verbose"]; readonly bodyParams: readonly []; readonly path: () => string; }; type ListExternalAgentStubSessionEventsPathParameters = { agent_id: IdRequest | "33333333-3333-3333-3333-333333333333"; session_id: IdRequest; }; type ListExternalAgentStubSessionEventsQueryParameters = { cursor?: string; }; export type ListExternalAgentStubSessionEventsParameters = ListExternalAgentStubSessionEventsPathParameters & ListExternalAgentStubSessionEventsQueryParameters; export type ListExternalAgentStubSessionEventsResponse = { events: Array<{ type: "assistant.thinking"; text: string; } | { type: "assistant.message"; text: string; } | { type: "tool.started"; tool_call_id: string; tool_name?: string; input?: Record; } | { type: "tool.output"; tool_call_id: string; output?: Record; is_error?: boolean; } | { type: "error"; error: { code: string; message: string; retryable: boolean; additional_data?: Record>; }; }>; is_running: boolean; next_cursor?: string; }; /** * List external agent stub session events */ export declare const listExternalAgentStubSessionEvents: { readonly method: "get"; readonly pathParams: readonly ["agent_id", "session_id"]; readonly queryParams: readonly ["cursor"]; readonly bodyParams: readonly []; readonly path: (p: ListExternalAgentStubSessionEventsPathParameters) => string; }; type ListThreadMessagesPathParameters = { thread_id: IdRequest; }; type ListThreadMessagesQueryParameters = { verbose?: boolean; role?: "user" | "agent"; start_cursor?: string | null; page_size?: number; }; export type ListThreadMessagesParameters = ListThreadMessagesPathParameters & ListThreadMessagesQueryParameters; export type ListThreadMessagesResponse = { object: "list"; type: "thread_message"; results: Array<{ object: "thread_message"; id: IdResponse; role: "user" | "agent"; content: string; created_time: string; parent: { type: "thread"; id: IdResponse; }; attachments?: Array<{ name: string; content_type: string; url: string; expiry_time?: string; }>; content_parts?: Array<{ type: "text"; text: string; } | { type: "thinking"; text: string; } | { type: "tool_call"; tool_call_id: string | null; tool_name: string; results?: Array<{ id: IdResponse; agent_step_id: IdResponse | null; tool_call_id: string | null; tool_name: string; tool_type: string; state: string; started_at: number; finished_at: number | null; duration_ms: number | null; }>; } | { type: "follow_ups"; follow_ups: Array<{ label: string; message: string; }>; } | { type: "custom_agent_template_picker"; }>; pending_user_actions?: Array<{ id: IdResponse; type: "tool_confirmation"; title: string; requirements: Array<{ type: "general"; } | { type: "manage_workers"; } | { type: "url_safety"; urls: Array; required_by_workspace_policy?: boolean; } | { type: "permission_escalation"; destination_title?: string; source_titles?: Array; } | { type: "delete_content"; page_count: number; database_count: number; meeting_notes_block_count?: number; } | { type: "connect_integration"; integration_type: string; integration_name: string; handoff_url: string; } | { type: "admin_mode"; explanation?: string; }>; options: Array<{ id: "approve"; label: string; } | { id: "reject"; label: string; } | { id: "use_connection"; label: string; input: { type: "connection_id"; required: true; }; }>; }>; }>; has_more: boolean; next_cursor: string | null; }; /** * List thread messages */ export declare const listThreadMessages: { readonly method: "get"; readonly pathParams: readonly ["thread_id"]; readonly queryParams: readonly ["verbose", "role", "start_cursor", "page_size"]; readonly bodyParams: readonly []; readonly path: (p: ListThreadMessagesPathParameters) => string; }; type SendThreadMessagePathParameters = { thread_id: IdRequest; }; type SendThreadMessageBodyParameters = { message?: string; attachments?: Array<{ file_upload: { id: string; }; type?: "file_upload"; name?: string; }>; metadata?: Record; prompt_context?: string; }; export type SendThreadMessageParameters = SendThreadMessagePathParameters & SendThreadMessageBodyParameters; export type SendThreadMessageResponse = { object: "chat.invocation"; agent_id: string; thread_id: string; invocation_id: string; status: "pending"; }; /** * Send a thread message */ export declare const sendThreadMessage: { readonly method: "post"; readonly pathParams: readonly ["thread_id"]; readonly queryParams: readonly []; readonly bodyParams: readonly ["message", "attachments", "metadata", "prompt_context"]; readonly path: (p: SendThreadMessagePathParameters) => string; }; type ListThreadsPathParameters = { agent_id: IdRequest | "notion_ai" | "33333333-3333-3333-3333-333333333333"; }; type ListThreadsQueryParameters = { id?: IdRequest; title?: string; status?: "pending" | "requires_action" | "completed" | "failed" | "canceled"; activity?: "all" | "pending" | "in_progress" | "failed" | "success"; created_by?: Array; last_used_by?: Array; sort_by?: "created_time" | "last_used_time"; sort_direction?: "ascending" | "descending"; start_cursor?: string | null; page_size?: number; }; export type ListThreadsParameters = ListThreadsPathParameters & ListThreadsQueryParameters; export type ListThreadsResponse = { object: "list"; type: "thread"; results: Array<{ object: "thread"; id: IdResponse; title: string; status: "pending" | "requires_action" | "completed" | "canceled" | "failed"; created_time: string; last_edited_time: string; created_by: { id: IdResponse; type: "bot" | "user"; }; agent_version: { id: IdResponse; number: number; published_at: string; } | null; models: { type: "auto"; } | { type: "pinned"; ids: Array; }; error?: string; trigger_type?: string; type_labels?: Array | null; chat_user_emails?: Array | null; tool_types?: Array | null; tool_call_count?: number | null; credits_used?: number | null; runs_completed?: number | null; pending_user_actions?: Array<{ id: IdResponse; type: "tool_confirmation"; title: string; requirements: Array<{ type: "general"; } | { type: "manage_workers"; } | { type: "url_safety"; urls: Array; required_by_workspace_policy?: boolean; } | { type: "permission_escalation"; destination_title?: string; source_titles?: Array; } | { type: "delete_content"; page_count: number; database_count: number; meeting_notes_block_count?: number; } | { type: "connect_integration"; integration_type: string; integration_name: string; handoff_url: string; } | { type: "admin_mode"; explanation?: string; }>; options: Array<{ id: "approve"; label: string; } | { id: "reject"; label: string; } | { id: "use_connection"; label: string; input: { type: "connection_id"; required: true; }; }>; }>; }>; has_more: boolean; next_cursor: string | null; }; /** * List threads */ export declare const listThreads: { readonly method: "get"; readonly pathParams: readonly ["agent_id"]; readonly queryParams: readonly ["id", "title", "status", "activity", "created_by", "last_used_by", "sort_by", "sort_direction", "start_cursor", "page_size"]; readonly bodyParams: readonly []; readonly path: (p: ListThreadsPathParameters) => string; }; type QueryAgentsBodyParameters = { query?: string; filter?: { property: "id"; id: { equals: string; }; } | { property: "agent_type"; string: { equals: "notion_ai" | "custom_agent" | "autofill_custom_agent"; }; } | { property: "created_by"; people: { contains: string; }; } | { property: "created_time"; date: { after?: string; before?: string; }; } | { property: "favorited"; checkbox: { equals: boolean; }; } | { property: "connections"; mcp_server: { contains: string; }; } | { property: "status"; status: { in: Array<"active" | "disabled" | "deleted">; }; } | { property: "model_mode"; select: { equals: "auto" | "pinned"; }; } | { property: "agent_version"; number: { equals: number; }; } | { property: "last_run_at"; date: { after?: string; before?: string; }; } | { and: Array<{ property: "id"; id: { equals: string; }; } | { property: "agent_type"; string: { equals: "notion_ai" | "custom_agent" | "autofill_custom_agent"; }; } | { property: "created_by"; people: { contains: string; }; } | { property: "created_time"; date: { after?: string; before?: string; }; } | { property: "favorited"; checkbox: { equals: boolean; }; } | { property: "connections"; mcp_server: { contains: string; }; } | { property: "status"; status: { in: Array<"active" | "disabled" | "deleted">; }; } | { property: "model_mode"; select: { equals: "auto" | "pinned"; }; } | { property: "agent_version"; number: { equals: number; }; } | { property: "last_run_at"; date: { after?: string; before?: string; }; } | { and: Array<{ property: "id"; id: { equals: string; }; } | { property: "agent_type"; string: { equals: "notion_ai" | "custom_agent" | "autofill_custom_agent"; }; } | { property: "created_by"; people: { contains: string; }; } | { property: "created_time"; date: { after?: string; before?: string; }; } | { property: "favorited"; checkbox: { equals: boolean; }; } | { property: "connections"; mcp_server: { contains: string; }; } | { property: "status"; status: { in: Array<"active" | "disabled" | "deleted">; }; } | { property: "model_mode"; select: { equals: "auto" | "pinned"; }; } | { property: "agent_version"; number: { equals: number; }; } | { property: "last_run_at"; date: { after?: string; before?: string; }; }>; } | { or: Array<{ property: "id"; id: { equals: string; }; } | { property: "agent_type"; string: { equals: "notion_ai" | "custom_agent" | "autofill_custom_agent"; }; } | { property: "created_by"; people: { contains: string; }; } | { property: "created_time"; date: { after?: string; before?: string; }; } | { property: "favorited"; checkbox: { equals: boolean; }; } | { property: "connections"; mcp_server: { contains: string; }; } | { property: "status"; status: { in: Array<"active" | "disabled" | "deleted">; }; } | { property: "model_mode"; select: { equals: "auto" | "pinned"; }; } | { property: "agent_version"; number: { equals: number; }; } | { property: "last_run_at"; date: { after?: string; before?: string; }; }>; }>; } | { or: Array<{ property: "id"; id: { equals: string; }; } | { property: "agent_type"; string: { equals: "notion_ai" | "custom_agent" | "autofill_custom_agent"; }; } | { property: "created_by"; people: { contains: string; }; } | { property: "created_time"; date: { after?: string; before?: string; }; } | { property: "favorited"; checkbox: { equals: boolean; }; } | { property: "connections"; mcp_server: { contains: string; }; } | { property: "status"; status: { in: Array<"active" | "disabled" | "deleted">; }; } | { property: "model_mode"; select: { equals: "auto" | "pinned"; }; } | { property: "agent_version"; number: { equals: number; }; } | { property: "last_run_at"; date: { after?: string; before?: string; }; } | { and: Array<{ property: "id"; id: { equals: string; }; } | { property: "agent_type"; string: { equals: "notion_ai" | "custom_agent" | "autofill_custom_agent"; }; } | { property: "created_by"; people: { contains: string; }; } | { property: "created_time"; date: { after?: string; before?: string; }; } | { property: "favorited"; checkbox: { equals: boolean; }; } | { property: "connections"; mcp_server: { contains: string; }; } | { property: "status"; status: { in: Array<"active" | "disabled" | "deleted">; }; } | { property: "model_mode"; select: { equals: "auto" | "pinned"; }; } | { property: "agent_version"; number: { equals: number; }; } | { property: "last_run_at"; date: { after?: string; before?: string; }; }>; } | { or: Array<{ property: "id"; id: { equals: string; }; } | { property: "agent_type"; string: { equals: "notion_ai" | "custom_agent" | "autofill_custom_agent"; }; } | { property: "created_by"; people: { contains: string; }; } | { property: "created_time"; date: { after?: string; before?: string; }; } | { property: "favorited"; checkbox: { equals: boolean; }; } | { property: "connections"; mcp_server: { contains: string; }; } | { property: "status"; status: { in: Array<"active" | "disabled" | "deleted">; }; } | { property: "model_mode"; select: { equals: "auto" | "pinned"; }; } | { property: "agent_version"; number: { equals: number; }; } | { property: "last_run_at"; date: { after?: string; before?: string; }; }>; }>; }; sorts?: Array<{ property: "created_time" | "last_run_at"; direction: "ascending" | "descending"; }>; start_cursor?: string | null; page_size?: number; verbose?: boolean; include_deleted?: boolean; }; export type QueryAgentsParameters = QueryAgentsBodyParameters; export type QueryAgentsResponse = { object: "list"; type: "agent"; results: Array<{ object: "agent"; id: IdResponse; agent_type: "custom_agent" | "autofill_custom_agent"; name: string; description: string | null; instructions_page_id: IdResponse | null; icon: PageIconResponse | { type: "custom_agent_avatar"; custom_agent_avatar: { static_url: string; animated_url: string; }; } | null; model: { mode: "auto"; } | { mode: "pinned"; id: string | null; }; connections: Array<{ type: "notion"; name: string; account: null; permissions: Array<{ target: { type: "page"; id: string; } | { type: "database_property"; data_source_id: string; property_id: string; } | { type: "agent"; id: string; } | { type: "workspace"; } | { type: "owner_private_pages"; } | { type: "web_search"; allowed_domains: Array | null; } | { type: "notion_help_docs_search"; }; scopes: Array; }>; } | { type: "slack"; name: string; account: { type: "slack_workspace"; team_id: string; } | "hidden" | null; permissions: Array<{ target: { type: "slack_channel"; id: string; } | { type: "slack_all_public_channels"; } | { type: "slack_all_channels"; }; scopes: Array; }>; } | { type: "discord"; name: string; account: { type: "discord_server"; id: string; } | "hidden" | null; permissions: Array<{ target: { type: "discord_channel"; id: string; } | { type: "discord_all_channels"; }; scopes: Array; }>; } | { type: "mcp_server"; name: string; account: { type: "mcp_server"; server_host: string; } | "hidden" | null; enabled_tools: Array<{ name: string; title: string | null; }> | "hidden" | null; run_tools_automatically: { read: boolean; write: boolean; }; } | { type: "custom_mcp_server"; name: string; account: { type: "mcp_server"; server_host: string; } | "hidden" | null; enabled_tools: Array<{ name: string; title: string | null; }> | "hidden" | null; run_tools_automatically: { read: boolean; write: boolean; }; } | { type: "asana" | "box" | "browser" | "calendar" | "computer" | "confluence" | "cursor" | "files" | "fs" | "github" | "gmail" | "google_calendar" | "google_drive" | "google_drive_oauth" | "gtm" | "helpdocs" | "images" | "jira" | "linear" | "mail" | "marketplace" | "memory" | "microsoft_teams" | "outlook" | "salesforce" | "search" | "security" | "sharepoint" | "skills" | "system" | "test" | "web" | "webhooks" | "worker" | "workers"; name: string; account: string | null; permissions: Array<{ target: { type: string; id: string; }; scopes: Array; }>; }>; status: "active" | "disabled" | "deleted"; pause_reason: "run_limit" | "credit_limit" | "runaway_credit_usage" | "workspace_credit_limit" | "failure_limit" | "mark_session_failed_autopause" | "disabled_from_workspace_settings" | "disabled_from_api" | "disabled_from_agent_settings" | "disabled_due_to_no_members_with_access" | "disabled_due_to_lack_of_editors" | "disabled_by_notion" | "internal_error" | "needs_user_review" | "tool_unavailable" | null; created_by: { type: "user" | "bot"; id: IdResponse; } | null; agent_version: { id: IdResponse; number: number; published_at: string; } | null; created_time: string; last_edited_time: string; last_run_at: string | "hidden" | null; credit_limit: number | "hidden" | null; triggers: Array<{ type: string; enabled: boolean; schedule?: { frequency: string; interval: number; weekdays?: Array; monthdays?: Array; week_numbers?: Array; hour?: number; minute?: number; timezone?: string; start_date?: string; end?: { type: "date"; end_at: string; } | { type: "count"; occurrences: number; }; }; config?: Record>; }>; instructions?: string | null; } | { object: "agent"; id: "notion_ai"; agent_type: "notion_ai"; name: string; description: null; instructions_page_id: null; icon: PageIconResponse | { type: "custom_agent_avatar"; custom_agent_avatar: { static_url: string; animated_url: string; }; }; model: { mode: "auto"; } | { mode: "pinned"; id: string | null; }; connections: Array<{ type: "notion"; name: string; account: null; permissions: Array<{ target: { type: "page"; id: string; } | { type: "database_property"; data_source_id: string; property_id: string; } | { type: "agent"; id: string; } | { type: "workspace"; } | { type: "owner_private_pages"; } | { type: "web_search"; allowed_domains: Array | null; } | { type: "notion_help_docs_search"; }; scopes: Array; }>; } | { type: "slack"; name: string; account: { type: "slack_workspace"; team_id: string; } | "hidden" | null; permissions: Array<{ target: { type: "slack_channel"; id: string; } | { type: "slack_all_public_channels"; } | { type: "slack_all_channels"; }; scopes: Array; }>; } | { type: "discord"; name: string; account: { type: "discord_server"; id: string; } | "hidden" | null; permissions: Array<{ target: { type: "discord_channel"; id: string; } | { type: "discord_all_channels"; }; scopes: Array; }>; } | { type: "mcp_server"; name: string; account: { type: "mcp_server"; server_host: string; } | "hidden" | null; enabled_tools: Array<{ name: string; title: string | null; }> | "hidden" | null; run_tools_automatically: { read: boolean; write: boolean; }; } | { type: "custom_mcp_server"; name: string; account: { type: "mcp_server"; server_host: string; } | "hidden" | null; enabled_tools: Array<{ name: string; title: string | null; }> | "hidden" | null; run_tools_automatically: { read: boolean; write: boolean; }; } | { type: "asana" | "box" | "browser" | "calendar" | "computer" | "confluence" | "cursor" | "files" | "fs" | "github" | "gmail" | "google_calendar" | "google_drive" | "google_drive_oauth" | "gtm" | "helpdocs" | "images" | "jira" | "linear" | "mail" | "marketplace" | "memory" | "microsoft_teams" | "outlook" | "salesforce" | "search" | "security" | "sharepoint" | "skills" | "system" | "test" | "web" | "webhooks" | "worker" | "workers"; name: string; account: string | null; permissions: Array<{ target: { type: string; id: string; }; scopes: Array; }>; }>; status: "active"; pause_reason: null; created_by: null; agent_version: null; created_time: null; last_edited_time: null; last_run_at: null; credit_limit: null; triggers: Array<{ type: string; enabled: boolean; schedule?: { frequency: string; interval: number; weekdays?: Array; monthdays?: Array; week_numbers?: Array; hour?: number; minute?: number; timezone?: string; start_date?: string; end?: { type: "date"; end_at: string; } | { type: "count"; occurrences: number; }; }; config?: Record>; }>; }>; has_more: boolean; next_cursor: string | null; }; /** * Query agents */ export declare const queryAgents: { readonly method: "post"; readonly pathParams: readonly []; readonly queryParams: readonly []; readonly bodyParams: readonly ["query", "filter", "sorts", "start_cursor", "page_size", "verbose", "include_deleted"]; readonly path: () => string; }; type QuerySessionEventsPathParameters = { session_id: IdRequest; }; type QuerySessionEventsBodyParameters = { filter?: { property: "id"; string: { equals: string; }; } | { property: "type"; event_type: { equals?: "user.message" | "agent.message" | "agent.thinking" | "agent.tool_use" | "agent.tool_result" | "session.status"; in?: Array<"user.message" | "agent.message" | "agent.thinking" | "agent.tool_use" | "agent.tool_result" | "session.status">; }; } | { property: "sequence"; number: { greater_than?: number; greater_than_or_equal_to?: number; less_than?: number; less_than_or_equal_to?: number; }; } | { property: "created_at"; timestamp: { equals?: string; before?: string; after?: string; on_or_before?: string; on_or_after?: string; }; } | { and: Array<{ property: "id"; string: { equals: string; }; } | { property: "type"; event_type: { equals?: "user.message" | "agent.message" | "agent.thinking" | "agent.tool_use" | "agent.tool_result" | "session.status"; in?: Array<"user.message" | "agent.message" | "agent.thinking" | "agent.tool_use" | "agent.tool_result" | "session.status">; }; } | { property: "sequence"; number: { greater_than?: number; greater_than_or_equal_to?: number; less_than?: number; less_than_or_equal_to?: number; }; } | { property: "created_at"; timestamp: { equals?: string; before?: string; after?: string; on_or_before?: string; on_or_after?: string; }; } | { and: Array<{ property: "id"; string: { equals: string; }; } | { property: "type"; event_type: { equals?: "user.message" | "agent.message" | "agent.thinking" | "agent.tool_use" | "agent.tool_result" | "session.status"; in?: Array<"user.message" | "agent.message" | "agent.thinking" | "agent.tool_use" | "agent.tool_result" | "session.status">; }; } | { property: "sequence"; number: { greater_than?: number; greater_than_or_equal_to?: number; less_than?: number; less_than_or_equal_to?: number; }; } | { property: "created_at"; timestamp: { equals?: string; before?: string; after?: string; on_or_before?: string; on_or_after?: string; }; } | { and: Array<{ property: "id"; string: { equals: string; }; } | { property: "type"; event_type: { equals?: "user.message" | "agent.message" | "agent.thinking" | "agent.tool_use" | "agent.tool_result" | "session.status"; in?: Array<"user.message" | "agent.message" | "agent.thinking" | "agent.tool_use" | "agent.tool_result" | "session.status">; }; } | { property: "sequence"; number: { greater_than?: number; greater_than_or_equal_to?: number; less_than?: number; less_than_or_equal_to?: number; }; } | { property: "created_at"; timestamp: { equals?: string; before?: string; after?: string; on_or_before?: string; on_or_after?: string; }; }>; } | { or: Array<{ property: "id"; string: { equals: string; }; } | { property: "type"; event_type: { equals?: "user.message" | "agent.message" | "agent.thinking" | "agent.tool_use" | "agent.tool_result" | "session.status"; in?: Array<"user.message" | "agent.message" | "agent.thinking" | "agent.tool_use" | "agent.tool_result" | "session.status">; }; } | { property: "sequence"; number: { greater_than?: number; greater_than_or_equal_to?: number; less_than?: number; less_than_or_equal_to?: number; }; } | { property: "created_at"; timestamp: { equals?: string; before?: string; after?: string; on_or_before?: string; on_or_after?: string; }; }>; }>; } | { or: Array<{ property: "id"; string: { equals: string; }; } | { property: "type"; event_type: { equals?: "user.message" | "agent.message" | "agent.thinking" | "agent.tool_use" | "agent.tool_result" | "session.status"; in?: Array<"user.message" | "agent.message" | "agent.thinking" | "agent.tool_use" | "agent.tool_result" | "session.status">; }; } | { property: "sequence"; number: { greater_than?: number; greater_than_or_equal_to?: number; less_than?: number; less_than_or_equal_to?: number; }; } | { property: "created_at"; timestamp: { equals?: string; before?: string; after?: string; on_or_before?: string; on_or_after?: string; }; } | { and: Array<{ property: "id"; string: { equals: string; }; } | { property: "type"; event_type: { equals?: "user.message" | "agent.message" | "agent.thinking" | "agent.tool_use" | "agent.tool_result" | "session.status"; in?: Array<"user.message" | "agent.message" | "agent.thinking" | "agent.tool_use" | "agent.tool_result" | "session.status">; }; } | { property: "sequence"; number: { greater_than?: number; greater_than_or_equal_to?: number; less_than?: number; less_than_or_equal_to?: number; }; } | { property: "created_at"; timestamp: { equals?: string; before?: string; after?: string; on_or_before?: string; on_or_after?: string; }; }>; } | { or: Array<{ property: "id"; string: { equals: string; }; } | { property: "type"; event_type: { equals?: "user.message" | "agent.message" | "agent.thinking" | "agent.tool_use" | "agent.tool_result" | "session.status"; in?: Array<"user.message" | "agent.message" | "agent.thinking" | "agent.tool_use" | "agent.tool_result" | "session.status">; }; } | { property: "sequence"; number: { greater_than?: number; greater_than_or_equal_to?: number; less_than?: number; less_than_or_equal_to?: number; }; } | { property: "created_at"; timestamp: { equals?: string; before?: string; after?: string; on_or_before?: string; on_or_after?: string; }; }>; }>; }>; } | { or: Array<{ property: "id"; string: { equals: string; }; } | { property: "type"; event_type: { equals?: "user.message" | "agent.message" | "agent.thinking" | "agent.tool_use" | "agent.tool_result" | "session.status"; in?: Array<"user.message" | "agent.message" | "agent.thinking" | "agent.tool_use" | "agent.tool_result" | "session.status">; }; } | { property: "sequence"; number: { greater_than?: number; greater_than_or_equal_to?: number; less_than?: number; less_than_or_equal_to?: number; }; } | { property: "created_at"; timestamp: { equals?: string; before?: string; after?: string; on_or_before?: string; on_or_after?: string; }; } | { and: Array<{ property: "id"; string: { equals: string; }; } | { property: "type"; event_type: { equals?: "user.message" | "agent.message" | "agent.thinking" | "agent.tool_use" | "agent.tool_result" | "session.status"; in?: Array<"user.message" | "agent.message" | "agent.thinking" | "agent.tool_use" | "agent.tool_result" | "session.status">; }; } | { property: "sequence"; number: { greater_than?: number; greater_than_or_equal_to?: number; less_than?: number; less_than_or_equal_to?: number; }; } | { property: "created_at"; timestamp: { equals?: string; before?: string; after?: string; on_or_before?: string; on_or_after?: string; }; } | { and: Array<{ property: "id"; string: { equals: string; }; } | { property: "type"; event_type: { equals?: "user.message" | "agent.message" | "agent.thinking" | "agent.tool_use" | "agent.tool_result" | "session.status"; in?: Array<"user.message" | "agent.message" | "agent.thinking" | "agent.tool_use" | "agent.tool_result" | "session.status">; }; } | { property: "sequence"; number: { greater_than?: number; greater_than_or_equal_to?: number; less_than?: number; less_than_or_equal_to?: number; }; } | { property: "created_at"; timestamp: { equals?: string; before?: string; after?: string; on_or_before?: string; on_or_after?: string; }; }>; } | { or: Array<{ property: "id"; string: { equals: string; }; } | { property: "type"; event_type: { equals?: "user.message" | "agent.message" | "agent.thinking" | "agent.tool_use" | "agent.tool_result" | "session.status"; in?: Array<"user.message" | "agent.message" | "agent.thinking" | "agent.tool_use" | "agent.tool_result" | "session.status">; }; } | { property: "sequence"; number: { greater_than?: number; greater_than_or_equal_to?: number; less_than?: number; less_than_or_equal_to?: number; }; } | { property: "created_at"; timestamp: { equals?: string; before?: string; after?: string; on_or_before?: string; on_or_after?: string; }; }>; }>; } | { or: Array<{ property: "id"; string: { equals: string; }; } | { property: "type"; event_type: { equals?: "user.message" | "agent.message" | "agent.thinking" | "agent.tool_use" | "agent.tool_result" | "session.status"; in?: Array<"user.message" | "agent.message" | "agent.thinking" | "agent.tool_use" | "agent.tool_result" | "session.status">; }; } | { property: "sequence"; number: { greater_than?: number; greater_than_or_equal_to?: number; less_than?: number; less_than_or_equal_to?: number; }; } | { property: "created_at"; timestamp: { equals?: string; before?: string; after?: string; on_or_before?: string; on_or_after?: string; }; } | { and: Array<{ property: "id"; string: { equals: string; }; } | { property: "type"; event_type: { equals?: "user.message" | "agent.message" | "agent.thinking" | "agent.tool_use" | "agent.tool_result" | "session.status"; in?: Array<"user.message" | "agent.message" | "agent.thinking" | "agent.tool_use" | "agent.tool_result" | "session.status">; }; } | { property: "sequence"; number: { greater_than?: number; greater_than_or_equal_to?: number; less_than?: number; less_than_or_equal_to?: number; }; } | { property: "created_at"; timestamp: { equals?: string; before?: string; after?: string; on_or_before?: string; on_or_after?: string; }; }>; } | { or: Array<{ property: "id"; string: { equals: string; }; } | { property: "type"; event_type: { equals?: "user.message" | "agent.message" | "agent.thinking" | "agent.tool_use" | "agent.tool_result" | "session.status"; in?: Array<"user.message" | "agent.message" | "agent.thinking" | "agent.tool_use" | "agent.tool_result" | "session.status">; }; } | { property: "sequence"; number: { greater_than?: number; greater_than_or_equal_to?: number; less_than?: number; less_than_or_equal_to?: number; }; } | { property: "created_at"; timestamp: { equals?: string; before?: string; after?: string; on_or_before?: string; on_or_after?: string; }; }>; }>; }>; }; sorts?: Array<{ property: "sequence" | "created_at"; direction: "ascending" | "descending"; }>; start_cursor?: string | null; page_size?: number; }; export type QuerySessionEventsParameters = QuerySessionEventsPathParameters & QuerySessionEventsBodyParameters; export type QuerySessionEventsResponse = { object: "list"; type: "session_event"; session_event: Record; results: Array<{ object: "session_event"; id: string; session_id: string; sequence: number; created_at: string; type: "user.message"; content: Array<{ type: "text"; text: string; } | { type: "file"; name: string; content_type: string; url: string; expiry_time?: string; }>; created_by: { id: string; type: "user" | "bot"; } | null; metadata: Record | null; } | { object: "session_event"; id: string; session_id: string; sequence: number; created_at: string; type: "agent.message"; content: Array<{ type: "text"; text: string; } | { type: "file"; name: string; content_type: string; url: string; expiry_time?: string; }>; created_by: { id: string; type: "user" | "bot"; } | null; metadata: { model: string; } | null; } | { object: "session_event"; id: string; session_id: string; sequence: number; created_at: string; type: "agent.thinking"; content: Array<{ type: "text"; text: string; }>; } | { object: "session_event"; id: string; session_id: string; sequence: number; created_at: string; type: "agent.tool_use"; tool_name: string; } | { object: "session_event"; id: string; session_id: string; sequence: number; created_at: string; type: "agent.tool_result"; tool_use_id: string; tool_name: string; is_error: boolean; } | { object: "session_event"; id: string; session_id: string; sequence: number; created_at: string; type: "session.status"; status: "requires_action" | "completed" | "failed" | "canceled" | "terminated"; required_actions?: Array<{ action_id: string; title: string; options: Array<{ id: "approve" | "reject"; label: string; }>; }>; error?: { code: string; message: string; retryable: boolean; }; }>; has_more: boolean; next_cursor: string | null; }; /** * Query session events */ export declare const querySessionEvents: { readonly method: "post"; readonly pathParams: readonly ["session_id"]; readonly queryParams: readonly []; readonly bodyParams: readonly ["filter", "sorts", "start_cursor", "page_size"]; readonly path: (p: QuerySessionEventsPathParameters) => string; }; type QuerySessionsBodyParameters = { query?: string; filter?: { property: "id"; string: { equals: string; }; } | { property: "agent_id"; string: { equals: string; }; } | { property: "status"; status: { equals?: "queued" | "in_progress" | "requires_action" | "completed" | "failed" | "canceled" | "terminated"; in?: Array<"queued" | "in_progress" | "requires_action" | "completed" | "failed" | "canceled" | "terminated">; }; } | { property: "created_at" | "updated_at"; timestamp: { before?: string; after?: string; on_or_before?: string; on_or_after?: string; }; } | { and: Array<{ property: "id"; string: { equals: string; }; } | { property: "agent_id"; string: { equals: string; }; } | { property: "status"; status: { equals?: "queued" | "in_progress" | "requires_action" | "completed" | "failed" | "canceled" | "terminated"; in?: Array<"queued" | "in_progress" | "requires_action" | "completed" | "failed" | "canceled" | "terminated">; }; } | { property: "created_at" | "updated_at"; timestamp: { before?: string; after?: string; on_or_before?: string; on_or_after?: string; }; } | { and: Array<{ property: "id"; string: { equals: string; }; } | { property: "agent_id"; string: { equals: string; }; } | { property: "status"; status: { equals?: "queued" | "in_progress" | "requires_action" | "completed" | "failed" | "canceled" | "terminated"; in?: Array<"queued" | "in_progress" | "requires_action" | "completed" | "failed" | "canceled" | "terminated">; }; } | { property: "created_at" | "updated_at"; timestamp: { before?: string; after?: string; on_or_before?: string; on_or_after?: string; }; }>; } | { or: Array<{ property: "id"; string: { equals: string; }; } | { property: "agent_id"; string: { equals: string; }; } | { property: "status"; status: { equals?: "queued" | "in_progress" | "requires_action" | "completed" | "failed" | "canceled" | "terminated"; in?: Array<"queued" | "in_progress" | "requires_action" | "completed" | "failed" | "canceled" | "terminated">; }; } | { property: "created_at" | "updated_at"; timestamp: { before?: string; after?: string; on_or_before?: string; on_or_after?: string; }; }>; }>; } | { or: Array<{ property: "id"; string: { equals: string; }; } | { property: "agent_id"; string: { equals: string; }; } | { property: "status"; status: { equals?: "queued" | "in_progress" | "requires_action" | "completed" | "failed" | "canceled" | "terminated"; in?: Array<"queued" | "in_progress" | "requires_action" | "completed" | "failed" | "canceled" | "terminated">; }; } | { property: "created_at" | "updated_at"; timestamp: { before?: string; after?: string; on_or_before?: string; on_or_after?: string; }; } | { and: Array<{ property: "id"; string: { equals: string; }; } | { property: "agent_id"; string: { equals: string; }; } | { property: "status"; status: { equals?: "queued" | "in_progress" | "requires_action" | "completed" | "failed" | "canceled" | "terminated"; in?: Array<"queued" | "in_progress" | "requires_action" | "completed" | "failed" | "canceled" | "terminated">; }; } | { property: "created_at" | "updated_at"; timestamp: { before?: string; after?: string; on_or_before?: string; on_or_after?: string; }; }>; } | { or: Array<{ property: "id"; string: { equals: string; }; } | { property: "agent_id"; string: { equals: string; }; } | { property: "status"; status: { equals?: "queued" | "in_progress" | "requires_action" | "completed" | "failed" | "canceled" | "terminated"; in?: Array<"queued" | "in_progress" | "requires_action" | "completed" | "failed" | "canceled" | "terminated">; }; } | { property: "created_at" | "updated_at"; timestamp: { before?: string; after?: string; on_or_before?: string; on_or_after?: string; }; }>; }>; }; sorts?: Array<{ property: "created_at" | "updated_at"; direction: "ascending" | "descending"; }>; start_cursor?: string | null; page_size?: number; }; export type QuerySessionsParameters = QuerySessionsBodyParameters; export type QuerySessionsResponse = { object: "list"; type: "session"; session: Record; results: Array<{ object: "session"; id: string; agent_id: string; title: string; status: "queued" | "in_progress" | "requires_action" | "completed" | "failed" | "canceled" | "terminated"; created_by: { id: string; type: "user" | "bot"; }; agent_version: { id: string; number: number; published_at: string; } | null; models: { type: "auto"; } | { type: "pinned"; ids: Array; }; created_at: string; updated_at: string; required_actions?: Array<{ action_id: string; title: string; options: Array<{ id: "approve" | "reject"; label: string; }>; }>; error?: { code: string; message: string; retryable: boolean; }; trigger_type?: string; type_labels?: Array | null; chat_user_emails?: Array | null; tool_types?: Array | null; tool_call_count?: number | null; credits_used?: number | null; runs_completed?: number | null; message_count?: number | null; }>; has_more: boolean; next_cursor: string | null; }; /** * Query sessions */ export declare const querySessions: { readonly method: "post"; readonly pathParams: readonly []; readonly queryParams: readonly []; readonly bodyParams: readonly ["query", "filter", "sorts", "start_cursor", "page_size"]; readonly path: () => string; }; type QueryThreadMessagesPathParameters = { thread_id: IdRequest; }; type QueryThreadMessagesBodyParameters = { verbose?: boolean; start_cursor?: string | null; page_size?: number; }; export type QueryThreadMessagesParameters = QueryThreadMessagesPathParameters & QueryThreadMessagesBodyParameters; export type QueryThreadMessagesResponse = { object: "list"; type: "thread_message"; results: Array<{ object: "thread_message"; id: IdResponse; role: "user" | "agent"; content: string; created_time: string; parent: { type: "thread"; id: IdResponse; }; attachments?: Array<{ name: string; content_type: string; url: string; expiry_time?: string; }>; content_parts?: Array<{ type: "text"; text: string; } | { type: "thinking"; text: string; } | { type: "tool_call"; tool_call_id: string | null; tool_name: string; results?: Array<{ id: IdResponse; agent_step_id: IdResponse | null; tool_call_id: string | null; tool_name: string; tool_type: string; state: string; started_at: number; finished_at: number | null; duration_ms: number | null; }>; } | { type: "follow_ups"; follow_ups: Array<{ label: string; message: string; }>; } | { type: "custom_agent_template_picker"; }>; pending_user_actions?: Array<{ id: IdResponse; type: "tool_confirmation"; title: string; requirements: Array<{ type: "general"; } | { type: "manage_workers"; } | { type: "url_safety"; urls: Array; required_by_workspace_policy?: boolean; } | { type: "permission_escalation"; destination_title?: string; source_titles?: Array; } | { type: "delete_content"; page_count: number; database_count: number; meeting_notes_block_count?: number; } | { type: "connect_integration"; integration_type: string; integration_name: string; handoff_url: string; } | { type: "admin_mode"; explanation?: string; }>; options: Array<{ id: "approve"; label: string; } | { id: "reject"; label: string; } | { id: "use_connection"; label: string; input: { type: "connection_id"; required: true; }; }>; }>; }>; has_more: boolean; next_cursor: string | null; }; /** * Query thread messages */ export declare const queryThreadMessages: { readonly method: "post"; readonly pathParams: readonly ["thread_id"]; readonly queryParams: readonly []; readonly bodyParams: readonly ["verbose", "start_cursor", "page_size"]; readonly path: (p: QueryThreadMessagesPathParameters) => string; }; type QueryThreadsPathParameters = { agent_id: IdRequest | "notion_ai" | "33333333-3333-3333-3333-333333333333"; }; type QueryThreadsBodyParameters = { query?: string; filter?: { id?: IdRequest; status?: Array<"all" | "pending" | "in_progress" | "failed" | "success">; created_by?: Array; last_used_by?: Array; message_time?: { start?: string; end?: string; }; }; sorts?: Array<{ timestamp: "created_time" | "last_used_time"; direction: "ascending" | "descending"; }>; start_cursor?: string | null; page_size?: number; }; export type QueryThreadsParameters = QueryThreadsPathParameters & QueryThreadsBodyParameters; export type QueryThreadsResponse = { object: "list"; type: "thread"; results: Array<{ object: "thread"; id: IdResponse; title: string; status: "pending" | "requires_action" | "completed" | "canceled" | "failed"; created_time: string; last_edited_time: string; created_by: { id: IdResponse; type: "bot" | "user"; }; agent_version: { id: IdResponse; number: number; published_at: string; } | null; models: { type: "auto"; } | { type: "pinned"; ids: Array; }; error?: string; trigger_type?: string; type_labels?: Array | null; chat_user_emails?: Array | null; tool_types?: Array | null; tool_call_count?: number | null; credits_used?: number | null; runs_completed?: number | null; pending_user_actions?: Array<{ id: IdResponse; type: "tool_confirmation"; title: string; requirements: Array<{ type: "general"; } | { type: "manage_workers"; } | { type: "url_safety"; urls: Array; required_by_workspace_policy?: boolean; } | { type: "permission_escalation"; destination_title?: string; source_titles?: Array; } | { type: "delete_content"; page_count: number; database_count: number; meeting_notes_block_count?: number; } | { type: "connect_integration"; integration_type: string; integration_name: string; handoff_url: string; } | { type: "admin_mode"; explanation?: string; }>; options: Array<{ id: "approve"; label: string; } | { id: "reject"; label: string; } | { id: "use_connection"; label: string; input: { type: "connection_id"; required: true; }; }>; }>; }>; has_more: boolean; next_cursor: string | null; }; /** * Query threads */ export declare const queryThreads: { readonly method: "post"; readonly pathParams: readonly ["agent_id"]; readonly queryParams: readonly []; readonly bodyParams: readonly ["query", "filter", "sorts", "start_cursor", "page_size"]; readonly path: (p: QueryThreadsPathParameters) => string; }; type RetrieveSessionPathParameters = { session_id: IdRequest; }; export type RetrieveSessionParameters = RetrieveSessionPathParameters; export type RetrieveSessionResponse = { object: "session"; id: string; agent_id: string; title: string; status: "queued" | "in_progress" | "requires_action" | "completed" | "failed" | "canceled" | "terminated"; created_at: string; updated_at: string; created_by: { id: string; type: "user" | "bot"; }; agent_version: { id: string; number: number; published_at: string; } | null; models: { type: "auto"; } | { type: "pinned"; ids: Array; }; required_actions?: Array<{ action_id: string; title: string; options: Array<{ id: "approve" | "reject"; label: string; }>; }>; error?: { code: string; message: string; retryable: boolean; }; trigger_type?: string; type_labels?: Array | null; chat_user_emails?: Array | null; tool_types?: Array | null; tool_call_count?: number | null; credits_used?: number | null; runs_completed?: number | null; message_count?: number | null; }; /** * Retrieve a session */ export declare const retrieveSession: { readonly method: "get"; readonly pathParams: readonly ["session_id"]; readonly queryParams: readonly []; readonly bodyParams: readonly []; readonly path: (p: RetrieveSessionPathParameters) => string; }; type SendExternalAgentStubSessionMessagePathParameters = { agent_id: IdRequest | "33333333-3333-3333-3333-333333333333"; session_id: IdRequest; }; type SendExternalAgentStubSessionMessageBodyParameters = { message: string; client_message_id?: string; }; export type SendExternalAgentStubSessionMessageParameters = SendExternalAgentStubSessionMessagePathParameters & SendExternalAgentStubSessionMessageBodyParameters; export type SendExternalAgentStubSessionMessageResponse = { accepted: boolean; run_id?: string; }; /** * Send external agent stub session message */ export declare const sendExternalAgentStubSessionMessage: { readonly method: "post"; readonly pathParams: readonly ["agent_id", "session_id"]; readonly queryParams: readonly []; readonly bodyParams: readonly ["message", "client_message_id"]; readonly path: (p: SendExternalAgentStubSessionMessagePathParameters) => string; }; type StartExternalAgentStubSessionPathParameters = { agent_id: IdRequest | "33333333-3333-3333-3333-333333333333"; }; type StartExternalAgentStubSessionBodyParameters = { spec_version?: "v1"; client_reference_id?: string; configs?: { mcp_servers: Array<{ name: string; server_url: string; credential: { type: "vault"; vault_id: string; } | { type: "none"; }; }>; }; model?: string; cwd?: string; locale?: string; system_prompt?: string; }; export type StartExternalAgentStubSessionParameters = StartExternalAgentStubSessionPathParameters & StartExternalAgentStubSessionBodyParameters; export type StartExternalAgentStubSessionResponse = { session_id: string; model?: string; cwd?: string; last_active_at?: string; }; /** * Start external agent stub session */ export declare const startExternalAgentStubSession: { readonly method: "post"; readonly pathParams: readonly ["agent_id"]; readonly queryParams: readonly []; readonly bodyParams: readonly ["spec_version", "client_reference_id", "configs", "model", "cwd", "locale", "system_prompt"]; readonly path: (p: StartExternalAgentStubSessionPathParameters) => string; }; type UpdateAgentCreditLimitPathParameters = { agent_id: IdRequest | "notion_ai" | "33333333-3333-3333-3333-333333333333"; }; type UpdateAgentCreditLimitBodyParameters = { credit_limit: number | null; }; export type UpdateAgentCreditLimitParameters = UpdateAgentCreditLimitPathParameters & UpdateAgentCreditLimitBodyParameters; export type UpdateAgentCreditLimitResponse = { agent_id: IdResponse; credit_limit: number | null; last_edited_time: string; }; /** * Update agent credit limit */ export declare const updateAgentCreditLimit: { readonly method: "patch"; readonly pathParams: readonly ["agent_id"]; readonly queryParams: readonly []; readonly bodyParams: readonly ["credit_limit"]; readonly path: (p: UpdateAgentCreditLimitPathParameters) => string; }; type UpdateAgentStatusPathParameters = { agent_id: IdRequest | "notion_ai" | "33333333-3333-3333-3333-333333333333"; }; type UpdateAgentStatusBodyParameters = { status: "active" | "disabled"; }; export type UpdateAgentStatusParameters = UpdateAgentStatusPathParameters & UpdateAgentStatusBodyParameters; export type UpdateAgentStatusResponse = { agent_id: IdResponse; status: "active" | "disabled" | "deleted"; pause_reason: "run_limit" | "credit_limit" | "runaway_credit_usage" | "workspace_credit_limit" | "failure_limit" | "mark_session_failed_autopause" | "disabled_from_workspace_settings" | "disabled_from_api" | "disabled_from_agent_settings" | "disabled_due_to_no_members_with_access" | "disabled_due_to_lack_of_editors" | "disabled_by_notion" | "internal_error" | "needs_user_review" | "tool_unavailable" | null; last_edited_time: string; }; /** * Update agent status */ export declare const updateAgentStatus: { readonly method: "patch"; readonly pathParams: readonly ["agent_id"]; readonly queryParams: readonly []; readonly bodyParams: readonly ["status"]; readonly path: (p: UpdateAgentStatusPathParameters) => string; }; type UpdateSessionBodyParameters = { message: string; agent_id?: IdRequest | "notion_ai" | "33333333-3333-3333-3333-333333333333"; session_id?: IdRequest; attachments?: Array<{ file_upload: { id: string; }; type?: "file_upload"; name?: string; }>; metadata?: Record; prompt_context?: string; } | { session_id: IdRequest; actions: Array<{ action_id: IdRequest; option_id: "approve" | "reject"; }>; metadata?: Record; } | { session_id: IdRequest; continue_from: string; }; export type UpdateSessionParameters = UpdateSessionBodyParameters; export type UpdateSessionResponse = { object: "session"; id: string; agent_id: string; title: string; status: "queued" | "in_progress" | "requires_action" | "completed" | "failed" | "canceled" | "terminated"; created_at: string; updated_at: string; required_actions?: Array<{ action_id: string; title: string; options: Array<{ id: "approve" | "reject"; label: string; }>; }>; error?: { code: string; message: string; retryable: boolean; }; }; /** * Update a session */ export declare const updateSession: { readonly method: "post"; readonly pathParams: readonly []; readonly queryParams: readonly []; readonly bodyParams: readonly ["message", "agent_id", "session_id", "attachments", "metadata", "prompt_context", "actions", "continue_from"]; readonly path: () => string; }; export {}; //# sourceMappingURL=agents.d.ts.map