Published Go SDK
v0.1.10 expects id while the API returns agentId, so its
Agent.ID remains empty. It also serializes optional registration zero values,
cannot update status, and cannot send an explicit empty scopes array.
Provide registration fields explicitly and use REST for status changes or scope
clearing. Repository source on main corrects these contracts with API-shaped
fixtures, but no corrected module tag has been published.Register
agent, err := client.Agents.Register(ctx, grantex.RegisterAgentParams{
Name: "Email Assistant",
Description: "Reads and sends emails",
Scopes: []string{"read:email", "send:email"},
})
Get
agent, err := client.Agents.Get(ctx, "agent-id")
List
result, err := client.Agents.List(ctx)
for _, agent := range result.Agents {
fmt.Printf("%s: %s (%s)\n", agent.ID, agent.Name, agent.Status)
}
Update
name := "Updated Name"
agent, err := client.Agents.Update(ctx, "agent-id", grantex.UpdateAgentParams{
Name: &name,
})
Delete
err := client.Agents.Delete(ctx, "agent-id")
Types
Agent
| Field | Type | Description |
|---|---|---|
ID | string | Agent ID |
DID | string | Decentralized identifier |
Name | string | Display name |
Description | string | Agent description |
Scopes | []string | Registered scopes |
Status | string | "active", "suspended", "revoked" |
DeveloperID | string | Owner developer |
CreatedAt | string | ISO 8601 timestamp |
UpdatedAt | string | ISO 8601 timestamp |