Ask about a campaign (streaming)
curl --request POST \
--url https://api.pineyard.ai/campaigns/{id}/chat/stream \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"message": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({message: '<string>'})
};
fetch('https://api.pineyard.ai/campaigns/{id}/chat/stream', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.pineyard.ai/campaigns/{id}/chat/stream"
payload = { "message": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"type": "delta",
"text": "<string>",
"message": "<string>"
}Results & insights
Ask about a campaign (streaming)
Ask a question about a campaign’s results and stream the answer as newline-delimited JSON (application/x-ndjson). Each line is an event object with a type (delta with a text fragment, done with the full text, or error with a message). Each campaign conversation has a fair-use message cap (429 message_limit_reached).
POST
/
campaigns
/
{id}
/
chat
/
stream
Ask about a campaign (streaming)
curl --request POST \
--url https://api.pineyard.ai/campaigns/{id}/chat/stream \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"message": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({message: '<string>'})
};
fetch('https://api.pineyard.ai/campaigns/{id}/chat/stream', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.pineyard.ai/campaigns/{id}/chat/stream"
payload = { "message": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"type": "delta",
"text": "<string>",
"message": "<string>"
}Required scope:
intel.view
Requires a plan that includes business intelligence (ai tier). Otherwise the request is refused; see Errors.
Authorizations
Your API key, e.g. pk_live_xxxxxxxxxxxxxxxxxxxxxxxx.
Path Parameters
Campaign ID
Body
application/json
Required string length:
1 - 4000
