Get accounts

Returns one of the org's connected accounts by id — its network, handle, status and timestamps — or 404.

GET /v1/social/accounts/{id}

Addresshttps://api.hanzo.ai/v1/social/accounts/{id}
MethodGET
Operationget_social_accounts_by_id
AuthAuthorization: Bearer $HANZO_API_KEY

Returns one of the org's connected accounts by id — its network, handle, status and timestamps — or 404. The provider access token is not part of the response.

Request

1 field.

FieldInTypeRequiredDescription
idpathstringyesID is the account or post to act on, taken from the path.

Response

StatusBodyMeaning
200social.socialAccountok
defaultproblem-detailsrefused

200 body — 6 fields.

FieldInTypeAlwaysDescription
createdAtbodyinteger (int64)—CreatedAt is when the account was connected, as a unix timestamp in seconds.
handlebodystring—Handle is the account's public name on the network, as the customer knows it.
idbodystring—ID is the account's identifier, minted on connect and the id every later call addresses it by.
providerbodystring—Provider is the network this account is on: x, facebook, instagram, linkedin, tiktok, youtube or threads.
statusbodystring—Status is the connection lifecycle: connected, disconnected or error.
updatedAtbodyinteger (int64)—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 get <id>
import { Configuration, SocialApi } from 'hanzoai';

const api = new SocialApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getSocialAccountsById({ id: 'id' });
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).get_social_accounts_by_id(id='id')
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.SocialAPI.GetSocialAccountsById(context.Background()).Execute()
if err != nil {
	return err
}
use hanzo_client::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::get_social_accounts_by_id(&cfg, Default::default()).await?;
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.SocialApi;

ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));

var result = new SocialApi(client).getSocialAccountsById();
curl https://api.hanzo.ai/v1/social/accounts/<id> \
  -H "Authorization: Bearer $HANZO_API_KEY"

MCP reaches social through the social tool, which names its 13 operations with its own verbs — this one among them, under a name only MCP 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"
         }
       }
     }'

Social API · All Hanzo APIs · Interactive reference

Was this page useful?