AddAPIKey adds a new API key by sending old=nil, new=key which appends.
(key string)
| 258 | |
| 259 | // AddAPIKey adds a new API key by sending old=nil, new=key which appends. |
| 260 | func (c *Client) AddAPIKey(key string) error { |
| 261 | body := map[string]any{"old": nil, "new": key} |
| 262 | jsonBody, _ := json.Marshal(body) |
| 263 | _, err := c.patch("/v0/management/api-keys", strings.NewReader(string(jsonBody))) |
| 264 | return err |
| 265 | } |
| 266 | |
| 267 | // EditAPIKey replaces an API key at the given index. |
| 268 | func (c *Client) EditAPIKey(index int, newValue string) error { |