# `GSShape.parentGroupId`

*Instance Property*

The ID of the parent group.

## Declaration

```swift
var parentGroupId: GSShapeGroup.ID { get set }
```

```objc
@property (nonatomic, strong) GSShapeGroupID parentGroupId;
```

```python
parentGroupId() -> GSShapeGroupID
setParentGroupId_(parentGroupId: GSShapeGroupID)
```

## Discussion

Returns [`GSShapeGroupID.GSShapeGroupIDRoot`](/Core/GlyphsCore/GSShapeGroup/GSShapeGroupID/GSShapeGroupIDRoot) for top-level shapes.

> **See Also**
> [`GSShapeKey.GSShapeKeyParentGroupId`](/Core/GlyphsCore/GSShapeKey/GSShapeKeyParentGroupId)

## See Also

### Shape Hierarchy

- [`GSShape.parentGroup`](/Core/GlyphsCore/GSShape/parentGroup) — The direct containing group in the layer’s shape hierarchy.
- [`GSShape enumerateParentGroupsWithBlock:`](/Core/GlyphsCore/GSShape/enumerateParentGroupsWithBlock:) — Invokes a block for each containing group, from the direct parent through the root group.

