All notable changes to the Late Python SDK will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
transport=onLate/Zernio. Pass anhttpx.BaseTransportto reuse connections and TLS sessions across requests and clients. The caller owns it; the client never closes it. Without it nothing changes: a new connection per request.- Tool call telemetry on the hosted MCP server. One JSON log line per tool call (tool, latency, outcome, hashed caller), and with
SENTRY_DSNone Sentry transaction per tool call./healthreports the deployed commit. - Tool result size on the hosted MCP server.
mcp_tool_callgainsresult_charsand the Sentry transaction gainsmcp.tool.result.chars, the characters of text a tool returned, so oversized results (onead_campaigns_get_ad_treecall returned 284,873 characters) show per tool. Only the length is recorded, never the content.
- Every MCP tool call opened a new HTTPS connection to the Zernio API, a TLS handshake and about 6 ms of CPU each, on the single server process that saturated on Nov 10. Tool calls now reuse a connection pool per worker thread. One pool shared by the 40 tool threads was slower than no pooling: httpcore scans every connection under one lock on each request. Measured over HTTPS against a stub API, 40 clients: 141 calls/s at 272 ms p50 before, 173/s at 220 ms after.
- The hosted MCP server's memory kept growing until the next deploy. Measured on Linux with a stub API: glibc kept freed memory from large API responses in per-thread arenas (829 MB against 303 MB with
MALLOC_ARENA_MAX=2, now set in the Dockerfiles). Separately, FastMCP rebuiltsearch_toolsandcall_toolon everytools/listand every call to them, anduncalled_forkept each new function forever (about 3.6 MB per 1,000tools/list). The transform now builds each tool once. - Ad updates reported a failure after 91 seconds while the update had worked, and each retry ran it again. A
PUTthat took over 30 seconds was retried up to 3 times, so one call could update Meta several times and collect a 429 from the overlap.PUTandPATCHunder/v1/ads/now usepublish_timeout(300s) and are not retried on a timeout.PUTwithpublishNowgets the same treatment, so an update can no longer publish twice. - Ad creates could time out at 30 seconds while the ad was still being created, and a retry could create it twice. A Meta video ad takes up to about 3 minutes, so the agent saw an error for an ad that then went live.
POST /v1/ads/create,/boost,/messaging,/calland/ctwanow usepublish_timeout(300s). The MCP tools forcreate,messaging,callandctwasend anIdempotency-Keyderived from their arguments, so an identical call within 24 hours returns the first ad.boostkeeps the API's own duplicate check, which a key would turn off. - Other long POSTs still timed out at 30 seconds while the work finished on the server. In a week 69% of ad video uploads, 25% of ad duplicates and 7% of post retries outlasted the default, so the caller saw an error for something that succeeded.
POST /v1/ads/videos,/v1/media/prepare,/v1/ads/{id}/duplicate,/v1/ads/ad-sets/{id}/duplicate,/v1/ads/campaigns/{id}/duplicateand/v1/posts/{id}/retrynow usepublish_timeout(300s).posts_retry_all_failedstops after 5 minutes and says how many posts it did not attempt. - The hosted MCP server lost log lines to Railway's limit of 500 per second. About 124,000 lines were dropped in 6 hours,
mcp_tool_callincluded, every time a delayed log stream caught up. Access lines now appear only for 5xx, FastMCP's INFO lines are off, expected tool failures print no traceback, invalid-argument warnings no longer carry the customer's values, and the log thread writes at most 100 records per second.mcp_tool_callnow has atsfield, so stream lag stays measurable.--debugkeeps the full output. - A slow log stream could stop the hosted MCP server. Log writes ran on the event loop, so a blocked stdout froze every request. They now go through a background thread and a bounded queue, and client disconnects are no longer logged as error tracebacks.
- The hosted MCP server failed on workspaces with tens of thousands of accounts.
accounts_list,profiles_list,_resolve_accountand the ChatGPT surface asked for every account or profile on each call, which the API cannot serialize at that size. They now request one bounded page with server-side filters and hand back a cursor, and a post with anaccount_idno longer lists accounts first:POST /v1/postsalready rejects an id on another platform or outside the caller's scope. - The ChatGPT MCP server hid Threads accounts.
_is_posting_accountdropped every platform ending in "ads" to keep ad connections out, and "threads" ends in "ads", solist_social_accountsomitted Threads accounts andvalidate_post,schedule_postandpublish_post_nowrejected their ids with "Unknown account id". Ad platforms are now an explicit list. - DELETE operations with a request body sent no body. The generator emitted
_delete(path, params=...)for every DELETE and dropped the body kwargs, so calls likeremove_campaign_assets(...)reached the API empty and failed withinvalid_json_body. DELETE methods now build the payload and send it as JSON (_delete/_adeletetakedata). - MCP tool parameters that take a list of objects (or an object) did not say which keys go inside.
updates,campaignsand similar were typedlist[dict[str, Any]]with no keys, so agents had to guess. The parameter description now lists each key with its type, whether it is required and its description, one level of nested object keys included. - A POST that timed out client-side could be silently replayed, creating a duplicate live post.
_request_with_retry(and its async twin) retried every transient error identically, includinghttpx.TimeoutExceptionon a POST. A timeout only means the client gave up waiting - the server may have finished the request anyway - so replaying it can create a second copy of whatever the first attempt already did. Hit in practice on apublishNowcreate: the server-side publish took 222s againstBaseClient.DEFAULT_TIMEOUT's 30s, httpx aborted while the server kept working, and the retry loop fired a second identical POST. The SDK sent no request id, so the server couldn't recognize the replay, and its content-hash dedup answered the replay with a 409 while the original request was still live - so the customer saw a failure for a post that had actually published, retried by hand with a one-character caption change to dodge the dedup, and ended up with two live posts. Two independent fixes: (1) every request now carries anx-request-idheader, minted once per call and reused across retry attempts, so the server can recognize a replay when one does happen; (2) a POST that times out is no longer retried at all - it raises immediately with a message naming the duplicate-post risk, because the server's content-hash dedup can still race ahead of its idempotency check even with a matching request id.publishNowcreates also get a much longer timeout (publish_timeout, default 300s, configurable onZernio(...)) than the SDK default (timeout, default 30s), since a publish-now create runs the whole cross-platform publish synchronously inside the request. PUT, PATCH, and DELETE are unaffected - they're idempotent by contract and stay retryable on timeout. Known gaps, left alone here and tracked for follow-up: 5xx responses are never retried, andPUT /v1/posts/{id}withpublishNowhas the same synchronous-publish timeout exposure as create. - MCP
accounts_get_follower_statsreturned only the account name, dropping the follower count and daily series. The shared_format_responsehelper pattern-matches on the response shape, andFollowerStatsResponsehas anaccountsattribute, so it fell into the generic account-list branch that prints only- {platform}: {username}and silently discardedcurrentFollowers,growth, and the dailystatsseries. Hit in practice by a developer pulling LinkedIn org follower stats (data was present server-side: latest count plus a week of daily snapshots), who saw only the account name come back through the tool._format_responsenow checks for astatsattribute (unique toFollowerStatsResponseamong all response models) BEFORE the genericaccountsbranch and returns the fullmodel_dump_json(by_alias=True, exclude_none=True), so the count, growth, and series reach the LLM losslessly. Fixed in both the emittedgenerated_tools.pyand thegenerate_mcp_tools.pytemplate so a future regen keeps it. Two regression tests added intests/test_integration.py. (The related model gap,FollowerStatsResponsemissingstats/granularity, was already corrected ondevelopby an earlier OpenAPI regen, so no model change was needed here.)
- 1.4.48 was a regression: PATCH methods broke again. The auto-regen workflow runs on
develop, but the_patch/_apatchfix from 1.4.47 only landed onmain. Whendevelop's next regen built 1.4.48 (against an updated OpenAPI spec that addedrequestBodyblocks forupdateSequence/updateBroadcast), it picked updevelop's oldbase.pywithout_patch, so any 1.4.48 customer who upgraded gotAttributeErroron every PATCH call again. 1.4.49 mergesdevelopintomain(keepingmain's_patch/_apatch) so the published wheel carries both fixes: the missing PATCH method and the new body kwargs onupdate_sequence(...)/update_broadcast(...). Skip 1.4.48 — upgrade straight from 1.4.47 to 1.4.49.
- Every PATCH endpoint was broken end-to-end.
BaseClientexposed_get,_post,_put,_deletebut never defined_patch(or its async counterpart_apatch), while the resource generator happily emittedself._client._patch(...)calls. Any call into a PATCH endpoint raisedAttributeError: 'Zernio' object has no attribute '_patch'before a request was sent. Hit in practice oncontacts.update_contact(caught when a customer tried to add a tag from the MCP), but the same bug took downupdate_comment_automation,update_custom_field,update_lead_form,update_whats_app_template,update_whats_app_flow,update_discord_settings,update_google_business_place_action,edit_inbox_message,configure_tik_tok_ads_brand_identity,complete_telegram_connect,update_sequence, andupdate_broadcast(sync + async = 26 methods total).BaseClientnow defines_patch/_apatchmirroring_put/_aput, with aparams=kwarg so the one query-only PATCH (complete_telegram_connect) keeps working. Regression test intests/test_patch_methods.pyexercises body-bearing and query-only PATCH through the resource layer against a mocked HTTP client, so future codegen drifts can't silently reintroduce this. (Originally targeted 1.4.6 onmain; that tag had already been taken by an auto-regen ondevelop, so this fix ships as 1.4.47 after mergingdevelopintomain.)
- Optional scalar params no longer ship zero values to the API. The MCP autogenerator was emitting
0/0.0/""/Falseas defaults for optional scalars without OpenAPI-declared defaults, which the SDK's_build_payloadcouldn't filter (it only dropsNone). The literal0.0then tripped Zod'sz.number().positive().optional()validators server-side, surfacing as[400] Number must be greater than 0even when the field was genuinely optional. Hit in practice onads_create_standalone_adfor Google Search campaigns whereroas_average_floordefaulted to0.0and was forwarded into the API. Optional scalars now default toNone(typed asT | None) so unset fields are dropped before reaching the server. OpenAPI-declared defaults (e.g.campaign_type="display",gender="all") are still respected. LateAPIErrornow surfaces field names and stable error codes. The API returns{error, type, code, param}on validation failures but the SDK was readingerror_data.get("details")(a key the API doesn't send), soparamwas always lost. The SDK now stores the full envelope indetails, and__str__formats as[400] {message} (field: {param}; code: {code})when those are present. Direct fix for Hein's "the error doesn't identify the offending field" feedback.
- Merged the multi-account routing fix (1.4.0, originally landed on
main) and the array/object schema fix (1.4.1, alsomain) into thedevelopbranch so the next OpenAPI auto-regen doesn't reintroduce the bugs. Develop now has both fixes applied on top of its accumulated auto-regen content (new endpoints up through v1.3.120). No new behavioural changes beyond 1.4.1. - Generator now combines
develop's param/tool-name dedupe (prevents duplicate-kwarg SyntaxErrors and F811 lint failures) withmain's$ref/allOfschema resolution andlist[T]/dict[str, Any]typing. With develop's newer OpenAPI spec, this means newer fields onads_create_standalone_ad(cities,regions,creatives,images,video,brand_identity,promoted_object) are now properly typed alongside the original four (keywords,countries,additional_headlines,additional_descriptions).
- Autogenerated MCP tools no longer collapse
arrayandobjectschemas tostr. Fields likekeywords,countries,additional_headlines,additional_descriptionsonads_create_standalone_ad(and the equivalents across every autogenerated tool) were declared asstrand forwarded straight into the SDK, which then rejected the request withExpected array, received string. They now use the correct Python types (list[str] | None,list[dict[str, Any]] | None,dict[str, Any] | None) so FastMCP advertises the right shape to LLMs and the SDK receives native containers. - The generator now dereferences
$ref,allOf, and same-typeoneOf/anyOfwrappers when reading a schema's type. Without this, properties likeposts_create_post.tiktokSettings,posts_create_post.facebookSettings,posts_create_post.recycling, and array-of-$ref fields likecreateWhatsAppTemplate.components,createQueueSlot.slots,sendConversions.events,updateGoogleBusinessFoodMenus.menus, andsendPrivateReplyToComment.buttonswould still have leaked through asstr.
- MCP multi-account routing (silent-wrong-account bug).
posts_create,posts_publish_now,posts_cross_post, andaccounts_getpreviously fell back to the first matching account (matching[0]) when the user had more than one account on the requested platform. Agency / multi-client setups could see posts land on the wrong account with no warning. These tools now return an explicit error listing the candidate account IDs when the selection is ambiguous, and require the caller to disambiguate.
account_idandprofile_idparameters onposts_createandposts_publish_nowfor explicit target selection.account_ids(parallel toplatforms) andprofile_idparameters onposts_cross_post. Repeating a platform with different IDs is supported (e.g. cross-posting to two Twitter accounts in one call).posts_create_postexposed as an autogenerated tool alongside the simplifiedposts_create. It mirrors the full RESTcreatePostsurface (nestedplatformsarray withcustomContent,customMedia,scheduledFor,platformSpecificData) for power users who need per-target customisation.- Top-level multi-account workflow guidance in the MCP server instructions so LLMs learn the disambiguation flow once globally.
- Unit tests for the shared
_resolve_accounthelper covering account-id, profile-id, ambiguous, and not-found paths.
- MCP HTTP server now exposes the modern Streamable HTTP transport at
POST /mcp(in addition to the existing SSE transport atGET /sse). Streamable HTTP is recommended for new clients (Claude Code,mcp-remote, etc.) because it is not affected by the idle-connection drops that affect long-lived SSE connections behind proxies. - Streamable HTTP runs in stateless mode — each request is fully independent and authenticated separately via the
Authorization: Bearerheader.
- Bumped minimum
mcpSDK version to>=1.8.0(required forStreamableHTTPSessionManager). - Server
transportfield in the root info endpoint now reports"sse+streamable-http".
- MCP (Model Context Protocol) server support for Claude Desktop integration
- HTTP server mode for MCP (
late-mcp-http) - AI content generation module with OpenAI and Anthropic support
- Pipelines for common workflows (CSV scheduler, cross-poster)
- Large file upload support via Vercel Blob
- Progress callbacks for file uploads
- Comprehensive test suite with pytest
- Improved error handling with specialized exception classes
- Better async support throughout the SDK
- Upload module with
SmartUploaderfor automatic upload strategy selection - Direct upload for files under 4MB
- Multipart upload support for large files
upload_bytes()andupload_large_bytes()methods
- Initial public release
- Full coverage of Late API endpoints
- Support for all 13 social media platforms: Instagram, TikTok, YouTube, LinkedIn, X/Twitter, Facebook, Pinterest, Threads, Bluesky, Reddit, Snapchat, Telegram, and Google Business Profile
- Async support with
alist(),acreate(), etc. - Type hints and Pydantic models
- Error handling with
LateAPIError,LateRateLimitError,LateValidationError
- Posts: create, list, get, update, delete, retry, bulk upload
- Accounts: list, get, follower stats
- Profiles: create, list, get, update, delete
- Analytics: get metrics, usage stats
- Account Groups: create, list, update, delete
- Queue: slots management, preview
- Webhooks: settings management, logs, testing
- API Keys: create, list, delete
- Media: upload, generate upload token
- Tools: downloads, hashtag checking, transcripts, AI caption generation
- Users: list, get
- Usage: stats
- Logs: list, get
- Connect: OAuth flows for all platforms
- Reddit: feed, search
- Invites: platform invites management