Unicat API Reference

Up - API Reference - Home


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

Requires JWT.

Update API user information.

Only the owner of the project can update API user information.

Request

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

{
    "user": "<api user gid>",
    "name": "Import/export data",
}

user an API user's gid for this project.
name provides a description of what the API key should be used for.

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": "active",
                "roles": [
                    "api"
                ],
                "options": {
                    "rate_limit_per_second": null
                }
            }
        ]
    }
}

result

user is the API user's gid.

data

cc.users is a dictionary with an updated entry for the API user.
cc.projects_members is a list with 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 - update failed