Skip to main content

enterprise_ai.channels

Source: sdks/python/src/enterprise_ai/channels/__init__.py. Back to the Python SDK reference index.

note

This page is generated by tools/docs/gen_sdk_reference.py from the SDK sources and the OpenAPI text folders. Do not edit it by hand: change the source and regenerate.

Class ChannelsClient​

/v1/channels.

Resource

ChannelsClient.create​

create(manifest: dict[str, Any], project: str | None = None) -> Any

Create or update a channel. Applies a Channel manifest (apply_status: created or updated); project (id or slug, default the X-Project header) attaches it to a project, and a channel of another project is never taken over (409 channel_project_conflict). The agent_ref agent must exist (404 agent_not_found); signed_webhook needs auth.secret_ref (422 invalid_manifest). Needs tenant_admin, developer or application_owner. Audited as channel.apply.

Route: /v1/channels (POST).

NameTypeDefaultRequiredDescription
manifestdict[str, Any]yesChannel Manifest of the new channel, sent as the request body.
projectstr | NoneNonenoIdentifier (UUID) or slug of the project the channel belongs to. Default: the X-Project header.

Returns: Any. Decoded JSON answer of the operation "Create or update a channel".

Raises: the typed errors of the transport (Errors).

ChannelsClient.delete​

delete(name: str) -> Any

Delete a channel. Deletes the channel. Needs tenant_admin. 404 channel_not_found. Audited as channel.delete.

Route: /v1/channels/{name} (DELETE).

NameTypeDefaultRequiredDescription
namestryesName of the channel.

Returns: Any. Decoded JSON answer of the operation "Delete a channel".

Raises: the typed errors of the transport (Errors).

ChannelsClient.get​

get(name: str) -> Any

Get a channel. Returns the channel with its manifest, type, agent, status, project and preset. 404 channel_not_found.

Route: /v1/channels/{name} (GET).

NameTypeDefaultRequiredDescription
namestryesName of the channel.

Returns: Any. Decoded JSON answer of the operation "Get a channel".

Raises: the typed errors of the transport (Errors).

ChannelsClient.inbound​

inbound(name: str, text: str, user: str | None = None, conversation_id: str | None = None, **extra: Any) -> Any

Post an inbound message. Delivers a message from an end user (202) and returns session_id, session_created, message_id, run_id (or run_skipped when the agent is not active) and the DLP result. Needs tenant_admin, developer or agent. Steps: 1. The channel must be active (409 channel_disabled); a signed_webhook channel checks X-EAI-Signature (t=<unix seconds>,v1=<hex HMAC-SHA256 of "<t>." + raw body>, 5 minute window; 401 invalid_signature). 2. The policy channel.inbound is evaluated; size (413 message_too_large) and rate per user (429 rate_limited) are checked. 3. Inbound DLP runs (default detect; block answers 403 dlp_blocked, mask stores the masked text). 4. The open session of the user and conversation is reused, or a new one opened (429 too_many_sessions, 409 session_closed past max_session_minutes). 5. The message is added and a run of the channel agent starts with trigger channel.

Route: /v1/channels/{name}/inbound (POST).

NameTypeDefaultRequiredDescription
namestryesName of the channel.
textstryesText of the inbound message given to the agent.
userstr | NoneNonenoIdentifier of the sender on the channel, optional.
conversation_idstr | NoneNonenoConversation the message belongs to (up to 200 characters). A new one is generated when omitted.
**extraAnynoExtra fields merged into the request body.

Returns: Any. Decoded JSON answer of the operation "Post an inbound message".

Raises: the typed errors of the transport (Errors).

ChannelsClient.list​

list(project: str | None = None, **page: Any) -> Any

List the channels. Channels of the tenant in name order; project (id or slug) keeps the channels of that project only (404 project_not_found). One page only.

Route: /v1/channels (GET).

NameTypeDefaultRequiredDescription
projectstr | NoneNonenoIdentifier (UUID) or slug of the project whose channels are listed.
**pageAnynoPagination options passed to the listing: limit (maximum number of items per page) and cursor (the next_cursor of the previous page). Iterating the returned page follows every cursor.

Returns: Any. Decoded JSON answer of the operation "List the channels".

Raises: the typed errors of the transport (Errors).

ChannelsClient.sessions​

sessions(name: str, **page: Any) -> Any

List the sessions of a channel. Sessions opened on the channel, most recently updated first, at most 500.

Route: /v1/channels/{name}/sessions (GET).

NameTypeDefaultRequiredDescription
namestryesName of the channel.
**pageAnynoPagination options passed to the listing: limit (maximum number of items per page) and cursor (the next_cursor of the previous page). Iterating the returned page follows every cursor.

Returns: Any. Decoded JSON answer of the operation "List the sessions of a channel".

Raises: the typed errors of the transport (Errors).

ChannelsClient.update​

update(name: str, **changes: Any) -> Any

Update a channel. Changes the status (active or disabled; a disabled channel refuses inbound messages) or the owner. Needs tenant_admin, developer or application_owner. Audited as channel.update.

Route: /v1/channels/{name} (PATCH).

NameTypeDefaultRequiredDescription
namestryesName of the channel.
**changesAnynoFields of the channel to change, sent as the PATCH body.

Returns: Any. Decoded JSON answer of the operation "Update a channel".

Raises: the typed errors of the transport (Errors).