Skip to main content

Access zones Management (/v2/access-zones)

Updated over a month ago

This section details the endpoints for creating, listing, modifying, and deleting access zones, which are used to manage permissions on metrics.


List all access zones

Description

This request retrieves a list of all access zones configured in the system, with options to filter and paginate the results.

GET /v2/access-zones

Scope

To execute this request, you must have the following scope: metrics:read.

Parameters

  • name (string, optional): Filters zones whose name contains this string.

  • includeGroups (boolean, optional): If true (default), includes the list of group IDs associated with each zone.

  • limit (integer, optional): Number of results per page (default: 50).

  • paginationKey (string, optional): Key to get the next page of results (see pagination handling).

These parameters must be added to the end of the URL to build the query string. The first is preceded by a "?" and the following ones are separated by an "&":

General syntax of the GET request: .../access-zones?name=[name_filter]&includeGroups=[true|false]&limit=[limit]

Example request

# Command to list all access zones
curl -X GET \
'https://xxx.indaba.api.indasuite.io-base.com/v2/access-zones' \
-H 'Authorization: Bearer VOTRE_JETON_JWT'

Responses

Example of a valid response (200 OK) :

{ 
"data": [
{
"id": "4e1daf3a-9a1c-4c54-a6ea-f826e03c4270",
"name": "#DefaultAccessZoneRead",
"groups": [
"67918ae6-f285-4bfc-b23e-e08baa5e275b"
],
"accessType": "Read",
"isDefault": true
}
],
"paginationInfo": {
"count": 1,
"isComplete": true
},
"statusCode": 1010,
"message": "OK"
}

Pagination Handling (isComplete)

Please refer to the section on pagination handling.

Common Errors

Please refer to the list of common errors.


List my access zones

Description

This request retrieves the list of access zones to which the authenticated user belongs.

GET /v2/access-zones/me

Scope

To execute this request, you must have the following scope: metrics:read.

Example request

# Command to list my own access zones
curl -X GET \
'https://xxx.indaba.api.indasuite.io-base.com/v2/access-zones/me' \
-H 'Authorization: Bearer VOTRE_JETON_JWT'

Responses

Example of a valid response (200 OK) :

{ 
"data": [
{
"id": "4e1daf3a-9a1c-4c54-a6ea-f826e03c4270",
"name": "#DefaultAccessZoneRead",
"accessType": "Read",
"isDefault": true
}
],
"statusCode": 1010,
"message": "OK"
}

Pagination Handling (isComplete)

Please refer to the section on pagination handling.

Common Errors

Please refer to the list of common errors.


List my access zones

Description

This request retrieves the list of access zones to which the authenticated user belongs.

GET /v2/access-zones/me

Scope

To execute this request, you must have the following scope: metrics:read.

Example request

# Command to list my own access zones
curl -X GET \
'https://xxx.indaba.api.indasuite.io-base.com/v2/access-zones/me' \
-H 'Authorization: Bearer VOTRE_JETON_JWT'

Responses

Example of a valid response (200 OK) :

{ 
"data": [
{
"id": "4e1daf3a-9a1c-4c54-a6ea-f826e03c4270",
"name": "#DefaultAccessZoneRead",
"accessType": "Read",
"isDefault": true
}
],
"statusCode": 1010,
"message": "OK"
}

Common Errors

Please refer to the list of common errors.


Create a new access zone

Description

This request allows you to create a new access zone.

POST /v2/access-zones

Scope

To execute this request, you must have the following scope: metrics:admin.

Request Body

  • name (string, required): Unique name for the access zone.

  • accessType (string, required): Type of access (Read, Write, or ReadWrite).

  • groups (array of uuid, optional): List of user group IDs to associate with this zone.

The following parameters must be provided in the request body, in JSON format.

General syntax of the request body:

{ 
"name": "nom_unique_de_la_zone",
"accessType": "Read | Write | ReadWrite",
"groups": [ "uuid_groupe_1", "uuid_groupe_2" ]
}

Request example

