Scopes
Manage scope-to-resource mappings for fine-grained access control. Scopes define named access levels that map to sets of resources.
Admin Endpoints
List Scopes (Admin)
Returns a list of all unique scope names from the main database.
Endpoint: GET /uflow/admin/scopes
Headers
| Header | Type | Required | Description |
|---|---|---|---|
tenant_id | string | Yes | Tenant ID |
Response
Success (200):
["read", "write", "admin"]
Error Responses:
400- Bad Request500- Internal Server Error
Add Scope (Admin)
Add a new scope with associated resources to the main database.
Endpoint: POST /uflow/admin/scopes
Headers
| Header | Type | Required | Description |
|---|---|---|---|
tenant_id | string | Yes | Tenant ID |
Request Body
{
"scope_name": "string",
"resources": ["string"]
}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
scope_name | string | Yes | Name of the scope |
resources | array[string] | No | Resources to associate. Empty means full scope (*) |
Response
Success (201):
{
"message": "string"
}
Error Responses:
400- Bad Request500- Internal Server Error
Get Scope Mappings (Admin)
Returns a list of scopes and their associated resources from the main database.
Endpoint: GET /uflow/admin/scopes/mappings
Headers
| Header | Type | Required | Description |
|---|---|---|---|
tenant_id | string | Yes | Tenant ID |
Response
Success (200):
[
{
"scope_name": "string",
"resources": ["string"]
}
]
Error Responses:
400- Bad Request500- Internal Server Error
Edit Scope (Admin)
Update the resources associated with a scope in the main database.
Endpoint: PUT /uflow/admin/scopes/{scope_name}
Headers
| Header | Type | Required | Description |
|---|---|---|---|
tenant_id | string | Yes | Tenant ID |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
scope_name | string | Yes | Scope name |
Request Body
{
"resources": ["string"]
}
Response
Success (200):
{
"message": "string"
}
Error Responses:
400- Bad Request404- Scope not found500- Internal Server Error
Delete Scope (Admin)
Delete a scope and all its resource mappings from the main database.
Endpoint: DELETE /uflow/admin/scopes/{scope_name}
Headers
| Header | Type | Required | Description |
|---|---|---|---|
tenant_id | string | Yes | Tenant ID |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
scope_name | string | Yes | Scope name |
Response
Success (200):
{
"message": "string"
}
Error Responses:
400- Bad Request404- Scope not found500- Internal Server Error
End-User Endpoints
List Scopes (End User)
Returns a list of all unique scope names from the tenant database.
Endpoint: GET /uflow/user/scopes
Headers
| Header | Type | Required | Description |
|---|---|---|---|
tenant_id | string | Yes | Tenant ID |
Response
Success (200):
["read", "write", "admin"]
Error Responses:
400- Bad Request500- Internal Server Error
Add Scope (End User)
Add a new scope with associated resources to the tenant database.
Endpoint: POST /uflow/user/scopes
Headers
| Header | Type | Required | Description |
|---|---|---|---|
tenant_id | string | Yes | Tenant ID |
Request Body
{
"scope_name": "string",
"resources": ["string"]
}
Response
Success (201):
{
"message": "string"
}
Error Responses:
400- Bad Request500- Internal Server Error
Get Scope Mappings (End User)
Returns a list of scopes and their associated resources from the tenant database.
Endpoint: GET /uflow/user/scopes/mappings
Headers
| Header | Type | Required | Description |
|---|---|---|---|
tenant_id | string | Yes | Tenant ID |
Response
Success (200):
[
{
"scope_name": "string",
"resources": ["string"]
}
]
Error Responses:
400- Bad Request500- Internal Server Error
Edit Scope (End User)
Update the resources associated with a scope in the tenant database.
Endpoint: PUT /uflow/user/scopes/{scope_name}
Headers
| Header | Type | Required | Description |
|---|---|---|---|
tenant_id | string | Yes | Tenant ID |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
scope_name | string | Yes | Scope name |
Request Body
{
"resources": ["string"]
}
Response
Success (200):
{
"message": "string"
}
Error Responses:
400- Bad Request404- Scope not found500- Internal Server Error
Delete Scope (End User)
Delete a scope and all its resource mappings from the tenant database.
Endpoint: DELETE /uflow/user/scopes/{scope_name}
Headers
| Header | Type | Required | Description |
|---|---|---|---|
tenant_id | string | Yes | Tenant ID |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
scope_name | string | Yes | Scope name |
Response
Success (200):
{
"message": "string"
}
Error Responses:
400- Bad Request404- Scope not found500- Internal Server Error