curl --request POST \
--url https://api.tryfuse.ai/api/v1/business/campaigns/{campaignId}/steps/{stepId}/generate \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://api.tryfuse.ai/api/v1/business/campaigns/{campaignId}/steps/{stepId}/generate"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://api.tryfuse.ai/api/v1/business/campaigns/{campaignId}/steps/{stepId}/generate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"stepId": "6a8dce156dc0b3d9029c22d7",
"preview": {
"subject": "Quick question about BrightPay's finance hiring",
"body": "<p>Hi Imogen, saw BrightPay is scaling its finance team. Worth a 15-minute chat next week?</p>",
"channel": "email",
"type": "manual",
"contact": {
"id": "237d2bafce67c35eee9f011d",
"name": "Imogen Low",
"email": "imogen@brightpay.com",
"jobTitle": "Software Engineer",
"companyName": "BrightPay"
}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"param": "<string>",
"doc_url": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"param": "<string>",
"doc_url": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"param": "<string>",
"doc_url": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"param": "<string>",
"doc_url": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"param": "<string>",
"doc_url": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"param": "<string>",
"doc_url": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"param": "<string>",
"doc_url": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"param": "<string>",
"doc_url": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"param": "<string>",
"doc_url": "<string>",
"request_id": "<string>"
}
}Render the step for a sample lead without saving or sending
Renders this step for one sample contact from the campaign’s source lists - tokens filled and spintax resolved - and returns the result WITHOUT saving it and without sending anything. Use it to check a manual step’s copy, or to see what an AI step will write. contact names the lead the preview was rendered against. If the campaign has no contact to render against, the answer is 422 STEP_PREVIEW_UNAVAILABLE. Only the token owner may preview. Rate limit: this endpoint has a tighter cap of 20 requests/minute and 300/day, applied inside the shared campaigns bucket of 30 requests/minute and 1,000/day per token owner (shared by every campaign, scheduled-send, campaign-template and knowledge-hub endpoint).
Errors:
404CAMPAIGN_NOT_FOUND— No campaign with this id exists, it belongs to another account (including a campaign delegated to you or shared by your team’s visibility settings), or it has been deleted.404SEQUENCE_STEP_NOT_FOUND— No step with this id belongs to this campaign.422STEP_PREVIEW_UNAVAILABLE— There is nothing to render this step against: the campaign has no source list or no contact to sample, or generation produced no preview.422VALIDATION_FAILED— campaignId or stepId is not a 24-character hex id.429RATE_LIMITED— Either this endpoint’s own cap (20 requests/minute, 300/day) or the shared campaigns bucket (30/minute, 1,000/day for this token owner, shared by every /business/campaigns, /business/scheduled-sends, /business/campaign-templates and /business/knowledge-hubs call) was exceeded. The RateLimit-* headers on the response describe the shared bucket, so a refusal from this endpoint’s own cap can still report requests remaining and carries no Retry-After.500UNEXPECTED_ERROR— An unhandled failure; the detail stays in our logs and is never returned.
Requires one of the following token scopes: campaigns.
curl --request POST \
--url https://api.tryfuse.ai/api/v1/business/campaigns/{campaignId}/steps/{stepId}/generate \
--header 'Authorization: Basic <encoded-value>'import requests
url = "https://api.tryfuse.ai/api/v1/business/campaigns/{campaignId}/steps/{stepId}/generate"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://api.tryfuse.ai/api/v1/business/campaigns/{campaignId}/steps/{stepId}/generate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"stepId": "6a8dce156dc0b3d9029c22d7",
"preview": {
"subject": "Quick question about BrightPay's finance hiring",
"body": "<p>Hi Imogen, saw BrightPay is scaling its finance team. Worth a 15-minute chat next week?</p>",
"channel": "email",
"type": "manual",
"contact": {
"id": "237d2bafce67c35eee9f011d",
"name": "Imogen Low",
"email": "imogen@brightpay.com",
"jobTitle": "Software Engineer",
"companyName": "BrightPay"
}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"param": "<string>",
"doc_url": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"param": "<string>",
"doc_url": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"param": "<string>",
"doc_url": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"param": "<string>",
"doc_url": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"param": "<string>",
"doc_url": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"param": "<string>",
"doc_url": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"param": "<string>",
"doc_url": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"param": "<string>",
"doc_url": "<string>",
"request_id": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"param": "<string>",
"doc_url": "<string>",
"request_id": "<string>"
}
}Authorizations
Your API token (af_…) as the Basic-auth username, with an empty password.
Path Parameters
The campaign's id (24-character hex ObjectId), as returned by POST /business/campaigns or as the campaignId of a GET /business/campaigns row.
The sequence step's id, as returned by GET /business/campaigns/{campaignId}/steps (24-character hex ObjectId).