# Command to create a new access zone
curl -X POST \
--url 'https://xxx.indaba.api.indasuite.io-base.com/v2/access-zones' \

# ----- Headers -----
-H 'Authorization: Bearer VOTRE_JETON_JWT' \
-H 'Content-Type: application/json' \

# ----- Request body -----
-d '
{
"name": "TestZone_API_Creation",
"accessType": "ReadWrite"
}
'

Responses

Example of a valid response (200 OK) :

{ 
"data": {
"id": "0894d6cc-9234-4cba-82ad-c1bacaf71a07",
"name": "TestZone_API_Creation",
"accessType": "ReadWrite",
"isDefault": false
},
"statusCode": 1010,
"message": "OK"
}

Common Errors

Please refer to the list of common errors.


Get access zone details

Description

This request retrieves the complete configuration for a single access zone using its ID.

GET /v2/access-zones/{accessZoneId}

Scope

To execute this request, you must have the following scope: metrics:read.

Parameters

  • accessZoneId (uuid, required): ID of the access zone.

This request uses a path parameter, which is integrated directly into the URL.

General syntax of the GET request: .../access-zones/[access_zone_uuid]

Example request

# Command to get the zone with the ID '0894d6cc-...'
curl -X GET \
'https://xxx.indaba.api.indasuite.io-base.com/v2/access-zones/0894d6cc-9234-4cba-82ad-c1bacaf71a07' \
-H 'Authorization: Bearer VOTRE_JETON_JWT'

Responses

Example of a valid response (200 OK) :

{ 
"data": {
"id": "0894d6cc-9234-4cba-82ad-c1bacaf71a07",
"name": "TestZone_API_Creation",
"accessType": "ReadWrite",
"isDefault": false
},
"statusCode": 1010,
"message": "OK"
}

Common Errors

Please refer to the list of common errors.


Update an access zone

Description

This request allows you to modify the name and access type of an existing zone.

PUT /v2/access-zones/{accessZoneId}

Scope

To execute this request, you must have the following scope: metrics:admin.

Parameters

  • accessZoneId (uuid, required): ID of the access zone to modify.

This request uses a path parameter, which is integrated directly into the URL.

General URL syntax: .../access-zones/[access_zone_uuid]

Request Body

  • name (string, required): The new name for the zone.

  • accessType (string, required): The new access type (Read, Write, ReadWrite).

The following fields must be provided in the request body, in JSON format.

General syntax of the request body:


{
"name": "nouveau_nom_de_la_zone",
"accessType": "Read | Write | ReadWrite"
}

Example request

# Command to update an access zone
curl -X PUT \
--url 'https://xxx.indaba.api.indasuite.io-base.com/v2/access-zones/0894d6cc-9234-4cba-82ad-c1bacaf71a07' \

# ----- Headers -----
-H 'Authorization: Bearer VOTRE_JETON_JWT' \
-H 'Content-Type: application/json' \

# ----- Body -----
-d '
{
"name": "TestZone_updated_name",
"accessType": "Read"
}
'

Responses

Example of a valid response (200 OK) :

{ 
"data": {
"id": "0894d6cc-9234-4cba-82ad-c1bacaf71a07",
"name": "TestZone_updated_name",
"accessType": "Read",
"isDefault": false
},
"statusCode": 1010,
"message": "OK"
}

Common Errors

Please refer to the list of common errors.


Update an access zone's groups (Patch)

Description

This request allows you to add and/or remove user groups from an access zone without modifying its other properties.

PATCH /v2/access-zones/{accessZoneId}/groups

Scope

To execute this request, you must have the following scope: metrics:admin.

Parameters

  • accessZoneId (uuid, required): ID of the access zone to modify.

This request uses a path parameter, which is integrated directly into the URL.

General URL syntax :

.../access-zones/[access_zone_uuid]/groups

Request Body

The following fields must be provided in the request body, in JSON format.

  • groupsToAdd (array of uuid, optional): List of group IDs to add.

  • groupsToRemove (array of uuid, optional): List of group IDs to remove.

