# Cannot create blog post language variation via API

**URL:** <https://community.hubspot.com/t/cannot-create-blog-post-language-variation-via-api/51479>\
**Category:** APIs & Integrations\
**Tags:** cms-content\
**Created:** [February 14, 2022, 2:30pm UTC](https://community.hubspot.com/t/cannot-create-blog-post-language-variation-via-api/51479 "2022-02-14T14:30:11Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![okoula](https://avatars.discourse-cdn.com/v4/letter/o/898d66/32.png) [@okoula](https://community.hubspot.com/u/okoula)\
**Post date:** [February 14, 2022, 2:30pm UTC](https://community.hubspot.com/t/cannot-create-blog-post-language-variation-via-api/51479/1 "2022-02-14T14:30:11Z")

</div>

Hello,

I have a problem with localizing blog post, where I am trying to create its language variation via endpoint:

`cms/v3/blogs/posts/multi-language/create-language-variation`

with data:

```lia-code-sample
{
 "blogPostId": "45766901518",
 "language": "it",
 "primaryLanguage": "en",
 "contentGroupId": "5400250929"
}

```

I have a blog post that is localized to English and I want to add language variation for Italian. But I get this 400 error: `Master blog post language cannot be changed.`

This happens no mather what primary language I set. If I omit the primary language, I get

‘Master with id: 45766901518 has same language as variation: en’.

So what’s the correct behavior and what am I expected to set to the request body to make a correct language variation? Is there any description or article about working with the endpoint? There is no any specification in documentation I found in [here](https://developers.hubspot.com/docs/api/cms/blog-post) .

Thank you for your response,

Ondrej

---

<div class="post-metadata">

**Author:** ![dennisedson](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dennisedson/32/28044_2.png) [@dennisedson](https://community.hubspot.com/u/dennisedson)\
**Post date:** [February 15, 2022, 6:57pm UTC](https://community.hubspot.com/t/cannot-create-blog-post-language-variation-via-api/51479/2 "2022-02-15T18:57:11Z")

</div>

@piersg , have you toyed with this before?

---

<div class="post-metadata">

**Author:** ![thibaultdalban](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/thibaultdalban/32/192749_2.png) [@thibaultdalban](https://community.hubspot.com/u/thibaultdalban)\
**Post date:** [February 21, 2022, 5:48pm UTC](https://community.hubspot.com/t/cannot-create-blog-post-language-variation-via-api/51479/3 "2022-02-21T17:48:06Z")

</div>

Hi,

Same issue for me.

---

<div class="post-metadata">

**Author:** ![FabianRichter](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/fabianrichter/32/79091_2.png) [@FabianRichter](https://community.hubspot.com/u/FabianRichter)\
**Post date:** [February 23, 2022, 12:31pm UTC](https://community.hubspot.com/t/cannot-create-blog-post-language-variation-via-api/51479/4 "2022-02-23T12:31:17Z")

</div>

Hi, I experience the same issue. I don’t know how to proceed here, it’s urgent!

---

<div class="post-metadata">

**Author:** ![DGPI](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dgpi/32/193759_2.png) [@DGPI](https://community.hubspot.com/u/DGPI)\
**Post date:** [March 2, 2022, 5:55pm UTC](https://community.hubspot.com/t/cannot-create-blog-post-language-variation-via-api/51479/5 "2022-03-02T17:55:51Z")

</div>

Hi there,

I’m experiencing the same issue and I couldn’t figure out the solution. I would appreciate if anyone could help on this!

I’m using the following parameters in my requests:

**URL** : [https://api.hubapi.com/cms/v3/blogs/posts/multi-language/create-language-variation?hapikey=](https://api.hubapi.com/cms/v3/blogs/posts/multi-language/create-language-variation?hapikey=)…

**Data** : {“id”: “67470989399”, “primaryLanguage”: “en”, “language”: “es”, “contentGroupId”: 67479844256}

**Content Type** : application/json

And I’m getting the following error:

```lia-code-sample
{
"correlationId": "8b4f1bec-af62-411e-8a62-369e84a8a862",
"message": "Master blog post language cannot be changed.",
"status": "error"
}

```

Regards

---

<div class="post-metadata">

**Author:** ![FabianRichter](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/fabianrichter/32/79091_2.png) [@FabianRichter](https://community.hubspot.com/u/FabianRichter)\
**Post date:** [April 8, 2022, 7:36am UTC](https://community.hubspot.com/t/cannot-create-blog-post-language-variation-via-api/51479/6 "2022-04-08T07:36:36Z")

</div>

Hi,  
as I commented earlier, I have opened a ticket regarding this issue. Today I finally got good news that this issue is fixed. The endpoint now does work as expected.

I used Python and this is the function I built to create language variations of blog posts:

```lia-code-sample
import json
import requests

def create_lang_by_id(type: str, language: str, key, id, content_group_id):
 querystring = { "hapikey": key }
 url = "https://api.hubapi.com/cms/v3//blogs/posts/multi-language/create-language-variation"
 headers = {
 "accept": "application/json",
 "content-type": "application/json"
 }

 payload = json.dumps({
 "id": str(id),
 "language": language,
 "primaryLanguage": "en",
 "contentGroupId": str(content_group_id)
 })

 response = requests.request("POST", url, data=payload, headers=headers, params=querystring)
 return response

```

Best,  
Fabian

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [April 8, 2022, 11:05pm UTC](https://community.hubspot.com/t/cannot-create-blog-post-language-variation-via-api/51479/7 "2022-04-08T23:05:18Z")

</div>

Hey, @FabianRichter! Thanks again for filing this as a support ticket 🙌 We appreciate YOU!

---

<div class="post-metadata">

**Author:** ![DGPI](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dgpi/32/193759_2.png) [@DGPI](https://community.hubspot.com/u/DGPI)\
**Post date:** [April 18, 2022, 7:18pm UTC](https://community.hubspot.com/t/cannot-create-blog-post-language-variation-via-api/51479/8 "2022-04-18T19:18:17Z")

</div>

Thanks @FabianRichter! Now it works well on my end 😊

---

<div class="post-metadata">

**Author:** ![KYuen](https://avatars.discourse-cdn.com/v4/letter/k/9dc877/32.png) [@KYuen](https://community.hubspot.com/u/KYuen)\
**Post date:** [April 19, 2022, 3:13pm UTC](https://community.hubspot.com/t/cannot-create-blog-post-language-variation-via-api/51479/9 "2022-04-19T15:13:10Z")

</div>

This issue has been resolved as @FabianRichter mentioned! You can create language variations via the endpoint as expected.
