1. Overview
A Zalo post is an article on a Zalo Official Account (OA). It goes through the samePOST /v1/posts endpoint as every other platform: Zalo has no publishing endpoints of its own. SocialAPI publishes text articles only: it sends no images or videos.
2. Supported media
Title limit: Zalo limits an article title to 150 characters. SocialAPI does not check the length before it sends. When
text is longer than 150 characters, send a title of 150 characters or fewer, because the title falls back to text.
Text limit: SocialAPI sets no text limit for Zalo. Zalo’s own rules apply, and a refusal fails the target: see Quirks, errors, and recovery.
3. Create post
UsePOST /v1/posts with targets that name a Zalo account. publish_now: true publishes immediately. Without it and without scheduled_at, SocialAPI saves a draft.
normal and status show, so it is visible once Zalo finishes processing it.
Platform data fields
Zalo has noplatform_data fields. SocialAPI forwards any additional keys in platform_data.zalo only when a table in this section lists them. None does, so SocialAPI sends no key to Zalo and returns no warning for an unlisted key.
Draft validation
SocialAPI checks a draft before it creates the article. A draft with an emptytitle and an empty text fails with 400 publishing.validation_failed. error.meta.issues holds one issue: field title, message Zalo articles require a title. A draft with only text passes, because the title falls back to text.
Asynchronous creation
Zalo does not return a finished article. It accepts the article, processes it, and then makes an article ID available. SocialAPI waits 10 seconds for that ID. The target becomespublished when the ID arrives, and its platform_post_id holds the article ID.
If Zalo is still processing after 10 seconds, the target fails with 202 platform.zalo.article_processing. The article can still finish publishing on Zalo. Check the Official Account before you send POST /v1/posts/{pid}/retry, because a retry creates a second article.
Scheduling
Setscheduled_at to an ISO 8601 timestamp (UTC) to defer publishing:
4. Update post
A published Zalo article cannot be edited through SocialAPI.PATCH /v1/posts/{pid} returns 409 post.state_invalid for any post whose status is not draft, scheduled, or failed, with the message “Only draft, scheduled, or failed posts can be edited”.
A post in draft, scheduled, or failed status can be edited with PATCH /v1/posts/{pid} before it publishes.
To correct a published article, delete it with DELETE /v1/posts/{pid} and publish a new article.
5. Delete post
account_id. DELETE /v1/posts/{pid} always removes every target.
6. Retrieve posts
UseGET /v1/posts to list posts. Filter by platform or account:
targets array with the per-platform status. Results default to sort=scheduled_asc: pass sort to change the order.
shares holds the share count and extra.view_count holds the view count in GET /v1/posts. GET /v1/posts/{pid}/metrics returns the view count as metrics.views and metrics.extra.views. Zalo reports no likes, comments, or saves, so those stay 0.
Articles published outside SocialAPI: SocialAPI imports the 20 most recent articles of type normal when you connect the account and when you call POST /v1/accounts/{id}/sync. Older articles and articles of type video do not appear.
7. Quirks, errors, and recovery
Text only
SocialAPI publishes the text of an article and nothing else. Aurl or media_id item is ignored without an error, so a post meant to carry a video publishes as text. A platform_attachment_id item fails the Zalo target with 422 publishing.media.unsupported_source.
Title falls back to text
The article title is thetitle you send, or text when you send none. A text longer than 150 characters needs its own title: Zalo refuses a longer title and the target fails.
Asynchronous creation
A new article can take longer than 10 seconds to process. See “Asynchronous creation” in section 3. The target fails with202 platform.zalo.article_processing, and the article can still appear on the Official Account.
Posting caps
SocialAPI refuses a publish that would pass 25 posts in an hour or 50 posts in 24 hours for one account, with429 publishing.velocity_limit. A scheduled post is held and published when the window clears. See Posting velocity caps.
Errors on a failed target
A publish that fails after the request returned puts a structured error on the target, intargets[].error:
202 platform.zalo.article_processing: Zalo was still processing after 10 seconds. Check the Official Account before you retry.401 platform.zalo.auth: the access token expired or was revoked, or the Official Account is no longer authorized. The account is markedtoken_expired, and every later call that acts on the account returns403 account.reconnection_requireduntil you reconnect it.429 platform.zalo.rate_limit: Zalo’s quota for the app or the Official Account is used up. Wait, then retry.400 validation.platform_param: Zalo rejected a parameter, for example a title over 150 characters.error.messagecarries Zalo’s reason.502 platform.zalo.e<N>: Zalo returned an error SocialAPI does not map.<N>is the absolute value of Zalo’s numeric code.
Recovery
- Still processing. Open the Official Account. If the article is there, do nothing. If it is not, send
POST /v1/posts/{pid}/retry. See Delivery. - Auth error. Connect the account again with
POST /v1/accounts/connect, using the sameplatformandbrand_id. See Connect accounts. - Parameter error. Fix the field that
error.messagenames, then retry.