# PUT /api/user/preferred-language

Authentication (security requirement alternatives):

```json
[
  {
    "bearer": []
  },
  {
    "bearer": []
  }
]
```

- bearer: http (bearer), header JWT. Enter JWT token

Request body: application/json (required)

Type: object

Schema: [UpdatePreferredLanguageDTO](https://sourcey-gauzy.pages.dev/api-reference/models/updatepreferredlanguagedto/index.md)

- `preferredLanguage` (required)
  Type: string
  
  enum: ["en","bg","he","ru","fr","es","zh","de","pt","it","nl","pl","ar"]

Responses:

- 202: 

- 401: Unauthorized

- 403: Forbidden

## Examples

### cURL

```bash
curl -X PUT 'http://localhost:3000/api/user/preferred-language' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "preferredLanguage": "en"
}'
```

### JavaScript

```javascript
const body = `{
  "preferredLanguage": "en"
}`;

const response = await fetch('http://localhost:3000/api/user/preferred-language', {
  method: 'PUT',
  headers: {
    'Authorization': 'Bearer YOUR_TOKEN',
    'Content-Type': 'application/json',
  },
  body,
});

const data = await response.text();
```

### Python

```python
import requests

body = '''{
  "preferredLanguage": "en"
}'''

response = requests.put(
    'http://localhost:3000/api/user/preferred-language',
    data=body.encode('utf-8'),
    headers={
        'Authorization': 'Bearer YOUR_TOKEN',
        'Content-Type': 'application/json',
    },
)
print(response.text)
```
