Authorizations
Path Parameters
Body
Response
200 - application/vnd.api+json
Success
package main
import(
"context"
"os"
latitudeshgosdk "github.com/latitudesh/latitudesh-go-sdk"
"github.com/latitudesh/latitudesh-go-sdk/models/components"
"log"
)
func main() {
ctx := context.Background()
s := latitudeshgosdk.New(
latitudeshgosdk.WithSecurity(os.Getenv("LATITUDESH_BEARER")),
)
res, err := s.APIKeys.Update(ctx, "tok_zlkg1DegdvZE5", components.UpdateAPIKey{
Data: &components.UpdateAPIKeyData{
ID: latitudeshgosdk.Pointer("tok_zlkg1DegdvZE5"),
Type: components.UpdateAPIKeyTypeAPIKeys,
Attributes: &components.UpdateAPIKeyAttributes{
Name: latitudeshgosdk.Pointer("App Token"),
},
},
})
if err != nil {
log.Fatal(err)
}
if res.Object != nil {
// handle response
}
}{
"data": {
"id": "tok_zlkg1DegdvZE5",
"type": "api_keys",
"attributes": {
"name": "App Token",
"token": "1f9c08588ffa63fcd6e522f091dff08e0fd0",
"token_last_slice": "e0fd0",
"api_version": "2023-06-01",
"created_at": "2025-07-16T18:36:27+00:00",
"updated_at": "2025-07-16T18:36:27+00:00",
"last_used_at": null,
"user": {
"id": "user_Lp2QwzbxephLaWxAnwpouknrPzm",
"email": "[email protected]"
}
}
},
"meta": {}
}Regenerate an existing API Key that is tied to the current user. This overrides the previous key.
package main
import(
"context"
"os"
latitudeshgosdk "github.com/latitudesh/latitudesh-go-sdk"
"github.com/latitudesh/latitudesh-go-sdk/models/components"
"log"
)
func main() {
ctx := context.Background()
s := latitudeshgosdk.New(
latitudeshgosdk.WithSecurity(os.Getenv("LATITUDESH_BEARER")),
)
res, err := s.APIKeys.Update(ctx, "tok_zlkg1DegdvZE5", components.UpdateAPIKey{
Data: &components.UpdateAPIKeyData{
ID: latitudeshgosdk.Pointer("tok_zlkg1DegdvZE5"),
Type: components.UpdateAPIKeyTypeAPIKeys,
Attributes: &components.UpdateAPIKeyAttributes{
Name: latitudeshgosdk.Pointer("App Token"),
},
},
})
if err != nil {
log.Fatal(err)
}
if res.Object != nil {
// handle response
}
}{
"data": {
"id": "tok_zlkg1DegdvZE5",
"type": "api_keys",
"attributes": {
"name": "App Token",
"token": "1f9c08588ffa63fcd6e522f091dff08e0fd0",
"token_last_slice": "e0fd0",
"api_version": "2023-06-01",
"created_at": "2025-07-16T18:36:27+00:00",
"updated_at": "2025-07-16T18:36:27+00:00",
"last_used_at": null,
"user": {
"id": "user_Lp2QwzbxephLaWxAnwpouknrPzm",
"email": "[email protected]"
}
}
},
"meta": {}
}Show child attributes
Success
Show child attributes
Was this page helpful?