# Role info by scope URL

Returns the authenticated user's party roles based on the scope URL that was granted during authorisation.
The `scopeUrl` parameter specifies the target scope to query. This can be at the business or fund level:
- **Business level:** `b/{businessCode}/` — returns roles for the specified business.
- **Fund level:** `f/{businessCode}/{fundCode}/` — returns roles for the specified fund within a business.

The optional `alt` parameter can be set to `includewriteaccess` to include a `ScopeWriteAccess` entry in the `PartyRoles` array if the user has write permissions on the specified scope.
**Party roles** represent the user's relationship to the business or fund (e.g. `ADVISOR`, `ADMIN`, `TRUSTINDIVIDUAL`, `TRUSTCORPORATE`, `MEMBER`).
An empty `PartyRoles` array indicates that the authenticated user is not set up as a related party on the specified business or fund.

Endpoint: GET /u/connect/roleinfobyscopeurl
Version: 1.0
Security: Class_oAuth

## Security:

  - `Class_oAuth` (unknown)
    oauth2

## Query parameters:

  - `scopeUrl` (string, required)
    The target scope URL to query. Use the format `b/{businessCode}/` for business-level roles or `f/{businessCode}/{fundCode}/` for fund-level roles.

  - `alt` (string)
    Optional modifier to include additional role information. Set to `includewriteaccess` to include a `ScopeWriteAccess` entry in the `PartyRoles` array if the user has write permissions.

## Response 200:

  - `200` (unknown)
    Success (Ok)

## Response 200 fields (application/json):

  - `Errors` (array)
    A list of errors returned by the API. An empty array indicates a successful response.

  - `Errors.Code` (string)
    A machine-readable error code identifying the type of error.
    Example: API_PARAMETER_REQUIRED

  - `Errors.Message` (string)
    A human-readable description of the error.
    Example: Parameter 'scopeUrl' is required

## Response 400:

  - `400` (unknown)
    Error Message

## Response 400 fields (application/json):

  - `Errors` (array)
    A list of validation or request errors.

  - `Errors.Code` (string)
    A machine-readable error code.
    Example: API_PARAMETER_REQUIRED

  - `Errors.Message` (string)
    A human-readable description of the error.
    Example: Parameter 'scopeUrl' is required

## Response 401:

  - `401` (unknown)
    Unauthorized

## Response 401 fields (application/json):

  - `Errors` (array)
    A list of authorization errors.

  - `Errors.Code` (string)
    A machine-readable error code.
    Example: UNAUTHORIZED

  - `Errors.Message` (string)
    A human-readable description of the error.
    Example: The access token is missing, expired, or invalid.

## Response 403:

  - `403` (unknown)
    Forbidden

## Response 403 fields (application/json):

  - `Errors` (array)
    A list of forbidden access errors.

  - `Errors.Code` (string)
    A machine-readable error code.
    Example: FORBIDDEN

  - `Errors.Message` (string)
    A human-readable description of the error.
    Example: The authenticated user does not have access to this resource.

## Response 404:

  - `404` (unknown)
    Resource not available or user does not have access to the specified fund or scope.

## Response 404 fields (application/json):

  - `Errors` (array)
    A list of resource not found errors.

  - `Errors.Code` (string)
    A machine-readable error code.
    Example: RESOURCE_NOT_FOUND

  - `Errors.Message` (string)
    A human-readable description of the error.
    Example: The requested resource was not found or is not accessible.

## Response 500:

  - `500` (unknown)
    Internal Server Error

## Response 500 fields (application/json):

  - `Errors` (array)
    A list of internal server errors.

  - `Errors.Code` (string)
    A machine-readable error code.
    Example: INTERNAL_ERROR

  - `Errors.Message` (string)
    A human-readable description of the error.
    Example: An unexpected error occurred. Please try again later.

## Response default:

  - `default` (unknown)
    Unexpected error

## Response default fields (application/json):

  - `Errors` (array)
    A list of unexpected errors.

  - `Errors.Code` (string)
    A machine-readable error code.
    Example: INTERNAL_ERROR

  - `Errors.Message` (string)
    A human-readable description of the error.
    Example: An unexpected error occurred. Please try again later.

## Response 200 examples:

  - `Business-level role info` (unknown)
    Returns the user's roles scoped to a business.

  - `Fund-level role info with write access` (unknown)
    Returns the user's roles scoped to a specific fund, including write access indicator.

