target selects the scope: NEWSLETTER (all items, used for the first generation and for a whole regeneration), ITEM (one existing AI-generated item) or NEW_ITEM (a new block at order, for example a custom graph). The AI works from the stored brief of the newsletter. With autoApply: true the backend accepts the proposal when it is ready, without a separate PATCH. A newsletter has at most one open proposal (GENERATING or READY), referenced by Newsletter.openProposalId. A new request while a proposal is GENERATING returns 409. A new request while a proposal is READY rejects that proposal first.Authorization: Bearer ********************offline_access-Offline accessopenid-OpenIDprofile-Profileemail-Emailcurl --location 'https://api.belga.press/belgapress/api/newsletters//proposals' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"target": "NEWSLETTER",
"itemId": 0,
"itemType": "HEADING",
"order": 0,
"instruction": "string",
"autoApply": false
}'{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"target": "NEWSLETTER",
"itemId": 0,
"itemType": "HEADING",
"order": 0,
"instruction": "string",
"autoApply": true,
"brief": {
"prompt": "string",
"scope": {
"boards": false,
"labels": false,
"feeds": false
}
},
"status": "GENERATING",
"progress": {
"step": "SELECTING_ARTICLES",
"percent": 0
},
"error": {
"code": "AI_GENERATION_NOT_ALLOWED",
"message": "string"
},
"items": [
{
"fields": {
"dateRangeType": "TODAY",
"labelIds": [
0
],
"order": "MANUAL",
"orderArray": [
"string"
]
},
"note": "string",
"order": 0,
"title": "string",
"type": "HEADING",
"ref": "string",
"sourceArticleCount": 0
}
],
"createdAt": "2019-08-24T14:15:22.123Z",
"completedAt": "2019-08-24T14:15:22.123Z",
"expiresAt": "2019-08-24T14:15:22.123Z"
}