Workspaces Reference

    The Workspace object describes the Workspace entity, which has an ID and a name.

    Endpoint

    /workspaces/

    Request Body

    Response

    1. {
    2. "comment": null,
    3. "config": {
    4. "meta": null,
    5. "portal": false,
    6. "portal_access_request_email": null,
    7. "portal_approved_email": null,
    8. "portal_auth": null,
    9. "portal_auth_conf": null,
    10. "portal_auto_approve": null,
    11. "portal_cors_origins": null,
    12. "portal_developer_meta_fields": "[{\"label\":\"Full Name\",\"title\":\"full_name\",\"validator\":{\"required\":true,\"type\":\"string\"}}]",
    13. "portal_emails_from": null,
    14. "portal_emails_reply_to": null,
    15. "portal_invite_email": null,
    16. "portal_reset_email": null,
    17. "portal_reset_success_email": null,
    18. "portal_token_exp": null
    19. },
    20. "created_at": 1557441226,
    21. "id": "c663cca5-c6f6-474a-ae44-01f62aba16a9",
    22. "meta": {
    23. "color": null,
    24. "thumbnail": null
    25. },
    26. "name": "green-team"
    27. }

    List Workspaces

    Endpoint

    /workspaces/

    Response

    1. HTTP 200 OK
    1. {
    2. "data": [
    3. {
    4. "comment": null,
    5. "config": {
    6. "meta": null,
    7. "portal": false,
    8. "portal_access_request_email": null,
    9. "portal_approved_email": null,
    10. "portal_auth": null,
    11. "portal_auth_conf": null,
    12. "portal_auto_approve": null,
    13. "portal_cors_origins": null,
    14. "portal_developer_meta_fields": "[{\"label\":\"Full Name\",\"title\":\"full_name\",\"validator\":{\"required\":true,\"type\":\"string\"}}]",
    15. "portal_emails_from": null,
    16. "portal_emails_reply_to": null,
    17. "portal_invite_email": null,
    18. "portal_reset_email": null,
    19. "portal_reset_success_email": null,
    20. },
    21. "created_at": 1557419951,
    22. "id": "00000000-0000-0000-0000-000000000000",
    23. "meta": {
    24. "color": null,
    25. "thumbnail": null
    26. },
    27. "name": "default"
    28. },
    29. {
    30. "comment": null,
    31. "meta": null,
    32. "portal": false,
    33. "portal_access_request_email": null,
    34. "portal_approved_email": null,
    35. "portal_auth": null,
    36. "portal_auth_conf": null,
    37. "portal_auto_approve": null,
    38. "portal_cors_origins": null,
    39. "portal_developer_meta_fields": "[{\"label\":\"Full Name\",\"title\":\"full_name\",\"validator\":{\"required\":true,\"type\":\"string\"}}]",
    40. "portal_emails_from": null,
    41. "portal_emails_reply_to": null,
    42. "portal_invite_email": null,
    43. "portal_reset_email": null,
    44. "portal_reset_success_email": null,
    45. "portal_token_exp": null
    46. },
    47. "created_at": 1557441226,
    48. "id": "c663cca5-c6f6-474a-ae44-01f62aba16a9",
    49. "meta": {
    50. "color": null,
    51. "thumbnail": null
    52. },
    53. "name": "green-team"
    54. }
    55. ],
    56. "next": null
    57. }

    /workspaces/{id}

    AttributesDescription
    id
    conditional
    The Workspace’s unique ID, if replacing it.*
    • The behavior of PUT endpoints is the following: if the request payload does not contain an entity’s primary key (id for Workspaces), the entity will be created with the given payload. If the request payload does contain an entity’s primary key, the payload will “replace” the entity specified by the given primary key. If the primary key is not that of an existing entity, 404 NOT FOUND will be returned.

    Request Body

    Response

    If creating the entity:

    If replacing the entity:

    1. HTTP 200 OK
    1. {
    2. "comment": null,
    3. "config": {
    4. "meta": null,
    5. "portal": false,
    6. "portal_access_request_email": null,
    7. "portal_approved_email": null,
    8. "portal_auth": null,
    9. "portal_auth_conf": null,
    10. "portal_auto_approve": null,
    11. "portal_cors_origins": null,
    12. "portal_developer_meta_fields": "[{\"label\":\"Full Name\",\"title\":\"full_name\",\"validator\":{\"required\":true,\"type\":\"string\"}}]",
    13. "portal_emails_from": null,
    14. "portal_emails_reply_to": null,
    15. "portal_invite_email": null,
    16. "portal_reset_email": null,
    17. "portal_reset_success_email": null,
    18. "portal_token_exp": null
    19. },
    20. "id": "c663cca5-c6f6-474a-ae44-01f62aba16a9",
    21. "meta": {
    22. "color": null,
    23. "thumbnail": null
    24. },
    25. "name": "rocket-team"

    Retrieve a Workspace

    Endpoint

    /workspaces/{name or id}

    AttributesDescription
    name or id
    required
    The unique identifier or the name of the Workspace to retrieve

    Response

    1. HTTP 200 OK

    Endpoint

    Response

    1. HTTP 200 OK
    1. {
    2. "counts": {
    3. "acls": 1,
    4. "apis": 1,
    5. "basicauth_credentials": 1,
    6. "consumers": 1234,
    7. "files": 41,
    8. "hmacauth_credentials": 1,
    9. "jwt_secrets": 1,
    10. "keyauth_credentials": 1,
    11. "oauth2_authorization_codes": 1,
    12. "oauth2_credentials": 1,
    13. "oauth2_tokens": 1,
    14. "plugins": 5,
    15. "rbac_roles": 3,
    16. "rbac_users": 12,
    17. "routes": 15,
    18. "services": 2,
    19. "ssl_certificates": 1,
    20. "ssl_servers_names": 1,
    21. "targets": 1,
    22. "upstreams": 1
    23. }
    24. }

    Delete a Workspace

    Endpoint

    /workspaces/{name or id}

    AttributesDescription
    name or id
    required
    The unique identifier or the name of the Workspace to delete

    Note: All entities within a Workspace must be deleted before the Workspace itself can be.

    Response

    1. HTTP 204 No Content

    Endpoint

    /workspaces/{name or id}

    Request Body

    AttributesDescription
    commentA string describing the Workspace

    The behavior of PATCH endpoints prevents the renaming of a Workspace.

    1. {
    2. "comment": "this is a sample comment in the patch request",
    3. "config": {
    4. "meta": null,
    5. "portal": false,
    6. "portal_access_request_email": null,
    7. "portal_approved_email": null,
    8. "portal_auth": null,
    9. "portal_auth_conf": null,
    10. "portal_auto_approve": null,
    11. "portal_cors_origins": null,
    12. "portal_developer_meta_fields": "[{\"label\":\"Full Name\",\"title\":\"full_name\",\"validator\":{\"required\":true,\"type\":\"string\"}}]",
    13. "portal_emails_from": null,
    14. "portal_emails_reply_to": null,
    15. "portal_invite_email": null,
    16. "portal_reset_email": null,
    17. "portal_reset_success_email": null,
    18. "portal_token_exp": null
    19. },
    20. "created_at": 1557509909,
    21. "id": "c543d2c8-d297-4c9c-adf5-cd64212868fd",
    22. "meta": {
    23. "color": null,
    24. "thumbnail": null
    25. },
    26. "name": "green-team"