{ 
"groupsToAdd": [ "uuid_groupe_a_ajouter_1" ],
"groupsToRemove": [ "uuid_groupe_a_retirer_1" ]
}

Example request

# Command to add a group to an access zone
curl -X PATCH \
--url 'https://xxx.indaba.api.indasuite.io-base.com/v2/access-zones/0894d6cc-9234-4cba-82ad-c1bacaf71a07/groups' \

# ----- Headers -----
-H 'Authorization: Bearer VOTRE_JETON_JWT' \
-H 'Content-Type: application/json' \

# ----- Body -----
-d '
{
"groupsToAdd": [ "6dbdeed1-8ab4-4d34-abd9-b1e5b67bb6b0" ],
"groupsToRemove": []
}
'

Responses

Example of a valid response (200 OK) :

{ 
"statusCode": 1010,
"message": "OK"
}

Common Errors

Please refer to the list of common errors.


Check my access to a zone

Description

This special request (HEAD) allows you to check if the authenticated user is part of an access zone, without returning a message body. The answer is contained in the HTTP status code.

HEAD /v2/access-zones/{accessZoneId}/users

Scope

To execute this request, you must have the following scope: metrics:write.

Parameters

  • accessZoneId (uuid, required): ID of the access zone to check.

This request uses a path parameter, which is integrated directly into the URL.

General syntax of the HEAD request: .../access-zones/[access_zone_uuid]/users

Example request

 curl -I \ 
'https://xxx.indaba.api.indasuite.io-base.com/v2/access-zones/0894d6cc-9234-4cba-82ad-c1bacaf71a07/users' \
-H 'Authorization: Bearer VOTRE_JETON_JWT'

Responses

Example of a valid response (200 OK) :

An HTTP/1.1 200 OK status code with no message body indicates that the user is part of the zone.

Common Errors

Please refer to the list of common errors.


Delete an access zone

Description

This request deletes an access zone. Warning: metrics using this authorization may become inaccessible if no other authorization is set.

DELETE /v2/access-zones/{accessZoneId}

Scope

To execute this request, you must have the following scope: metrics:admin.

Parameters

  • accessZoneId (uuid, required): ID of the access zone to delete.

This request uses a path parameter, which is integrated directly into the URL.

General syntax of the DELETE request: .../access-zones/[access_zone_uuid]

Example request

 curl -X DELETE \ 
'https://xxx.indaba.api.indasuite.io-base.com/v2/access-zones/0894d6cc-9234-4cba-82ad-c1bacaf71a07' \
-H 'Authorization: Bearer VOTRE_JETON_JWT'

Responses

Example of a valid response (200 OK):

{ 
"statusCode": 1010,
"message": "OK"
}

Common Errors

Please refer to the list of common errors.


Pagination handling

For performance reasons, when requesting a large number of results (for example, a long list of metrics), the API may divide the response into several "pages". This pagination is managed via the paginationInfo object found in some responses.

  • If isComplete is true: You have received all the data.

  • If isComplete is false: There is more data to retrieve. To get the next page:

    1. Retrieve the value of the paginationKey field from the response you just received.

    2. Make a new request, adding the paginationKey as a parameter with the value you retrieved.

    3. Repeat this process until the final response contains isComplete: true.


Common errors

You will primarily encounter the following HTTP error codes:

  • 400 Bad Request: Your request is malformed. This may be due to a missing parameter, an incorrect data type, or invalid JSON. The response body will contain an errors array detailing the problem.

    { 
    "errors": [
    {
    "error": "Field Required",
    "message": "The xxx field is required."
    }
    ],
    "statusCode": 1050,
    "message": "Invalid request"
    }
  • 403 Forbidden: Your authentication token is valid, but you do not have the necessary rights for this action. This can happen for two reasons:

    • Your token does not have the required scope (e.g., you are trying to write data without the metrics:write scope).

    • Your token has the correct scope, but your user (or service account) is not linked to an authorization that grants access to the requested metric.

  • 404 Not Found: The resource you are trying to reach does not exist. This typically occurs if you are using an incorrect ID or requesting a metric that does not exist.

Did this answer your question?