Attach a library file to a post
postkey_attach_library_itemPostkey: Adds one Library file to a draft post, after the media it already has (the same file twice changes nothing). The id comes from postkey_list_library, or from postkey_finish_upload for a new file. A post that waits in Approvals goes back to a draft. A text post that gets its first file becomes an image or video post. To replace or reorder media, send library_item_ids to postkey_update_post.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"post_id": "<post_id>",
"library_item_id": "<library_item_id>"
},
"name": "postkey_attach_library_item"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| post_id | Yes | The post id (a UUID) from postkey_list_posts or postkey_create_post. | |
| library_item_id | Yes | The Library file id (a UUID) from postkey_list_library or postkey_finish_upload. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | false: refused (isError; code, message, guide_topic, url); no change. | |
| note | No | Present when nothing changed. | |
| status | No | The post's status after the save. | |
| post_id | No | The post id. | |
| attached | No | false when the file was already on the post. | |
| warnings | No | Things to fix before it can be sent. | |
| media_files | No | Files on the post now. |