Your store has a set of social media links – one slot per platform – surfaced in the storefront footer and elsewhere. Each value is the handle or full URL you entered, or `null` when that platform isn't set. The supported platforms are `instagram`, `facebook`, `x`, `youtube`, `linkedin`, `tiktok`, and `email`.

## Get Socials

```
GET /api/v1/socials
```

Returns the store's configured social media links, keyed by platform. Every platform key is always present in the response; unset platforms come back as `null`.

```bash
curl \
  -H "Authorization: Bearer your_api_key" \
  https://your-store.yns.store/api/v1/socials
```

### Response (200)

```json
{
  "socials": {
    "instagram": "https://instagram.com/yourstore",
    "facebook": "https://facebook.com/yourstore",
    "x": "yourstore",
    "youtube": null,
    "linkedin": null,
    "tiktok": "@yourstore",
    "email": "hello@example.com"
  }
}
```

### Store Not Found (404)

```json
{
  "error": "Store not found"
}
```

---

## Set Socials

```
PUT /api/v1/socials
```

Replaces the store's social links **wholesale**. Provide a per-platform map of handles or URLs under `socials`. Omit a platform or pass `null` to clear it – the response always returns the full normalized map with every platform key present. Values are trimmed, and empty strings are normalized to `null`.

### Request Body

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `socials` | `object` | Yes | Per-platform handle/URL map. Replaces the stored socials wholesale |

The `socials` object accepts these keys, each an optional `string` or `null`:

| Key | Type | Description |
|-----|------|-------------|
| `instagram` | `string \| null` | Instagram handle or URL |
| `facebook` | `string \| null` | Facebook handle or URL |
| `x` | `string \| null` | X (Twitter) handle or URL |
| `youtube` | `string \| null` | YouTube channel handle or URL |
| `linkedin` | `string \| null` | LinkedIn handle or URL |
| `tiktok` | `string \| null` | TikTok handle or URL |
| `email` | `string \| null` | Public contact email address |

```bash
curl -X PUT \
  -H "Authorization: Bearer your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"socials": {"instagram": "https://instagram.com/yourstore", "tiktok": "@yourstore", "email": "hello@example.com"}}' \
  https://your-store.yns.store/api/v1/socials
```

### Response (200)

Returns the normalized links. Platforms not included in the request are set to `null`.

```json
{
  "socials": {
    "instagram": "https://instagram.com/yourstore",
    "facebook": null,
    "x": null,
    "youtube": null,
    "linkedin": null,
    "tiktok": "@yourstore",
    "email": "hello@example.com"
  }
}
```