Skip to main content

Method

func (s *ApiKeysSvcImpl) List() (ListApiKeysResponse, error)
func (s *ApiKeysSvcImpl) ListWithContext(ctx context.Context) (ListApiKeysResponse, error)
func (s *ApiKeysSvcImpl) ListWithOptions(ctx context.Context, options *ListOptions) (ListApiKeysResponse, error)

Parameters

options
*ListOptions
Pagination options (only available in ListWithOptions)
Limit
*int
Maximum number of API keys to return
After
*string
Cursor for forward pagination
Before
*string
Cursor for backward pagination

Response

Object
string
Always "list"
HasMore
bool
Whether there are more results available
Data
[]ApiKey
Array of API key objects
Id
string
The unique identifier of the API key
Name
string
The name of the API key
CreatedAt
string
ISO 8601 timestamp of when the API key was created

Example

client := resend.NewClient("re_123456789")

response, err := client.ApiKeys.List()
if err != nil {
    panic(err)
}

for _, apiKey := range response.Data {
    fmt.Printf("API Key: %s (%s)\n", apiKey.Name, apiKey.Id)
    fmt.Printf("  Created: %s\n", apiKey.CreatedAt)
}

fmt.Println("Has More:", response.HasMore)

Build docs developers (and LLMs) love