Admins Reference

List Admins

Endpoint

/admins

Response

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

The status field in the response indicates if the admin has accepted their invitation:

CodeStatus
0Approved
1Pending
2Rejected
3Revoked
4Invited
5Unverified

Invite an Admin

Endpoint

/admins

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

Response

  1. HTTP 200 OK
  1. {
  2. "admin": {
  3. "created_at": 1556638641,
  4. "id": "8f0a742f-07f3-49e0-90d7-4fc7eea7e6a4",
  5. "updated_at": 1556638641,
  6. "status": 4,
  7. "username": "test-case-3",
  8. "email": "test3@test.com",
  9. "rbac_token_enabled": true
  10. }
  11. }

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
emailThe Admin’s email address

Response

  1. HTTP 201 Created

Reset an Admin’s Password

Endpoint

/admins/password_resets

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

Response

  1. HTTP 200 OK

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 previous 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}

AttributeDescription
name_or_idThe Admin’s username or ID

Response

  1. HTTP 204 No Content

List an Admin’s Roles

Endpoint

/admins/{name_or_id}/roles

AttributeDescription
name_or_idThe Admin’s username or ID

Response

  1. HTTP 200 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. }

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

AttributeDescription
name_or_idThe Admin’s current username or custom ID
roles(comma separated) string of names of Roles to remove from an Admin

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

Response

  1. HTTP 200 OK
  1. [{
  2. "created_at": 1556563122,
  3. "config": {
  4. "portal": true,
  5. "portal_auto_approve": true
  6. },
  7. "id": "00000000-0000-0000-0000-000000000000",
  8. "name": "default",
  9. "meta": {}
  10. }, {
  11. "created_at": 1556570807,
  12. "config": {
  13. "portal": true
  14. },
  15. "id": "57b3ce24-6d29-427f-af13-15bd60430e56",
  16. "name": "sdfgsdfg",
  17. "meta": {
  18. "color": "#3894f0"
  19. }
  20. }]