How to initialize dynamic state variables in ChatKit (Hosted) from frontend or backend

I’m exploring ways to initialize workflow state dynamically in ChatKit (Hosted) at session creation time — for example, to inject user context or configuration before the chat starts.

When calling the /v1/chatkit/sessions endpoint from the backend, adding extra fields such as inputs or state results in:

“Unknown parameter: ‘inputs’”

This suggests the Hosted ChatKit API doesn’t currently accept additional parameters beyond workflow, version, and user.

Is there a supported or recommended method to pass initial state or context into a workflow when using ChatKit Hosted?
For example, can this be done through the session creation API, a custom action after the component loads, or another mechanism — without having to define defaults directly inside the workflow?

2 Likes

I am curious on this also. I have not found a way to do this yet. I would like to pass things like user selected items from the front end to determine which vector store to use for file search.

I’ve scoured the docs and can’t figure this out either.

Looks like it’s a parameter on workflow?

https://platform.openai.com/docs/api-reference/chatkit/sessions/create

1 Like