I’m building a React Native app that integrates with an AIP Agent using the Foundry Streaming API (/api/v2/aipAgents/…/streamingContinue). I need to pass user context (userId and timezone) to the agent via parameterInputs.
My Agent Configuration
I have two application state variables configured in AIP Agent Studio:
currentUserId (String type)
userTimezone (String type)
When I call the Get Agent API, I see they’re configured as:
json{
“currentUserId”: {
“parameterType”: {“type”: “string”, “defaultValue”: “”},
“access”: “READ_ONLY”,
“description”: “”
},
“userTimezone”: {
“parameterType”: {“type”: “string”, “defaultValue”: “”},
“access”: “READ_ONLY”,
“description”: “The user’s home timezone”
}
}
My API Request
Following the API documentation for ParameterValue structure, I’m sending to the streamingContinue endpoint:
Request URL:
POST /api/v2/aipAgents/agents/{agentRid}/sessions/{sessionRid}/streamingContinue?preview=true
Request Body:
json{
“messageId”: “a115561xxxxxx6”,
“userInput”: {
“text”: “Create a dinner event tomorrow at 7 PM”
},
“parameterInputs”: {
“currentUserId”: {
“string”: {
“value”: “b9ef1be9-320ssssss64f142”
}
},
“userTimezone”: {
“string”: {
“value”: “America/Chicago”
}
}
}
}
The Error
I consistently get a 400 Bad Request with:
json{
“errorCode”: “INVALID_ARGUMENT”,
“errorName”: “InvalidJson”,
“errorInstanceId”: “d10b519xxxxxxxxx0140”,
“parameters”: {}
}
The response comes back in ~28ms, suggesting it’s failing validation before reaching the agent.
What I’ve Tried
Verified the JSON structure matches the API docs for string ParameterValue
Tested without parameterInputs - works fine (but agent can’t access context)
Tried flat structure (“currentUserId”: “user-123”) - same error
Verified parameter names match exactly (case-sensitive)
Confirmed preview=true is in the query string
Tested with both blockingContinue and streamingContinue - same error
My Questions
Can READ_ONLY parameters accept values via parameterInputs?
The documentation states “Use the parameterInputs field in requests to provide inputs” but doesn’t clarify how this interacts with the access field in the agent configuration.
What is the correct access level for parameters that should be:
Written by the API (from my React Native app)
Read by the Agent (to use in event creation)
Not written by the Agent
Where in AIP Agent Studio can I change the access level?
I see “Agent can see the variable value” toggle in the parameter configuration
But I don’t see an explicit READ_ONLY/READ_WRITE/READ setting
Is the access level configured somewhere else?
For streaming API specifically, is there a different format expected for parameterInputs?
Alternative approaches: If READ_ONLY parameters can’t accept API inputs, what’s the recommended way to pass user-specific context (userId, timezone) to an agent?
Reference Documentation
From the API docs:
parameterInputs map<ParameterId, ParameterValue> (optional)
Any supplied values for application variables to pass to the Agent for the exchange.
ParameterValue (union)
The value provided for a variable configured in the application state of an Agent.
string (object, optional): A value passed for StringParameter application variable types.
value (string)
Example from docs (using objectSet type):
json{
“messageId”: “00f8412a-c29d-4063-a417-8052825285a5”,
“userInput”: {“text”: “What is the status of my order?”},
“parameterInputs”: {
“currentCustomerOrders”: {
“type”: “objectSet”,
“ontology”: “example-ontology”,
“objectSet”: {…}
}
}
}
The docs show objectSet parameters but don’t show a complete example of string parameters.
Environment
Endpoint: /api/v2/aipAgents/agents/{agentRid}/sessions/{sessionRid}/streamingContinue?preview=true
Agent version: 9.0
Integration: Custom React Native mobile app via REST API
Testing with both iOS simulator and actual logs confirm the same error
Additional Context
When I omit parameterInputs entirely, the agent responds but says “I wasn’t able to access your user information just yet” - confirming the agent is looking for these variables but they’re not being passed successfully.
Any guidance on the correct way to pass string parameters to the streaming API would be greatly appreciated!