Skip to navigation

Archive API User

Archive an API user. Superadmins only. Deletes all of the API user’s keys, so they stop working immediately, then deactivates the API user.

Use this instead of archiving the API user in the Coperniq UI. Archiving it there deactivates the user but does not delete its keys.

If any key can’t be deleted, the response is a 502 and the API user is left active, so no key is left working on an archived account. Retry the request to finish. Archiving an API user that has no keys left is safe and returns 200.

Archiving doesn’t stop new keys from being created. If the person who created the API user calls POST /api-keys again, the API user is reactivated and gets a new key. The archive only returns 200 once it has confirmed no keys are left.

Authenticate with Basic Auth (your Coperniq email and password), not an API key.

Authentication

AuthorizationBasic

Basic authentication of the form Basic <base64(username:password)>.

Path parameters

user_idintegerRequired>=1

The API user’s id from GET /api-users

Query parameters

company_idintegerOptional>=1

ID of the company to manage. Needed only when the authenticated user belongs to more than one company and the default (their first non-collaborator company) is not the one you want. You must be a superadmin in that company. Your company ID can be found in the URL after logging in to the Coperniq UI: https://app.coperniq.io/{company_id}/inbox.

Response

All of the API user's keys were deleted and the API user was deactivated
successbooleanOptional
deletedKeyCountintegerOptional
Number of the API user's keys deleted by this request
failedKeyCountintegerOptional
Number of the API user's keys that could not be deleted
userDeactivatedbooleanOptional
Whether the API user was deactivated
messagestringOptional

Present when success is false

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
409
Conflict Error
502
Bad Gateway Error