pydo.genai.update_agent_api_key()

Generated on 9 Jun 2026 from pydo version v0.36.0

Usage

client.genai.update_agent_api_key(
    agent_uuid="\"123e4567-e89b-12d3-a456-426614174000\"",
    api_key_uuid="\"123e4567-e89b-12d3-a456-426614174000\"",
    body={
        "agent_uuid": "\"12345678-1234-1234-1234-123456789012\"",
        "api_key_uuid": "\"12345678-1234-1234-1234-123456789012\"",
        "name": "\"Production Key\"",
    },
)
Returns JSONRaises HttpResponseError

Description

To update an agent API key, send a PUT request to /v2/gen-ai/agents/{agent_uuid}/api_keys/{api_key_uuid}.

Parameters

agent_uuid string required

Agent id

api_key_uuid string required

API key ID

agent_uuid string optional

Example: "12345678-1234-1234-1234-123456789012"

Agent id

api_key_uuid string optional

Example: "12345678-1234-1234-1234-123456789012"

API key ID

name string optional

Example: "Production Key"

Name

Request Sample

Show Request Sample
import os
from pydo import Client

client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))

req = {
  "agent_uuid": "\"12345678-1234-1234-1234-123456789012\"",
  "api_key_uuid": "\"12345678-1234-1234-1234-123456789012\"",
  "name": "\"Production Key\""
}

resp = client.genai.update_agent_api_key(agent_uuid="\"123e4567-e89b-12d3-a456-426614174000\"", api_key_uuid="\"123e4567-e89b-12d3-a456-426614174000\"", body=req)

Response Example

Show Response Example
{
  "api_key_info": {
    "created_at": "2023-01-01T00:00:00Z",
    "created_by": "12345",
    "deleted_at": "2023-01-01T00:00:00Z",
    "name": "example name",
    "secret_key": "example string",
    "uuid": "123e4567-e89b-12d3-a456-426614174000"
  }
}

More Information

See /v2/gen-ai/agents/{agent_uuid}/api_keys/{api_key_uuid} in the API reference for additional detail on responses, headers, parameters, and more.

We can't find any results for your search.

Try using different keywords or simplifying your search terms.