cURL
curl -X POST https://api.neuraldraft.io/v1/social-accounts/connect/facebook \
-H "Authorization: Bearer ndsk_live_yourkey" \
-H "Content-Type: application/json" \
-d '{"redirect_uri":"https://app.lakesideyoga.uk/settings/social/callback"}'const { oauthUrl } = await nd.socialAccounts.connect("facebook", { redirectUri: "https://app.lakesideyoga.uk/settings/social/callback" });
r = requests.post("https://api.neuraldraft.io/v1/social-accounts/connect/facebook",
headers={"Authorization": f"Bearer {key}"},
json={"redirect_uri":"https://app.lakesideyoga.uk/settings/social/callback"})
<?php
$oauth = json_decode((string) $client->post('social-accounts/connect/facebook', [
'headers' => ['Authorization' => 'Bearer '.$key],
'json' => ['redirect_uri' => 'https://app.lakesideyoga.uk/settings/social/callback'],
])->getBody(), true);
{
"oauth_url": "https://www.facebook.com/v19.0/dialog/oauth?client_id=app123&state=abc123",
"state": "abc123"
}{
"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://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
Initiate OAuth connection
Returns a redirect URL. Send the user to it; on completion they’re
sent to the redirect_uri you provided (or the default Neural Draft
callback) with ?status=connected&account_id=... appended.
POST
/
social-accounts
/
connect
/
{platform}
cURL
curl -X POST https://api.neuraldraft.io/v1/social-accounts/connect/facebook \
-H "Authorization: Bearer ndsk_live_yourkey" \
-H "Content-Type: application/json" \
-d '{"redirect_uri":"https://app.lakesideyoga.uk/settings/social/callback"}'const { oauthUrl } = await nd.socialAccounts.connect("facebook", { redirectUri: "https://app.lakesideyoga.uk/settings/social/callback" });
r = requests.post("https://api.neuraldraft.io/v1/social-accounts/connect/facebook",
headers={"Authorization": f"Bearer {key}"},
json={"redirect_uri":"https://app.lakesideyoga.uk/settings/social/callback"})
<?php
$oauth = json_decode((string) $client->post('social-accounts/connect/facebook', [
'headers' => ['Authorization' => 'Bearer '.$key],
'json' => ['redirect_uri' => 'https://app.lakesideyoga.uk/settings/social/callback'],
])->getBody(), true);
{
"oauth_url": "https://www.facebook.com/v19.0/dialog/oauth?client_id=app123&state=abc123",
"state": "abc123"
}{
"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://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.
Path Parameters
Available options:
facebook, instagram, twitter, tiktok, linkedin, youtube Body
application/json
Where to send the user after the OAuth flow completes.
Example:
"https://app.lakesideyoga.uk/settings/social/callback"