Skip to main content

Using scopes

info

The code examples in this article is only documented with the Python API Client. While many concepts still apply for the JavaScript API, implementation details might differ.

Entities can be queried based on their scopes:

tasks = session.query(
'Task where scopes.name is "London"'
)

Scopes can be read and modified for entities:

scope = session.query(
'Scope where name is "London"'
)[0]

if scope in task['scopes']:
task['scopes'].remove(scope)
else:
task['scopes'].append(scope)