Admins Reference

    /admins

    Response

    1. "data": [{
    2. "created_at": 1556638385,
    3. "id": "665b4070-541f-48bf-82c1-53030babaa81",
    4. "updated_at": 1556638385,
    5. "status": 4,
    6. "username": "test-admin",
    7. "email": "test@test.com",
    8. "rbac_token_enabled": true
    9. }, {
    10. "created_at": 1556563122,
    11. "id": "a93ff120-9e6c-4198-b47e-f779104c7eac",
    12. "updated_at": 1556563122,
    13. "status": 0,
    14. "username": "kong_admin",
    15. "rbac_token_enabled": false
    16. }],
    17. "next": null
    18. }

    Invite an Admin

    Endpoint

    /admins

    Response

    1. HTTP 200 OK
    1. {
    2. "admin": {
    3. "created_at": 1556638641,
    4. "updated_at": 1556638641,
    5. "status": 4,
    6. "username": "test-case-3",
    7. "email": "test3@test.com",
    8. "rbac_token_enabled": true
    9. }
    10. }

    Register an Admin’s Credentials

    Endpoint

    /admins/register

    AttributeDescription
    tokenThe authentication token
    usernameThe Admin’s username
    emailThe Admin’s email address
    passwordThe Admin’s new password

    Response

    1. HTTP 201 Created

    Send a Password-Reset Email to an Admin

    Endpoint

    /admins/password_resets

    AttributeDescription
    The Admin’s email address

    Response

    1. HTTP 201 Created

    /admins/password_resets

    Response

    Retrieve an Admin

    Endpoint

    /admins/{name_or_id}

    AttributeDescription
    name_or_idThe Admin’s username or ID
    generate_register_url
    optional
    true returns a unique registration URL for the Admin

    Notes:

    • generate_register_url will only generate a URL if the Admin’s invitation status is 4 (“invited”).
    • generate_register_url will override the preåvious registration URL for the particular Admin each time it is requested.

    Response

    1. HTTP 200 OK
    1. {
    2. "created_at": 1556638385,
    3. "id": "665b4070-541f-48bf-82c1-53030babaa81",
    4. "updated_at": 1556638385,
    5. "status": 4,
    6. "username": "test-admin",
    7. "email": "test@test.com",
    8. "rbac_token_enabled": true
    9. }

    Update an Admin

    Endpoint

    /admins/{name_or_id}

    AttributeDescription
    name_or_idThe Admin’s current username or custom ID
    email
    optional
    The Admin’s new email address
    username
    optional
    The Admin’s new username
    custom_id
    optional
    The Admin’s new custom ID
    rbac_token_enabledAllows the Admin to use and reset their RBAC token; true by default

    Response

    1. HTTP 200 OK
    1. {
    2. "created_at": 1556638385,
    3. "id": "665b4070-541f-48bf-82c1-53030babaa81",
    4. "updated_at": 1556639017,
    5. "status": 4,
    6. "username": "test-renamed",
    7. "email": "test@test.com"
    8. "rbac_token_enabled": true
    9. }

    Delete an Admin

    Endpoint

    /admins/{name_or_id}

    1. HTTP 204 No Content

    Endpoint

    /admins/{name_or_id}/roles

    AttributeDescription
    name_or_idThe Admin’s username or ID

    Response

    1. {
    2. "roles": [{
    3. "id": "7574eb1d-c9fa-46a9-bd3a-3f1b4b196287",
    4. "name": "read-only",
    5. "is_default": false
    6. }, {
    7. "comment": "Full access to all endpoints, across all workspaces—except RBAC Admin API",
    8. "created_at": 1556563122,
    9. "id": "7fdea5c8-2bfa-4aa9-9c21-7bb9e607186d",
    10. "name": "admin",
    11. "is_default": false
    12. }]
    13. }

    Create or Update an Admin’s Roles

    Endpoint

    /admins/{name_or_id}/roles

    AttributeDescription
    name_or_idThe Admin’s current username or ID
    roles(comma separated) string of names of Roles to create or update for an Admin

    Response

    1. HTTP 201 OK
    1. {
    2. "roles": [{
    3. "comment": "Read access to all endpoints, across all workspaces",
    4. "created_at": 1556563122,
    5. "id": "7574eb1d-c9fa-46a9-bd3a-3f1b4b196287",
    6. "name": "read-only",
    7. "is_default": false
    8. }, {
    9. "comment": "Full access to all endpoints, across all workspaces—except RBAC Admin API",
    10. "created_at": 1556563122,
    11. "id": "7fdea5c8-2bfa-4aa9-9c21-7bb9e607186d",
    12. "name": "admin",
    13. "is_default": false
    14. }, {
    15. "comment": "Full access to all endpoints, across all workspaces",
    16. "created_at": 1556563122,
    17. "id": "99bd8d18-f5b6-410e-aefe-d75f4252f13c",
    18. "name": "super-admin",
    19. "is_default": false
    20. }]
    21. }

    Delete an Admin’s Role

    Endpoint

    /admins/{name_or_id}/roles

    Response

    1. HTTP 204 No Content

    List an Admin’s Workspaces

    Endpoint

    /admins/{name_or_id}/workspaces

    AttributeDescription
    name_or_idThe Admin’s username or ID