Skip to main content
You always own your facts and can export them at any time using the Get API.

Export with the CLI

# Export all `has_role` facts
$ oso-cloud get has_role _ _ _
Retrieving has_role(_, _, _) from Oso at https://cloud.osohq.com/
has_role(User:Alice, String:admin, Repository:Anvils)
...

# Export all `has_relation` facts
$ oso-cloud get has_relation _ _ _
Retrieving has_relation(_, _, _) from Oso at https://cloud.osohq.com/
has_relation(Repository:Anvils, String:organization, Organization:ACME)
...
Each _ is a wildcard for a fact argument. The examples above return all facts of the given type. You can also filter by replacing wildcards with specific values:
# Export only Alice's roles
$ ooso-cloud get has_role User:Alice _ _
...

Export with SDKs

You can call the Get API directly from any Oso Cloud SDK. Each SDK provides a get (or Get) method:
  • Wildcards: None (Python), null (Node.js), nil (Go).
  • Developer accounts: max 1000 facts per call (larger exports error).
  • Only returns facts you’ve explicitly added.
    • Use Check API (list) to find authorized resources.
    • Use Query Builder for derived queries.
Below are examples in Python, Node.js, and Go.

Python

# List all role-related facts on the `anvils` repo
oso.get(("has_role", None, None, anvils))

Node.js

// List all role-related facts on the `anvils` repo
await oso.get(["has_role", null, null, { type: "Repository", id: "anvils" }]);

Go

// List all role-related facts on the `anvils` repo
facts, _ = osoClient.Get(
  oso.NewFactPattern("has_role", nil, nil, oso.NewValue("Repository", "anvils")),
)