Tasks
Run an agent task with streaming response
Changed onExecute an agent task by ID to generate AI output with Server-Sent Events (SSE) streaming. The selected task version supplies its saved agent defaults for omitted IQ fields; valid request IQ fields take precedence. Provides real-time content as it is generated.
post/v1/tasks/{id}/run/stream
Request
- Base URLhttps://api.jasper.ai
- URLhttps://api.jasper.ai/v1/tasks/{id}/run/stream
- Auth
- API key in header X-API-Key
- or OAuth 2Authorization code: https://api.jasper.ai/oauth2/authorizeToken URL: https://api.jasper.ai/oauth2/token scopes: user
Path parameters
idstring required
Example:agt_0190f3a1b2c34d5e6f7a8b9c0d1e2f3a
The external ID (agt_…) or internal UUID of the agent task to run
Request body
Example request
{
"contextItems": [
{
"id": "70346737-878b-4329-a4d6-9a054efef508",
"value": [
"Registration reminder email",
"Confirmation email"
]
},
{
"name": "Greeting",
"question": "Who is the person that you want me to greet in the registration reminder email?",
"answer": "John Doe"
}
],
"version": 1,
"toLanguage": "EN-US",
"knowledgeIds": [
"kno_123",
"kno_456"
],
"products": [
{
"productId": "prd_073D2D49094A4AED991A47B614522579",
"attributeIds": [
"atr_535B1EC15F5F41EAB1B400E9ED4077B6"
]
}
],
"attachmentIds": [
"tmp_2ee766eaa4ef48e59da1d9602bfecf2d"
],
"toneId": "ton_2ee766eaa4ef48e59da1d9602bfecf2d",
"audienceId": "aud_123",
"audienceIds": {
"primary": "aud_2ee766eaa4ef48e59da1d9602bfecf2d",
"secondary": [
"aud_7c1f0b9d2e4a4f6b8d3c5a1e9f0b2c4d"
]
},
"styleGuideId": "sty_123",
"visualGuidelineId": "iqi_01a18cbff6317442800af05496eec95b",
"tools": [
"WEB_SEARCH",
"KNOWLEDGE_SEARCH"
]
}Response
Stream of step updates and text chunks. The terminal event includes outputs; IMAGE outputs carry assetId, name, and a temporary signed download URL in url.
Example response
{
"step": {
"id": "f1d3b309-67bd-4054-a852-8806bc1a5344",
"status": "loading",
"label": "Generating content"
}
}Changes
- warning
removed the request property
- info
added the new optional request property
- info
added the new optional request property
- info
added the new optional request property
- info
added the new optional request property
- info
the
request property default valuewas removed
- warning