Update an API Key
Update an API key.
Requires the api-keys-manage permission.
arguments
- namestring
The name of the API key to be generated.
- capabilitiesarray of strings
An array describing the capabilities associated with this API key.
- ipsarray of strings
An array of IP's that are approved to use this API key to make requests.
Returns
Updates a Api Key resource, otherwise returns an Error.
PATCH /v1/hubs/current/api-keys
Example Request
$ curl https://api.cycle.io/v1/hubs/current/api-keys/5cb964ed4fde4d0001d05cc7 \-H'Authorization: Bearer API_KEY'\-H'X-Hub-Id: HUB_ID'\-H 'Content-Type: application/json' \-d '{"name":"updated API key name","capabilities":["dns-view","environment-view","image-view"],"ips":["234.2.3.4","3.2.3.4"]}' \-X PATCH
Example Response
{"data": {"id": "5cb964ed4fde4d0001d05cc7","name": "MainHubKey","creator": {"type": "account","id": "5cb964ed4fde4d0001d05cc7"},"hub_id": "5cb964ed4fde4d0001d05cc7","secret":" SECRET","permissions": {"all_environments": false,"environments": [{"id": "5b9c2a77b6393d0001eb45fd","manage": false}]},"capabilities": {"all": false,"specific": ["dns-view","containers-volumes-view","environments-view","images-view","servers-view","stacks-view"]},"ips": ["185.32.2.3","24.24.1.2","8.2.1.4","3.2.12.42"],"state": {"current": "live","changed": "2018-09-14T21:39:03.096Z"},"events": {"created": "2018-09-14T21:39:03.096Z","updated": "2018-09-17T16:50:54.107Z","deleted": "0001-01-01T00:00:00Z"}}}