# Get a group by id

`GET /groups/by-id/{id}.json`

Authentication: no security requirement declared for this operation.

Parameters:

- `id` (path, string, required) - Use group name instead of id
  Type: string

Responses:

- 200: success response (by id)

Content type: application/json

Type: any

- `group` (required)
  Type: object
  
  - `id` (required)
    Type: integer
  
  - `automatic` (required)
    Type: boolean
  
  - `name` (required)
    Type: string
  
  - `user_count` (optional)
    Type: integer
  
  - `mentionable_level` (required)
    Type: integer
  
  - `messageable_level` (required)
    Type: integer
  
  - `visibility_level` (required)
    Type: integer
  
  - `primary_group` (required)
    Type: boolean
  
  - `title` (required)
    Type: string; nullable
  
  - `grant_trust_level` (required)
    Type: string; nullable
  
  - `incoming_email` (required)
    Type: string; nullable
  
  - `has_messages` (required)
    Type: boolean
  
  - `flair_url` (required)
    Type: string; nullable
  
  - `flair_bg_color` (required)
    Type: string; nullable
  
  - `flair_color` (required)
    Type: string; nullable
  
  - `bio_raw` (required)
    Type: string; nullable
  
  - `bio_cooked` (required)
    Type: string; nullable
  
  - `bio_excerpt` (required)
    Type: string; nullable
  
  - `public_admission` (required)
    Type: boolean
  
  - `public_exit` (required)
    Type: boolean
  
  - `allow_membership_requests` (required)
    Type: boolean
  
  - `full_name` (required)
    Type: string; nullable
  
  - `default_notification_level` (required)
    Type: integer
  
  - `membership_request_template` (required)
    Type: string; nullable
  
  - `is_group_user` (required)
    Type: boolean
  
  - `members_visibility_level` (required)
    Type: integer
  
  - `can_see_members` (required)
    Type: boolean
  
  - `can_admin_group` (required)
    Type: boolean
  
  - `can_edit_group` (optional)
    Type: boolean
  
  - `publish_read_state` (required)
    Type: boolean
  
  - `is_group_owner_display` (required)
    Type: boolean
  
  - `mentionable` (required)
    Type: boolean
  
  - `messageable` (required)
    Type: boolean
  
  - `automatic_membership_email_domains` (required)
    Type: string; nullable
  
  - `smtp_updated_at` (optional)
    Type: string; nullable
  
  - `smtp_updated_by` (optional)
    Type: object; nullable
  
  - `smtp_enabled` (optional)
    Type: boolean
  
  - `smtp_server` (required)
    Type: string; nullable
  
  - `smtp_port` (required)
    Type: string; nullable
  
  - `smtp_ssl_mode` (required)
    Type: integer; nullable
  
  - `email_username` (required)
    Type: string; nullable
  
  - `email_from_alias` (optional)
    Type: string; nullable
  
  - `email_password` (required)
    Type: string; nullable
  
  - `message_count` (required)
    Type: integer
  
  - `allow_unknown_sender_topic_replies` (required)
    Type: boolean
  
  - `associated_group_ids` (optional)
    Type: Array<any>
    
    Items:
      Type: any
  
  - `watching_category_ids` (required)
    Type: Array<any>
    
    Items:
      Type: any
  
  - `tracking_category_ids` (required)
    Type: Array<any>
    
    Items:
      Type: any
  
  - `watching_first_post_category_ids` (required)
    Type: Array<any>
    
    Items:
      Type: any
  
  - `regular_category_ids` (required)
    Type: Array<any>
    
    Items:
      Type: any
  
  - `muted_category_ids` (required)
    Type: Array<any>
    
    Items:
      Type: any
  
  - `watching_tags` (optional)
    Type: Array<any>
    
    Items:
      Type: any
  
  - `watching_first_post_tags` (optional)
    Type: Array<any>
    
    Items:
      Type: any
  
  - `tracking_tags` (optional)
    Type: Array<any>
    
    Items:
      Type: any
  
  - `regular_tags` (optional)
    Type: Array<any>
    
    Items:
      Type: any
  
  - `muted_tags` (optional)
    Type: Array<any>
    
    Items:
      Type: any
  
  Additional properties: false

- `extras` (required)
  Type: object
  
  - `visible_group_names` (required)
    Type: Array<any>
    
    Items:
      Type: any
  
  Additional properties: false

Additional properties: false

## Examples

### cURL

```bash
curl -X GET 'https://discourse.example.com/groups/by-id/name.json'
```

### JavaScript

```javascript
const response = await fetch('https://discourse.example.com/groups/by-id/name.json', {
  method: 'GET',
});

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

### Python

```python
import requests

response = requests.get('https://discourse.example.com/groups/by-id/name.json')
print(response.text)
```
