Authorizations
Path Parameters
Body
Response
200 - application/vnd.api+json
Success
import latitudesh_python_sdk
from latitudesh_python_sdk import Latitudesh
import os
with Latitudesh(
bearer=os.getenv("LATITUDESH_BEARER", ""),
) as latitudesh:
res = latitudesh.api_keys.regenerate(api_key_id="tok_pRMLydp0dQKr1", data={
"id": "tok_pRMLydp0dQKr1",
"type": latitudesh_python_sdk.UpdateAPIKeyType.API_KEYS,
"attributes": {
"name": "App Token",
},
})
# Handle response
print(res)
{
"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": "leland_kutch@hayes-beatty.test"
}
}
},
"meta": {}
}
Regenerate an existing API Key that is tied to the current user. This overrides the previous key.
import latitudesh_python_sdk
from latitudesh_python_sdk import Latitudesh
import os
with Latitudesh(
bearer=os.getenv("LATITUDESH_BEARER", ""),
) as latitudesh:
res = latitudesh.api_keys.regenerate(api_key_id="tok_pRMLydp0dQKr1", data={
"id": "tok_pRMLydp0dQKr1",
"type": latitudesh_python_sdk.UpdateAPIKeyType.API_KEYS,
"attributes": {
"name": "App Token",
},
})
# Handle response
print(res)
{
"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": "leland_kutch@hayes-beatty.test"
}
}
},
"meta": {}
}
Show child attributes
Success
Show child attributes
Was this page helpful?