package main
import(
"context"
"os"
latitudeshgosdk "github.com/latitudesh/latitudesh-go-sdk"
"log"
)
func main() {
ctx := context.Background()
s := latitudeshgosdk.New(
latitudeshgosdk.WithSecurity(os.Getenv("LATITUDESH_BEARER")),
)
res, err := s.APIKeys.List(ctx)
if err != nil {
log.Fatal(err)
}
if res.APIKeys != nil {
// handle response
}
}{
"data": [
{
"id": "tok_6VE1Wd37dXnZJ",
"type": "api_keys",
"attributes": {
"name": "Dor Daidelos",
"token_last_slice": "2daaa",
"api_version": "2023-06-01",
"read_only": false,
"allowed_ips": [],
"created_at": "2026-01-14T15:56:29+00:00",
"updated_at": "2026-01-14T14:56:29+00:00",
"last_used_at": null,
"user": {
"id": "user_Wel4PnEAmauQYZz3Vz83CkyV2BW",
"email": "[email protected]"
}
}
}
],
"meta": {}
}Returns a list of all API keys.
package main
import(
"context"
"os"
latitudeshgosdk "github.com/latitudesh/latitudesh-go-sdk"
"log"
)
func main() {
ctx := context.Background()
s := latitudeshgosdk.New(
latitudeshgosdk.WithSecurity(os.Getenv("LATITUDESH_BEARER")),
)
res, err := s.APIKeys.List(ctx)
if err != nil {
log.Fatal(err)
}
if res.APIKeys != nil {
// handle response
}
}{
"data": [
{
"id": "tok_6VE1Wd37dXnZJ",
"type": "api_keys",
"attributes": {
"name": "Dor Daidelos",
"token_last_slice": "2daaa",
"api_version": "2023-06-01",
"read_only": false,
"allowed_ips": [],
"created_at": "2026-01-14T15:56:29+00:00",
"updated_at": "2026-01-14T14:56:29+00:00",
"last_used_at": null,
"user": {
"id": "user_Wel4PnEAmauQYZz3Vz83CkyV2BW",
"email": "[email protected]"
}
}
}
],
"meta": {}
}Was this page helpful?