List roles

Retrieve a paginated list of roles defined within a specific organization. This endpoint provides access to role information including permissions, member assignments, and role hierarchy. Roles can be filtered and sorted by various criteria.

GET

Parameters

Path Parameters

OrganizationId
REQUIRED
Unique identifier of the organization

Query Parameters

Id
Filter resources by their unique identifier
Name
Filter resources by their name or title
Autocomplete
Search term for autocomplete functionality
Limit
How many items to return at one time (max 100)
Next
Pagination token for retrieving the next page of results
Order
Sort order for the results (ascending or descending)
SortBy
Field name to sort the results by
Status codeDescription
200list of roles
400Bad request error - the request contains invalid parameters or malformed data
500Internal server error - an unexpected error occurred on the server
cURL
curl -L \
"https://blockv-labs.io/organizations/{organizationId}/roles?id={id}&name={name}&autocomplete={autocomplete}&limit={limit}&next={next}&order={order}&sortBy={sortBy}" \
-H 'Accept: application/json'
Response
{
"next": "string",
"roles": [
{
"id": "string",
"name": "string",
"description": "string",
"permissions": [
{
"resource": "api-keys",
"crud": {
"read": false,
"create": false,
"update": false,
"delete": false
}
}
],
"when_created": "2024-01-01T00:00:00Z",
"when_modified": "2024-01-01T00:00:00Z"
}
]
}
json
{
"type": "object",
"required": [
"roles"
],
"properties": {
"next": {
"type": "string",
"description": "Pagination token for retrieving the next set of roles",
"x-go-type-skip-optional-pointer": true
},
"roles": {
"type": "array",
"description": "List of role entities returned in the response",
"items": {
"type": "object",
"required": [
"id",
"name",
"permissions",
"when_created",
"when_modified"
],
"properties": {
"id": {
"type": "string",
"description": "Unique identifier for the role",
"x-oapi-codegen-extra-tags": {
"json": "id,omitempty",
"bson": "_id,omitempty"
},
"x-go-type": "id.ID",
"x-go-type-import": {
"path": "github.com/vlabsio/smarttoken/pkg/types/id"
}
},
"name": {
"type": "string",
"description": "Human-readable name of the role",
"x-oapi-codegen-extra-tags": {
"bson": "name,omitempty"
}
},
"description": {
"type": "string",
"description": "Optional detailed description of the role's purpose and scope",
"x-oapi-codegen-extra-tags": {
"bson": "description,omitempty"
},
"x-go-type-skip-optional-pointer": true
},
"permissions": {
"type": "array",
"description": "List of permissions assigned to this role",
"x-oapi-codegen-extra-tags": {
"bson": "permissions,omitempty"
},
"items": {
"type": "object",
"required": [
"resource",
"crud"
],
"properties": {
"resource": {
"type": "string",
"x-oapi-codegen-extra-tags": {
"bson": "resource,omitempty"
},
"enum": [
"api-keys",
"ebus.actions",
"ebus.action-logs",
"faces",
"faces.pages",
"faces.assistant",
"indexer",
"notifications.templates",
"notifications.messages",
"objects",
"objects.state-changes",
"organizations",
"organizations.members",
"organizations.roles",
"sequencer.batches",
"stats.wallets",
"stats.objects",
"stats.actions",
"storage",
"templates",
"wallets",
"webhooks"
]
},
"crud": {
"type": "object",
"x-oapi-codegen-extra-tags": {
"bson": "crud,omitempty"
},
"required": [
"read",
"create",
"update",
"delete"
],
"properties": {
"read": {
"type": "boolean",
"x-oapi-codegen-extra-tags": {
"bson": "read,omitempty"
}
},
"create": {
"type": "boolean",
"x-oapi-codegen-extra-tags": {
"bson": "create,omitempty"
}
},
"update": {
"type": "boolean",
"x-oapi-codegen-extra-tags": {
"bson": "update,omitempty"
}
},
"delete": {
"type": "boolean",
"x-oapi-codegen-extra-tags": {
"bson": "delete,omitempty"
}
}
}
}
}
}
},
"when_created": {
"type": "string",
"description": "Timestamp when the role was created",
"x-oapi-codegen-extra-tags": {
"bson": "when_created,omitempty"
},
"format": "date-time"
},
"when_modified": {
"type": "string",
"description": "Timestamp when the role was last modified",
"x-oapi-codegen-extra-tags": {
"bson": "when_modified,omitempty"
},
"format": "date-time"
}
}
}
}
}
}