# Invalid verification ISO 3166-1 alpha-2 country code for Serbia

**URL:** <https://community.perplexity.ai/t/invalid-verification-iso-3166-1-alpha-2-country-code-for-serbia/427>\
**Category:** Bug Reports\
**Created:** [June 2, 2025, 3:02am UTC](https://community.perplexity.ai/t/invalid-verification-iso-3166-1-alpha-2-country-code-for-serbia/427 "2025-06-02T03:02:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![vandesa003](https://sea1.discourse-cdn.com/flex001/user_avatar/community.perplexity.ai/vandesa003/32/209_2.png) [@vandesa003](https://community.perplexity.ai/u/vandesa003)\
**Post date:** [June 2, 2025, 3:02am UTC](https://community.perplexity.ai/t/invalid-verification-iso-3166-1-alpha-2-country-code-for-serbia/427/1 "2025-06-02T03:02:34Z")

</div>

## 🐛 Describe the Bug

When pass the country as “RS”, the api returns 400 error code.

```auto
{
  "error": {
    "message": "Validation error: country must be provided as a valid 2-digit ISO country code, got RS",
    "type": "invalid_country_code",
    "code": 400
  }
}

```

But RS is indeed a valid ISO 3166-1 alpha-2 country code for Serbia.  
Request to reproduce:

```auto
curl --request POST \
  --url https://api.perplexity.ai/chat/completions \
  --header 'Authorization: Bearer xxxx' \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "sonar",
  "messages": [
    {
      "content": "masking puff gde kupiti",
      "role": "user"
    }
  ],
  "max_tokens": 123,
  "temperature": 0.2,
  "top_p": 0.9,
  "search_domain_filter": [
    "<any>"
  ],
  "return_images": false,
  "return_related_questions": false,
  "search_recency_filter": "<string>",
  "top_k": 0,
  "stream": false,
  "presence_penalty": 0,
  "frequency_penalty": 1,
  "response_format": {},
  "web_search_options": {
    "search_context_size": "low",
    "user_location": {
      "country": "RS"
    }
  }
}'

```

```auto
## ✅ Expected Behavior
successful code 200.

## ❌ Actual Behavior
400 bad request

## 🔄 Steps to Reproduce
1. Call the API with the following request:
2. Observe the unexpected behavior.

## 📌 API Request & Response (if applicable)

## 🌍 Environment
- **API Version:** [e.g., sonar-3.1]
- **SDK (if applicable):** [e.g., Python SDK v0.5]
- **Operating System:** [e.g., MacOS, Linux, Windows]

## 📎 Logs or Screenshots (if applicable)
Add any logs or screenshots that can help debug the issue.

## 📝 Additional Context
Add any other context about the problem here.
```

---

<div class="post-metadata">

**Author:** ![vandesa003](https://sea1.discourse-cdn.com/flex001/user_avatar/community.perplexity.ai/vandesa003/32/209_2.png) [@vandesa003](https://community.perplexity.ai/u/vandesa003)\
**Post date:** [June 4, 2025, 2:08am UTC](https://community.perplexity.ai/t/invalid-verification-iso-3166-1-alpha-2-country-code-for-serbia/427/2 "2025-06-04T02:08:35Z")

</div>

also PR stands for Puerto Rico, it returns 400 error as well.  
or anyone knows which standard is used in perplexity?

---

<div class="post-metadata">

**Author:** ![jamesliounis](https://sea1.discourse-cdn.com/flex001/user_avatar/community.perplexity.ai/jamesliounis/32/897_2.png) [@jamesliounis](https://community.perplexity.ai/u/jamesliounis)\
**Post date:** [June 8, 2025, 7:54pm UTC](https://community.perplexity.ai/t/invalid-verification-iso-3166-1-alpha-2-country-code-for-serbia/427/3 "2025-06-08T19:54:59Z")

</div>

Your request is correct, this is indeed a bug here. We will be resolving this on our end ASAP.

---

<div class="post-metadata">

**Author:** ![jamesliounis](https://sea1.discourse-cdn.com/flex001/user_avatar/community.perplexity.ai/jamesliounis/32/897_2.png) [@jamesliounis](https://community.perplexity.ai/u/jamesliounis)\
**Post date:** [June 8, 2025, 9:35pm UTC](https://community.perplexity.ai/t/invalid-verification-iso-3166-1-alpha-2-country-code-for-serbia/427/4 "2025-06-08T21:35:13Z")

</div>

This should have been resolved.
