Running into a wall trying to trigger an Architect flow from my Kotlin Android app. I’ve got the OAuth token sorted and the flow ID is definitely valid (copied straight from the UI). When I hit POST /api/v2/flows/executions, I get a 400 Bad Request with error_code: invalid_request_body.
Here’s the Retrofit call setup:
@POST("api/v2/flows/executions")
suspend fun triggerFlow(
@Header("Authorization") auth: String,
@Body body: FlowExecutionRequest
): Response<FlowExecutionResponse>
// Data class
@JsonClass(generateAdapter = true)
data class FlowExecutionRequest(
val flowId: String,
val customData: Map<String, String>? = null
)
The JSON being sent looks correct in the logs:
{
"flowId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"customData": {
"userId": "12345",
"sessionToken": "xyz"
}
}
I’ve tried removing customData, changing the map to a simple object, and even sending an empty body with just the flow ID. Same 400 error every time. The docs say customData is optional, so it shouldn’t be the issue. Is there a specific content-type header requirement I’m missing? Or does the SDK expect a different structure for the request body? Checked the network tab and the payload looks fine.