Replaces the account's network, handle and status with what the body carries,…
Replaces the account's network, handle and status with what the body carries, and answers with the stored row.
PUT /v1/social/accounts/{id}
| Address | https://api.hanzo.ai/v1/social/accounts/{id} |
| Method | PUT |
| Operation | put_social_accounts_by_id |
| Auth | Authorization: Bearer $HANZO_API_KEY |
Replaces the account's network, handle and status with what the body carries, and answers with the stored row.
This is a REPLACEMENT, not a merge, which is the rule most easily got wrong: a field the body omits is written as its default, so leaving out the handle blanks it and leaving out the status resets it to connected. Send the whole record. The same vocabularies as create apply, and an unknown network or status is refused rather than coerced.
Request
4 fields, body application/json (required).
| Field | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes | |
handle | body | string | — | Handle is the account's public name on the network. |
provider | body | string | — | Provider is the network this account is on: x, facebook, instagram, linkedin, tiktok, youtube or threads. |
status | body | string | — | Status is the connection lifecycle: connected, disconnected or error. |
Response
| Status | Body | Meaning |
|---|---|---|
200 | socialAccount | ok |
200 body — 6 fields.
| Field | In | Type | Always | Description |
|---|---|---|---|---|
createdAt | body | integer | — | CreatedAt is when the account was connected, as a unix timestamp in seconds. |
handle | body | string | — | Handle is the account's public name on the network, as the customer knows it. |
id | body | string | — | ID is the account's identifier, minted on connect and the id every later call addresses it by. |
provider | body | string | — | Provider is the network this account is on: x, facebook, instagram, linkedin, tiktok, youtube or threads. |
status | body | string | — | Status is the connection lifecycle: connected, disconnected or error. |
updatedAt | body | integer | — | UpdatedAt is when the account row last changed, as a unix timestamp in seconds. |
Failure carries the platform error shape — see Errors.
Examples
hanzo social accounts set <id>import { Configuration, SocialApi } from 'hanzoai';
const api = new SocialApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.putSocialAccountsById({ id: 'id', handle: "<handle>", provider: "<provider>" });from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import SocialApi
client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = SocialApi(client).put_social_accounts_by_id(id='id', handle="<handle>", provider="<provider>")cfg := cloud.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := cloud.NewAPIClient(cfg)
resp, _, err := client.SocialAPI.PutSocialAccountsById(context.Background()).Execute()
if err != nil {
return err
}use hanzo_cloud::apis::{configuration::Configuration, social_api};
let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();
let result = social_api::put_social_accounts_by_id(&cfg, Default::default()).await?;import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.SocialApi;
ApiClient client = new ApiClient();
client.setRequestInterceptor(b -> b.header("Authorization", "Bearer " + System.getenv("HANZO_API_KEY")));
var result = new SocialApi(client).putSocialAccountsById();curl -X PUT https://api.hanzo.ai/v1/social/accounts/<id> \
-H "Authorization: Bearer $HANZO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"handle": "<handle>",
"provider": "<provider>"
}'The door reaches social through the social tool, which names its 13 operations with its own verbs — this one among them, under a name only the door declares. describe explains any of them:
curl -X POST https://api.hanzo.ai/v1/mcp \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "describe",
"arguments": {
"op": "list_social_accounts"
}
}
}'How is this guide?