Invoke Portal Copilot Action
POST
/v1/portal/copilot/actions
const url = 'https://example.com/v1/portal/copilot/actions?tenant_id=';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"page_path":"/","surface_key":"portal","entity_ref":"","selected_text":"","draft_target_id":"","instruction_notes":"","interaction_manifest":[{"id":"example","kind":"scroll","label":"example","description":"","value_hint":"","widget_role":"","owner_surface":"","priority":0}],"action_id":"example","thread_id":"","payload":{}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url 'https://example.com/v1/portal/copilot/actions?tenant_id=' \ --header 'Content-Type: application/json' \ --data '{ "page_path": "/", "surface_key": "portal", "entity_ref": "", "selected_text": "", "draft_target_id": "", "instruction_notes": "", "interaction_manifest": [ { "id": "example", "kind": "scroll", "label": "example", "description": "", "value_hint": "", "widget_role": "", "owner_surface": "", "priority": 0 } ], "action_id": "example", "thread_id": "", "payload": {} }'Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”tenant_id
Tenant Id
string
Header Parameters
Section titled “Header Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
PortalCopilotActionIn
object
page_path
Page Path
string
surface_key
Surface Key
string
entity_ref
Entity Ref
string
selected_text
Selected Text
string
draft_target_id
Draft Target Id
string
instruction_notes
Instruction Notes
string
interaction_manifest
Interaction Manifest
Array<object>
PortalCopilotInteractionBindingInobject
id
required
Id
string
kind
required
Kind
string
label
required
Label
string
description
Description
string
value_hint
Value Hint
string
widget_role
Widget Role
string
owner_surface
Owner Surface
string
priority
Priority
integer
action_id
required
Action Id
string
thread_id
Thread Id
string
payload
Payload
object
key
additional properties
any
Responses
Section titled “Responses”Successful Response
Media typeapplication/json
PortalCopilotMessageOut
object
thread_id
required
Thread Id
string
status
Status
string
message
required
Message
string
capabilities
Capabilities
Array<object>
PortalCopilotCapabilityobject
action_id
required
Action Id
string
label
required
Label
string
summary
Summary
string
state
State
string
reason
Reason
string
tool_calls
Tool Calls
Array<object>
PortalCopilotToolCallOutobject
id
required
Id
string
name
required
Name
string
state
State
string
description
required
Description
string
selector
Selector
string
value
Value
string
policy_reason
Policy Reason
string
ui_artifacts
Ui Artifacts
Array<object>
object
key
additional properties
any
Example
{ "status": "answered", "capabilities": [ { "summary": "", "state": "allowed", "reason": "" } ], "tool_calls": [ { "name": "page.scroll", "state": "proposed", "selector": "", "value": "", "policy_reason": "" } ]}Validation Error
Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationErrorobject
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object
Examplegenerated
{ "detail": [ { "loc": [ "example" ], "msg": "example", "type": "example", "input": "example", "ctx": {} } ]}