Skip to main content
PUT
/
auth
/
api_keys
/
{api_key_id}
Go (SDK)
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": {}
}

Authorizations

Authorization
string
header
required

Path Parameters

api_key_id
string
required

Body

data
object

Response

200 - application/vnd.api+json

Success

data
object