cURL (AI)
curl -X POST https://api.neuraldraft.io/v1/social-posts \
-H "Authorization: Bearer ndsk_live_yourkey" \
-H "Content-Type: application/json" \
-d '{"ai":{"topic":"new Saturday class","platforms":["facebook","instagram"],"tone":"warm","media_type":"image"}}'const job = await nd.socialPosts.generate({
topic: "new Saturday class",
platforms: ["facebook", "instagram"],
tone: "warm",
mediaType: "image",
});
job = requests.post("https://api.neuraldraft.io/v1/social-posts",
headers={"Authorization": f"Bearer {key}"},
json={"ai":{"topic":"new Saturday class","platforms":["facebook","instagram"],"tone":"warm","media_type":"image"}}).json()
<?php
$job = json_decode((string) $client->post('social-posts', [
'headers' => ['Authorization' => 'Bearer '.$key],
'json' => ['ai' => ['topic' => 'new Saturday class', 'platforms' => ['facebook','instagram'], 'tone' => 'warm', 'media_type' => 'image']],
])->getBody(), true);
{
"id": 88,
"platforms": [
"facebook",
"instagram"
],
"status": "scheduled",
"title": "New Saturday morning class",
"media_type": "image",
"media": [
"<string>"
],
"content_per_platform": {
"facebook": "New Saturday morning class — book now → lakesideyoga.uk",
"instagram": "Slow down. Breathe. ✨ New Saturday morning class — link in bio."
},
"scheduled_at": "2023-11-07T05:31:56Z",
"published_at": "2023-11-07T05:31:56Z",
"publish_results": {
"instagram": {
"ok": true,
"external_id": "ig_178214..."
},
"facebook": {
"ok": false,
"error": "Token expired"
}
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"id": "job_2Ngd9KqLmRpW",
"type": "blog_post.generate",
"status": "pending",
"created_at": "2023-11-07T05:31:56Z",
"progress": 50,
"message": "<string>",
"steps": [
{
"name": "<string>",
"completed": true,
"active": true
}
],
"result": {},
"error": {
"code": "upstream_unavailable",
"message": "<string>"
},
"updated_at": "2023-11-07T05:31:56Z"
}{
"type": "https://api.neuraldraft.io/errors/bad_request",
"title": "Bad request",
"status": 400,
"detail": "Request body could not be parsed.",
"code": "bad_request",
"instance": "req_2Nh4PqRsTuVw"
}{
"type": "https://api.neuraldraft.io/errors/unauthorized",
"title": "Unauthorized",
"status": 401,
"detail": "API key missing or invalid.",
"code": "unauthorized",
"instance": "req_2Nh4PqRsTuVw"
}{
"type": "https://neuraldraft.com/errors/payment-required",
"title": "Payment Required",
"status": 402,
"detail": "This project has no credits remaining for the current period.",
"code": "insufficient_credits",
"cost": 1,
"balance": 0,
"instance": "req_2Nh4PqRsTuVw"
}{
"type": "https://api.neuraldraft.io/errors/validation_failed",
"title": "Validation failed",
"status": 422,
"detail": "One or more fields failed validation.",
"code": "validation_failed",
"instance": "req_2Nh4PqRsTuVw",
"errors": {
"customer_email": [
"The customer email field must be a valid email address."
],
"starts_at": [
"The starts at field must be a date after now."
]
}
}Social
Create a social post
Two creation modes:
- Manual — provide
title,platforms, and per-platform copy (facebook_content,instagram_content, …). Saved as draft. 0 credits. - AI generation — provide
ai: { topic|post_id, tone, platforms, media_type, ... }. Returns aJobwithtype: social_post.generate. Costs 5 credits (social_post) for the text base; ifmedia_type=imagean additional 32 credits (image) is charged, and ifmedia_type=videoan additional 40 credits (video, budget tier) is charged against the same job.
POST
/
social-posts
cURL (AI)
curl -X POST https://api.neuraldraft.io/v1/social-posts \
-H "Authorization: Bearer ndsk_live_yourkey" \
-H "Content-Type: application/json" \
-d '{"ai":{"topic":"new Saturday class","platforms":["facebook","instagram"],"tone":"warm","media_type":"image"}}'const job = await nd.socialPosts.generate({
topic: "new Saturday class",
platforms: ["facebook", "instagram"],
tone: "warm",
mediaType: "image",
});
job = requests.post("https://api.neuraldraft.io/v1/social-posts",
headers={"Authorization": f"Bearer {key}"},
json={"ai":{"topic":"new Saturday class","platforms":["facebook","instagram"],"tone":"warm","media_type":"image"}}).json()
<?php
$job = json_decode((string) $client->post('social-posts', [
'headers' => ['Authorization' => 'Bearer '.$key],
'json' => ['ai' => ['topic' => 'new Saturday class', 'platforms' => ['facebook','instagram'], 'tone' => 'warm', 'media_type' => 'image']],
])->getBody(), true);
{
"id": 88,
"platforms": [
"facebook",
"instagram"
],
"status": "scheduled",
"title": "New Saturday morning class",
"media_type": "image",
"media": [
"<string>"
],
"content_per_platform": {
"facebook": "New Saturday morning class — book now → lakesideyoga.uk",
"instagram": "Slow down. Breathe. ✨ New Saturday morning class — link in bio."
},
"scheduled_at": "2023-11-07T05:31:56Z",
"published_at": "2023-11-07T05:31:56Z",
"publish_results": {
"instagram": {
"ok": true,
"external_id": "ig_178214..."
},
"facebook": {
"ok": false,
"error": "Token expired"
}
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}{
"id": "job_2Ngd9KqLmRpW",
"type": "blog_post.generate",
"status": "pending",
"created_at": "2023-11-07T05:31:56Z",
"progress": 50,
"message": "<string>",
"steps": [
{
"name": "<string>",
"completed": true,
"active": true
}
],
"result": {},
"error": {
"code": "upstream_unavailable",
"message": "<string>"
},
"updated_at": "2023-11-07T05:31:56Z"
}{
"type": "https://api.neuraldraft.io/errors/bad_request",
"title": "Bad request",
"status": 400,
"detail": "Request body could not be parsed.",
"code": "bad_request",
"instance": "req_2Nh4PqRsTuVw"
}{
"type": "https://api.neuraldraft.io/errors/unauthorized",
"title": "Unauthorized",
"status": 401,
"detail": "API key missing or invalid.",
"code": "unauthorized",
"instance": "req_2Nh4PqRsTuVw"
}{
"type": "https://neuraldraft.com/errors/payment-required",
"title": "Payment Required",
"status": 402,
"detail": "This project has no credits remaining for the current period.",
"code": "insufficient_credits",
"cost": 1,
"balance": 0,
"instance": "req_2Nh4PqRsTuVw"
}{
"type": "https://api.neuraldraft.io/errors/validation_failed",
"title": "Validation failed",
"status": 422,
"detail": "One or more fields failed validation.",
"code": "validation_failed",
"instance": "req_2Nh4PqRsTuVw",
"errors": {
"customer_email": [
"The customer email field must be a valid email address."
],
"starts_at": [
"The starts at field must be a date after now."
]
}
}Authorizations
Project API key. Pass as Authorization: Bearer ndsk_live_.... Manage
keys via /projects/me/api-keys. Test-mode keys use
the ndsk_test_ prefix.
Body
application/json
- Option 1
- Option 2
Minimum array length:
1Available options:
facebook, instagram, twitter, tiktok, linkedin, youtube Available options:
image, video, carousel Response
Manual post created.
Example:
88
Available options:
facebook, instagram, twitter, tiktok, linkedin, youtube Example:
["facebook", "instagram"]
Available options:
draft, scheduled, published, failed Example:
"scheduled"
Example:
"New Saturday morning class"
Available options:
image, video, carousel Platform-specific copy.
Show child attributes
Show child attributes
Example:
{
"facebook": "New Saturday morning class — book now → lakesideyoga.uk",
"instagram": "Slow down. Breathe. ✨ New Saturday morning class — link in bio."
}
Per-platform publish outcomes.
Show child attributes
Show child attributes
Example:
{
"instagram": { "ok": true, "external_id": "ig_178214..." },
"facebook": { "ok": false, "error": "Token expired" }
}