# Create ad identity

> A TikTok brand identity from a name and avatar.

Canonical: <https://www.tryadeli.com/docs/api/ads/create-identity>

`POST https://app.tryadeli.com/api/v1/ads/identities`

Authorization: `Bearer <API key>` — see [Authentication](https://www.tryadeli.com/docs/authentication)

**TikTok Ads only.** Creates a brand identity from a display name and an avatar
image. The avatar is an `{ "uploadId" }` from
[media uploads](https://www.tryadeli.com/docs/api/posts/create-media-uploads) (platform `tiktok`) or an `{ "url" }` TikTok can
fetch over HTTPS.

**Body**

| Name          | Type     | Required | Description                              |
| ------------- | -------- | -------- | ---------------------------------------- |
| `adAccountId` | `string` | Yes      | A TikTok advertiser id.                  |
| `displayName` | `string` | Yes      | Shown on the ad, up to 40 characters.    |
| `avatar`      | `object` | Yes      | { uploadId } or { url }: a square image. |

## Request examples

**cURL**

```bash
curl -X POST "https://app.tryadeli.com/api/v1/ads/identities?accountId=00000000-0000-0000-0000-000000000000" \
  -H "Authorization: Bearer $ADELI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "adAccountId": "7000000000000000001",
  "displayName": "Acme",
  "avatar": {
    "url": "https://cdn.example.com/acme.png"
  }
}'
```

**JavaScript**

```javascript
const response = await fetch("https://app.tryadeli.com/api/v1/ads/identities?accountId=00000000-0000-0000-0000-000000000000", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.ADELI_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    adAccountId: "7000000000000000001",
    displayName: "Acme",
    avatar: {
      url: "https://cdn.example.com/acme.png",
    },
  }),
});
console.log(await response.json());
```

**Python**

```python
import os

import requests

response = requests.post(
    "https://app.tryadeli.com/api/v1/ads/identities",
    headers={"Authorization": f"Bearer {os.environ['ADELI_API_KEY']}"},
    params={
        "accountId": "00000000-0000-0000-0000-000000000000",
    },
    json={
        "adAccountId": "7000000000000000001",
        "displayName": "Acme",
        "avatar": {
            "url": "https://cdn.example.com/acme.png",
        },
    },
)
print(response.json())
```

## Responses

### 201

```json
{
  "platform": "tiktok_ads",
  "accountId": "00000000-0000-0000-0000-000000000000",
  "adAccountId": "7000000000000000001",
  "identity": { "id": "7300000000000000003", "type": "CUSTOMIZED_USER", "displayName": "Acme", "avatarUrl": null }
}
```

### 400

```json
{
  "error": {
    "code": "unsupported_for_platform",
    "message": "Ad identities is not available for Meta ads accounts"
  }
}
```
