# Create accounts

URL: https://docs.hanzo.ai/docs/openapi/social/post-social-accounts

> Records a social account for the org and answers 201 with the stored row, including the generated id later calls address it by.

`POST /v1/social/accounts`

> [Social →](https://docs.hanzo.ai/docs/openapi/social) · [All API references →](https://docs.hanzo.ai/docs/openapi) · [Get started →](https://docs.hanzo.ai/docs/guides)

|               |                                           |
| ------------- | ----------------------------------------- |
| **Address**   | `https://api.hanzo.ai/v1/social/accounts` |
| **Method**    | `POST`                                    |
| **Operation** | `post_social_accounts`                    |
| **Auth**      | `Authorization: Bearer $HANZO_API_KEY`    |

Records a social account for the org and answers 201 with the
stored row, including the generated id later calls address it by.

## Request

3 fields, body `application/json` (required).

| Field      | In   | Type   | Required | Description                                                                                               |
| ---------- | ---- | ------ | -------- | --------------------------------------------------------------------------------------------------------- |
| `handle`   | body | string | —        | Handle is the account's public name on the network, as the customer knows it (`@acme`).                   |
| `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 |
| --------- | -------------------- | ------- |
| `201`     | social.socialAccount | created |
| `default` | problem-details      | refused |

`201` body — 6 fields.

| Field       | In   | Type            | Always | Description                                                                                               |
| ----------- | ---- | --------------- | ------ | --------------------------------------------------------------------------------------------------------- |
| `createdAt` | body | integer (int64) | —      | 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 (int64) | —      | UpdatedAt is when the account row last changed, as a unix timestamp in seconds.                           |

Failure carries the platform error shape — see [Errors](https://docs.hanzo.ai/docs/errors).

## Examples

**CLI**

```bash
hanzo social accounts create
```

**SDK**

**.ts**

```ts
import { Configuration, SocialApi } from 'hanzoai';

const api = new SocialApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.postSocialAccounts({ handle: "<handle>", provider: "<provider>" });
```

**.py**

```python
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).post_social_accounts(handle="<handle>", provider="<provider>")
```

**.go**

```go
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.SocialAPI.PostSocialAccounts(context.Background()).Execute()
if err != nil {
	return err
}
```

**.rs**

```rust
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::post_social_accounts(&cfg, Default::default()).await?;
```

**.java**

```java
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).postSocialAccounts();
```

**HTTP**

```bash
curl -X POST https://api.hanzo.ai/v1/social/accounts \
  -H "Authorization: Bearer $HANZO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
       "handle": "<handle>",
       "provider": "<provider>"
     }'
```

**MCP**

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:

```bash
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](https://docs.hanzo.ai/docs/openapi/social) · [All Hanzo APIs](https://docs.hanzo.ai/docs/openapi) · [Interactive reference](https://docs.hanzo.ai/docs/openapi/reference)
