Content
Update content
Updates a LinkedIn post or comment
PATCH
https://api.talktohumans.app
/
v1
/
content
/
{content_id}
Update content
curl --request PATCH \
--url https://api.talktohumans.app/v1/content/{content_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"account_id": "42",
"tags": {
"add": [
{
"name": "Lead magnet",
"color": "green"
}
]
}
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({account_id: '42', tags: {add: [{name: 'Lead magnet', color: 'green'}]}})
};
fetch('https://api.talktohumans.app/v1/content/{content_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.talktohumans.app/v1/content/{content_id}"
payload = {
"account_id": "42",
"tags": { "add": [
{
"name": "Lead magnet",
"color": "green"
}
] }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.talktohumans.app/v1/content/{content_id}"
payload := strings.NewReader("{\n \"account_id\": \"42\",\n \"tags\": {\n \"add\": [\n {\n \"name\": \"Lead magnet\",\n \"color\": \"green\"\n }\n ]\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"data": {
"content": {
"content_id": "cnt_0f8fad5bd9cb469fa16570867728950e",
"account": {
"account_id": "<string>",
"display_name": "<string>",
"provider_account_id": "<string>",
"owner_user_id": "<string>"
},
"content_type": "post",
"author": {
"provider_participant_id": "<string>",
"name": "<string>",
"contact_id": "<string>",
"headline": "<string>",
"linkedin_url": "<string>"
},
"linkedin_url": "<string>",
"posted_at": "2023-11-07T05:31:56Z",
"reaction_count": 123,
"comment_count": 123,
"repost_count": 123,
"media_type": "none",
"media": {
"images": [
{
"url": "<string>",
"width": 123,
"height": 123
}
],
"title": "<string>",
"subtitle": "<string>",
"link_url": "<string>",
"page_count": 123,
"document_url": "<string>"
},
"source": "mine",
"tags": [
{
"name": "<string>",
"color": "green"
}
],
"engagers_view_id": "<string>",
"engagers_extracted_at": "2023-11-07T05:31:56Z",
"new_comments_since_extraction": 123,
"results": {
"engagers": 123,
"contacted": 123,
"connected": 123,
"replied": 123
},
"parent": {
"linkedin_url": "<string>",
"author": {
"provider_participant_id": "<string>",
"name": "<string>",
"contact_id": "<string>",
"headline": "<string>",
"linkedin_url": "<string>"
},
"text": "<string>"
},
"text": "<string>"
}
}
}Authorizations
Pass Authorization: Bearer <credential>, where the credential is either:
- an API key (
sk_…), generated by an organization admin in Settings, for scripts and automation; - an access token from
tth auth login(the TalkToHumans CLI), which any member of the workspace can use.
Both resolve to the same organization and user. A login token acts in the user's workspace: one with no workspace yet returns 403 workspace_setup_required, and one in several workspaces returns 403 forbidden (use an API key instead).
Path Parameters
Content ID returned by GET /v1/content.
Body
application/json
Use set for exact replacement, or add/remove for incremental updates. set cannot be combined with add or remove.
Show child attributes
Show child attributes
LinkedIn account ID returned by GET /v1/accounts. Required when the organization has multiple LinkedIn accounts.
Pattern:
^[1-9][0-9]*$Response
Content updated.
Show child attributes
Show child attributes
⌘I
Update content
curl --request PATCH \
--url https://api.talktohumans.app/v1/content/{content_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"account_id": "42",
"tags": {
"add": [
{
"name": "Lead magnet",
"color": "green"
}
]
}
}
'const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({account_id: '42', tags: {add: [{name: 'Lead magnet', color: 'green'}]}})
};
fetch('https://api.talktohumans.app/v1/content/{content_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.talktohumans.app/v1/content/{content_id}"
payload = {
"account_id": "42",
"tags": { "add": [
{
"name": "Lead magnet",
"color": "green"
}
] }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.talktohumans.app/v1/content/{content_id}"
payload := strings.NewReader("{\n \"account_id\": \"42\",\n \"tags\": {\n \"add\": [\n {\n \"name\": \"Lead magnet\",\n \"color\": \"green\"\n }\n ]\n }\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"data": {
"content": {
"content_id": "cnt_0f8fad5bd9cb469fa16570867728950e",
"account": {
"account_id": "<string>",
"display_name": "<string>",
"provider_account_id": "<string>",
"owner_user_id": "<string>"
},
"content_type": "post",
"author": {
"provider_participant_id": "<string>",
"name": "<string>",
"contact_id": "<string>",
"headline": "<string>",
"linkedin_url": "<string>"
},
"linkedin_url": "<string>",
"posted_at": "2023-11-07T05:31:56Z",
"reaction_count": 123,
"comment_count": 123,
"repost_count": 123,
"media_type": "none",
"media": {
"images": [
{
"url": "<string>",
"width": 123,
"height": 123
}
],
"title": "<string>",
"subtitle": "<string>",
"link_url": "<string>",
"page_count": 123,
"document_url": "<string>"
},
"source": "mine",
"tags": [
{
"name": "<string>",
"color": "green"
}
],
"engagers_view_id": "<string>",
"engagers_extracted_at": "2023-11-07T05:31:56Z",
"new_comments_since_extraction": 123,
"results": {
"engagers": 123,
"contacted": 123,
"connected": 123,
"replied": 123
},
"parent": {
"linkedin_url": "<string>",
"author": {
"provider_participant_id": "<string>",
"name": "<string>",
"contact_id": "<string>",
"headline": "<string>",
"linkedin_url": "<string>"
},
"text": "<string>"
},
"text": "<string>"
}
}
}