Create Scenarios
curl --request POST \
--url https://app.backend.genezio.ai/customer/v1/brands/{brand_id}/scenarios \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"scenarios": [
{
"text": "Which noise-cancelling headphones are best for a commute?",
"topic_id": 123,
"status": "active"
}
],
"dry_run": false
}
'import requests
url = "https://app.backend.genezio.ai/customer/v1/brands/{brand_id}/scenarios"
payload = {
"scenarios": [
{
"text": "Which noise-cancelling headphones are best for a commute?",
"topic_id": 123,
"status": "active"
}
],
"dry_run": False
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
scenarios: [
{
text: 'Which noise-cancelling headphones are best for a commute?',
topic_id: 123,
status: 'active'
}
],
dry_run: false
})
};
fetch('https://app.backend.genezio.ai/customer/v1/brands/{brand_id}/scenarios', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": [
{
"created_at": "2023-11-07T05:31:56Z",
"id": 123,
"status": "<string>",
"text": "<string>",
"topic_id": 123
}
],
"info": {
"dry_run": true,
"rejected": 123,
"written": 123
},
"rejected": [
{
"code": "not_found",
"index": 123,
"message": "<string>"
}
]
}{
"error": {
"code": "brand_access_denied",
"message": "This API key has no access to this brand",
"details": [
{
"field": "page_size",
"message": "Input should be less than or equal to 100"
}
],
"request_id": "4f3c2e1a-9b7d-4c1e-8f2a-1d3e5b7c9a0f"
}
}{
"error": {
"code": "brand_access_denied",
"message": "This API key has no access to this brand",
"details": [
{
"field": "page_size",
"message": "Input should be less than or equal to 100"
}
],
"request_id": "4f3c2e1a-9b7d-4c1e-8f2a-1d3e5b7c9a0f"
}
}{
"error": {
"code": "brand_access_denied",
"message": "This API key has no access to this brand",
"details": [
{
"field": "page_size",
"message": "Input should be less than or equal to 100"
}
],
"request_id": "4f3c2e1a-9b7d-4c1e-8f2a-1d3e5b7c9a0f"
}
}{
"error": {
"code": "brand_access_denied",
"message": "This API key has no access to this brand",
"details": [
{
"field": "page_size",
"message": "Input should be less than or equal to 100"
}
],
"request_id": "4f3c2e1a-9b7d-4c1e-8f2a-1d3e5b7c9a0f"
}
}{
"error": {
"code": "brand_access_denied",
"message": "This API key has no access to this brand",
"details": [
{
"field": "page_size",
"message": "Input should be less than or equal to 100"
}
],
"request_id": "4f3c2e1a-9b7d-4c1e-8f2a-1d3e5b7c9a0f"
}
}{
"error": {
"code": "brand_access_denied",
"message": "This API key has no access to this brand",
"details": [
{
"field": "page_size",
"message": "Input should be less than or equal to 100"
}
],
"request_id": "4f3c2e1a-9b7d-4c1e-8f2a-1d3e5b7c9a0f"
}
}{
"error": {
"code": "brand_access_denied",
"message": "This API key has no access to this brand",
"details": [
{
"field": "page_size",
"message": "Input should be less than or equal to 100"
}
],
"request_id": "4f3c2e1a-9b7d-4c1e-8f2a-1d3e5b7c9a0f"
}
}Scenarios
Create Scenarios
Create up to 100 scenarios, in one or more topics of the brand.
Each item is written or rejected on its own: a scenario of a topic of
another brand, or a scenario that its topic already has, is in rejected
with its index, and the other items are written. When the plan of the
account cannot hold the new scenarios, nothing is written (403
plan_limit_reached). A new scenario runs with the next run of its topic.
POST
/
customer
/
v1
/
brands
/
{brand_id}
/
scenarios
Create Scenarios
curl --request POST \
--url https://app.backend.genezio.ai/customer/v1/brands/{brand_id}/scenarios \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"scenarios": [
{
"text": "Which noise-cancelling headphones are best for a commute?",
"topic_id": 123,
"status": "active"
}
],
"dry_run": false
}
'import requests
url = "https://app.backend.genezio.ai/customer/v1/brands/{brand_id}/scenarios"
payload = {
"scenarios": [
{
"text": "Which noise-cancelling headphones are best for a commute?",
"topic_id": 123,
"status": "active"
}
],
"dry_run": False
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
scenarios: [
{
text: 'Which noise-cancelling headphones are best for a commute?',
topic_id: 123,
status: 'active'
}
],
dry_run: false
})
};
fetch('https://app.backend.genezio.ai/customer/v1/brands/{brand_id}/scenarios', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": [
{
"created_at": "2023-11-07T05:31:56Z",
"id": 123,
"status": "<string>",
"text": "<string>",
"topic_id": 123
}
],
"info": {
"dry_run": true,
"rejected": 123,
"written": 123
},
"rejected": [
{
"code": "not_found",
"index": 123,
"message": "<string>"
}
]
}{
"error": {
"code": "brand_access_denied",
"message": "This API key has no access to this brand",
"details": [
{
"field": "page_size",
"message": "Input should be less than or equal to 100"
}
],
"request_id": "4f3c2e1a-9b7d-4c1e-8f2a-1d3e5b7c9a0f"
}
}{
"error": {
"code": "brand_access_denied",
"message": "This API key has no access to this brand",
"details": [
{
"field": "page_size",
"message": "Input should be less than or equal to 100"
}
],
"request_id": "4f3c2e1a-9b7d-4c1e-8f2a-1d3e5b7c9a0f"
}
}{
"error": {
"code": "brand_access_denied",
"message": "This API key has no access to this brand",
"details": [
{
"field": "page_size",
"message": "Input should be less than or equal to 100"
}
],
"request_id": "4f3c2e1a-9b7d-4c1e-8f2a-1d3e5b7c9a0f"
}
}{
"error": {
"code": "brand_access_denied",
"message": "This API key has no access to this brand",
"details": [
{
"field": "page_size",
"message": "Input should be less than or equal to 100"
}
],
"request_id": "4f3c2e1a-9b7d-4c1e-8f2a-1d3e5b7c9a0f"
}
}{
"error": {
"code": "brand_access_denied",
"message": "This API key has no access to this brand",
"details": [
{
"field": "page_size",
"message": "Input should be less than or equal to 100"
}
],
"request_id": "4f3c2e1a-9b7d-4c1e-8f2a-1d3e5b7c9a0f"
}
}{
"error": {
"code": "brand_access_denied",
"message": "This API key has no access to this brand",
"details": [
{
"field": "page_size",
"message": "Input should be less than or equal to 100"
}
],
"request_id": "4f3c2e1a-9b7d-4c1e-8f2a-1d3e5b7c9a0f"
}
}{
"error": {
"code": "brand_access_denied",
"message": "This API key has no access to this brand",
"details": [
{
"field": "page_size",
"message": "Input should be less than or equal to 100"
}
],
"request_id": "4f3c2e1a-9b7d-4c1e-8f2a-1d3e5b7c9a0f"
}
}Authorizations
An API key of your account, from Settings > API Keys. It starts with gnz-.
Headers
Any unique string, such as a UUID. Send the same key again to get the first answer and not a second write. The API keeps an answer for 24 hours.
Path Parameters
Body
application/json