Method
Parameters
Response
The unique identifier of the created API key
The API key token. Store this securely - it’s only shown once.
Learn more about Mintlify
Enter your email to receive updates about new features and product releases.
Create a new API key for authentication.
func (s *ApiKeysSvcImpl) Create(params *CreateApiKeyRequest) (CreateApiKeyResponse, error)
func (s *ApiKeysSvcImpl) CreateWithContext(ctx context.Context, params *CreateApiKeyRequest) (CreateApiKeyResponse, error)
client := resend.NewClient("re_123456789")
params := &resend.CreateApiKeyRequest{
Name: "Production API Key",
Permission: "full_access",
}
apiKey, err := client.ApiKeys.Create(params)
if err != nil {
panic(err)
}
fmt.Println("API Key ID:", apiKey.Id)
fmt.Println("Token:", apiKey.Token)