Update company API key
PATCH
/company/{id}/apikeys/{apiKeyId}
const url = 'https://api.colourbox.com/company/1/apikeys/1';const options = { method: 'PATCH', headers: { Authorization: 'CBX-SIMPLE-TOKEN Token=<token>', 'Content-Type': 'application/json' }, body: '{"name":"example","active":true}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://api.colourbox.com/company/1/apikeys/1 \ --header 'Authorization: CBX-SIMPLE-TOKEN Token=<token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "example", "active": true }'Rename, deactivate or reactivate a company API key. Deactivating a key signs out everything that signed in with it, through the key and signature or through username, password and HMAC: its tokens are refused from then on, and it cannot be used to obtain new ones. Reactivating the key within 14 days of a token’s last use makes that token valid again. Company administrators only.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
integer
apiKeyId
required
integer
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
name
Send null to clear the name.
string
active
boolean
Example generated
{ "name": "example", "active": true}Responses
Section titled “Responses”The updated key
Media typeapplication/json
object
id
integer
key
string
secret
string
companyId
integer
name
string
active
boolean
createdAt
string format: date-time
deactivatedAt
string format: date-time
Example
{ "id": 56, "companyId": 42}The company has no key with that id