Skip to main content

Documentation Index

Fetch the complete documentation index at: https://dev.magicpost.in/llms.txt

Use this file to discover all available pages before exploring further.

These endpoints control when a post goes live on LinkedIn. You can schedule a post for a future time, cancel an existing schedule, or bypass the queue and publish immediately.

POST /api/v1/posts/<post_id>/schedule

Schedule a post for future publication on LinkedIn. Request body
FieldTypeDefaultDescription
at_isostringRequired. ISO 8601 datetime. Naive (no UTC offset) values are interpreted in the user’s timezone. Values with a UTC offset are converted automatically.
timezonestring or nullUser’s stored timezoneIANA timezone name override, e.g. Europe/Paris.
confirm_same_daybooleantrueWhen true, the API will warn you if other posts are already scheduled on the same calendar day. Set to false to proceed anyway.
confirm_exact_slotbooleantrueWhen true, the API will warn you if another post is within ±5 minutes of the requested time. This is a stronger signal than same_day_posts.
approvedboolean or nullnullOrg approval workflow state.
curl -X POST https://api.magicpost.in/api/v1/posts/uuid/schedule \
  -H "Authorization: Bearer mp_xxx" \
  -H "Content-Type: application/json" \
  -d '{"at_iso": "2026-06-01T14:00", "timezone": "Europe/Paris"}'

Success response

{
  "success": true,
  "utc_publish_date": "2026-06-01T12:00:00+00:00",
  "failed_urns": []
}

Same-day warning (HTTP 200)

When confirm_same_day is true and other posts are already scheduled on the same calendar day, the API returns HTTP 200 with success: false rather than creating the schedule:
{
  "success": false,
  "warning": "same_day_posts",
  "message": "User has 2 other post(s) scheduled on 2026-06-01 (Europe/Paris).",
  "existing": [
    { "post_id": "abc", "preview": "5 leçons…", "date_post": "2026-06-01", "hour_post": "09:00" },
    { "post_id": "def", "preview": "Mon erreur…", "date_post": "2026-06-01", "hour_post": "18:00" }
  ],
  "hint": "Ask the user to confirm, then retry with confirm_same_day=false."
}
To proceed despite the conflict, resend the request with confirm_same_day: false.

Exact-slot warning (HTTP 200)

If another post is within ±5 minutes of the requested time, you receive an exact_slot_conflict warning instead. This takes precedence over same_day_posts and is a stronger signal:
{
  "success": false,
  "warning": "exact_slot_conflict",
  "existing": [...],
  "hint": "..."
}
To proceed, resend with confirm_exact_slot: false.

LinkedIn token expired

{
  "success": false,
  "error_type": "token_expired",
  "actionable": true,
  "hint": "Tell the user to reconnect LinkedIn from MagicPost > Settings."
}

Other errors

StatusCodeDescription
400missing_dataat_iso was not provided.
400too_lateThe requested time is more than 6 months in the future.
400failed_tagOne or more @mentions could not be resolved (LinkedIn privacy restrictions).
404post_not_foundPost doesn’t exist or isn’t owned by you (IDOR guard).

POST /api/v1/posts/<post_id>/cancel-schedule

Cancel a scheduled post. This endpoint is idempotent — it returns a success response whether or not the post was scheduled in the first place.
curl -X POST https://api.magicpost.in/api/v1/posts/uuid/cancel-schedule \
  -H "Authorization: Bearer mp_xxx"
Responses
StatusResponseDescription
200{"success": true}Post was scheduled and is now cancelled.
200{"success": true, "already_unscheduled": true}Post was not scheduled; no change made.
409already_publishedPost has already been published to LinkedIn and cannot be cancelled.

POST /api/v1/posts/<post_id>/publish

Publish a post to LinkedIn immediately, bypassing any scheduled time.
curl -X POST https://api.magicpost.in/api/v1/posts/uuid/publish \
  -H "Authorization: Bearer mp_xxx"
Responses
StatusResponseDescription
200{"success": true, ...}Post published. The response body includes the live LinkedIn URL.
400token_expiredYour LinkedIn connection has expired. The response includes "actionable": true and a hint to reconnect from MagicPost → Settings.
409already_publishedPost has already been published to LinkedIn.
404post_not_foundPost doesn’t exist or isn’t owned by you.