Skip to main content

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

HeaderTypeRequiredDescription
tenant_idstringYesTenant ID

Response

Success (200):

["read", "write", "admin"]

Error Responses:

  • 400 - Bad Request
  • 500 - Internal Server Error

Add Scope (Admin)

Add a new scope with associated resources to the main database.

Endpoint: POST /uflow/admin/scopes

Headers

HeaderTypeRequiredDescription
tenant_idstringYesTenant ID

Request Body

{
"scope_name": "string",
"resources": ["string"]
}

Parameters

ParameterTypeRequiredDescription
scope_namestringYesName of the scope
resourcesarray[string]NoResources to associate. Empty means full scope (*)

Response

Success (201):

{
"message": "string"
}

Error Responses:

  • 400 - Bad Request
  • 500 - 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

HeaderTypeRequiredDescription
tenant_idstringYesTenant ID

Response

Success (200):

[
{
"scope_name": "string",
"resources": ["string"]
}
]

Error Responses:

  • 400 - Bad Request
  • 500 - 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

HeaderTypeRequiredDescription
tenant_idstringYesTenant ID

Path Parameters

ParameterTypeRequiredDescription
scope_namestringYesScope name

Request Body

{
"resources": ["string"]
}

Response

Success (200):

{
"message": "string"
}

Error Responses:

  • 400 - Bad Request
  • 404 - Scope not found
  • 500 - 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

HeaderTypeRequiredDescription
tenant_idstringYesTenant ID

Path Parameters

ParameterTypeRequiredDescription
scope_namestringYesScope name

Response

Success (200):

{
"message": "string"
}

Error Responses:

  • 400 - Bad Request
  • 404 - Scope not found
  • 500 - 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

HeaderTypeRequiredDescription
tenant_idstringYesTenant ID

Response

Success (200):

["read", "write", "admin"]

Error Responses:

  • 400 - Bad Request
  • 500 - Internal Server Error

Add Scope (End User)

Add a new scope with associated resources to the tenant database.

Endpoint: POST /uflow/user/scopes

Headers

HeaderTypeRequiredDescription
tenant_idstringYesTenant ID

Request Body

{
"scope_name": "string",
"resources": ["string"]
}

Response

Success (201):

{
"message": "string"
}

Error Responses:

  • 400 - Bad Request
  • 500 - 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

HeaderTypeRequiredDescription
tenant_idstringYesTenant ID

Response

Success (200):

[
{
"scope_name": "string",
"resources": ["string"]
}
]

Error Responses:

  • 400 - Bad Request
  • 500 - 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

HeaderTypeRequiredDescription
tenant_idstringYesTenant ID

Path Parameters

ParameterTypeRequiredDescription
scope_namestringYesScope name

Request Body

{
"resources": ["string"]
}

Response

Success (200):

{
"message": "string"
}

Error Responses:

  • 400 - Bad Request
  • 404 - Scope not found
  • 500 - 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

HeaderTypeRequiredDescription
tenant_idstringYesTenant ID

Path Parameters

ParameterTypeRequiredDescription
scope_namestringYesScope name

Response

Success (200):

{
"message": "string"
}

Error Responses:

  • 400 - Bad Request
  • 404 - Scope not found
  • 500 - Internal Server Error