Skip to main content

Roles

The roles a grant can give: the standard roles and the workspace's own, each with its privileges.

Contains: Grants

Role object​

A role is a named set of privileges a grant gives. Standard roles come with SparkLogs; a workspace can define its own.

idstring

The role's id.

kindone of the values below

Who defines the role.

  • standard A role SparkLogs defines.
  • custom A role this workspace defines.
descriptionstring or null

What the role is for.

recommended_scopeone of the values below, or null

The scope a grant of this role is usually given; null when there is none.

  • all Every organization.
  • selected Some organizations.
  • workspace The workspace itself.
sort_orderinteger

Where the role sorts in a list of roles.

privilegesarray of RolePrivilege

Every privilege the role holds.

List roles​

GET/workspaces/{workspace_id}/roles
Preview

Returns every role a grant in the workspace can name, the standard roles and the workspace's own, each with its privileges, in sort order.

curl -X GET \  "https://engine.sparklogs.app/app-api/workspaces/5e1f0a00-0000-4000-8000-000000000001/roles" \  -H "Authorization: Bearer $SPARKLOGS_TOKEN"

Access

Works with
Signed-in person, Personal token, OAuth token, Workspace token
Scope
workspace:read
Privilege
workspace.read

Needs workspace.read. Any grant in the workspace carries workspace.read.

Behavior

Retry
Safe to send again

Path parameters

workspace_iduuidrequired

The workspace's id.

Query parameters

fieldsarray of string

Comma-separated top-level fields of each object to return instead of the default set.

Sent by default: idkinddescriptionrecommended_scopesort_orderprivileges

Response 200

rolesarray of Rolerequired

Every one of the roles you can see.

messagestringrequired

What the call did, as a short phrase for a person to read. Its wording may change: act on the HTTP status.

Errors

StatusCodeWhenSend again?
400APP_API_ERR_BAD_PARAMETERSA query parameter it does not take, one given twice, or fields naming a field it does not have.No
403APP_API_ERR_NO_PRIVILEGEtoken_scopeno_privilegeYou do not hold workspace.read. The same refusal comes when the path names a workspace other than the token's own.No

Plus the errors every call can return.