Unicat API Reference

Up - API Reference - Home


/api/p/<project gid>/apikeys/deactivate

Requires JWT.

Deactivate an API user.

A deactivated user can no longer access the project.

Only the owner of the project can deactivate an API user.

Request

POST /api/p/<project gid>/apikeys/deactivate
Authorization: Bearer <JWT>

{
    "user": "<api user gid>",
}

user an API user's gid for this project.

Success response

Authorization: <JWT>

{
    "success": true,
    "result": {
        "user": "<api user gid>",
    },
    "data": {
        "cc.users": {
            "<api user gid>": {
                "gid": "<api user gid>",
                "name": "Import/export data",
                "avatar": null,
                "username": null
            },
        },
        "cc.projects_members": [
            {
                "project_gid": "<project gid>",
                "user_gid": "<api user gid>",
                "status": "inactive",
                "roles": [
                    "api"
                ],
                "options": {
                    "rate_limit_per_second": null
                }
            }
        ]
    }
}

result

user is the API user's gid.

data

cc.users is a dictionary with an entry for the API user.
cc.projects_members is a list with updated metadata for the API user for this project.

Error responses

401 Unauthorized - missing or expired JWT
403 Forbidden - not the owner of this project
422 Unprocessable entity - deactivation failed