> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/resend/resend-go/llms.txt
> Use this file to discover all available pages before exploring further.

# Get segment

> Retrieve a single segment by ID.

Retrieves detailed information about a specific segment.

## Methods

### Get

```go theme={null}
Get(segmentId string) (Segment, error)
```

Retrieves a segment using the default background context.

### GetWithContext

```go theme={null}
GetWithContext(ctx context.Context, segmentId string) (Segment, error)
```

Retrieves a segment with a custom context for cancellation and timeout control.

## Parameters

<ParamField path="segmentId" type="string" required>
  The unique identifier of the segment to retrieve.
</ParamField>

## Response

<ResponseField name="id" type="string">
  The unique identifier for the segment.
</ResponseField>

<ResponseField name="name" type="string">
  The name of the segment.
</ResponseField>

<ResponseField name="object" type="string">
  The object type, always `segment`.
</ResponseField>

<ResponseField name="created_at" type="string">
  ISO 8601 timestamp of when the segment was created.
</ResponseField>

## Example

```go theme={null}
package main

import (
    "fmt"
    "github.com/resend/resend-go/v2"
)

func main() {
    client := resend.NewClient("re_123456789")

    segment, err := client.Segments.Get("seg_123456")
    if err != nil {
        panic(err)
    }

    fmt.Println("Segment Name:", segment.Name)
    fmt.Println("Created At:", segment.CreatedAt)
}
```
