Skip to main content
DELETE
/
facts
cURL
curl --request DELETE \
  --url https://api.osohq.com/api/facts \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "predicate": "<string>",
  "args": [
    {
      "type": "<string>",
      "id": "<string>"
    }
  ]
}
'
import os
from oso_cloud import Oso, Value

oso = Oso(api_key=os.environ.get('OSO_CLOUD_API_KEY', None))

# Delete specific fact
user = Value("User", "alice")
repo = Value("Repository", "anvils")
oso.delete(("has_role", user, "maintainer", repo))

# Delete using patterns
oso.delete(("has_role", user, None, None)) # All roles for user
import { Oso } from 'oso-cloud';

const apiKey = process.env.OSO_CLOUD_API_KEY;
const oso = new Oso("https://cloud.osohq.com", apiKey);

// Delete specific fact
await oso.delete([
"has_role",
{ type: "User", id: "alice" },
"maintainer",
{ type: "Repository", id: "anvils" }
]);

// Delete using patterns (null = wildcard)
await oso.delete(["has_role", { type: "User", id: "alice" }, null, null]); // All roles for alice
package main

import (
"log"
"os"
oso "github.com/osohq/go-oso-cloud/v2"
)

func main() {
apiKey := os.Getenv("OSO_CLOUD_API_KEY")
osoClient := oso.NewClient("https://cloud.osohq.com", apiKey)

// Delete specific fact
user := oso.NewValue("User", "alice")
repo := oso.NewValue("Repository", "anvils")
err := osoClient.Delete(oso.NewFact("has_role", user, oso.String("maintainer"), repo))

// Delete using patterns
err = osoClient.Delete(oso.NewFactPattern(
"has_role",
user,
nil, // Any role
oso.NewValueOfType("Repository") // Any repo
))
}
package com.mycompany;

import java.io.IOException;
import com.osohq.oso_cloud.Oso;
import com.osohq.oso_cloud.api.ApiException;
import com.osohq.oso_cloud.api.Value;

public class App {
public static void main(String[] args) {
String apiKey = System.getenv("OSO_CLOUD_API_KEY");
Oso oso = new Oso(apiKey);

try {
// Delete specific fact
Value user = new Value("User", "alice");
Value repo = new Value("Repository", "anvils");
oso.delete("has_role", user, "maintainer", repo);

// Delete using patterns (null = wildcard)
oso.delete("has_role", user, null, null); // All roles for user
} catch (IOException | ApiException e) {
System.err.println("Error: " + e.getMessage());
}
}
}
require 'oso-cloud'

api_key = ENV.fetch('OSO_CLOUD_API_KEY', nil)
oso = OsoCloud::Oso.new(url: "https://cloud.osohq.com", api_key: api_key)

# Delete specific fact
user = OsoCloud::Value.new(type: "User", id: "alice")
repo = OsoCloud::Value.new(type: "Repository", id: "anvils")
oso.delete("has_role", user, "maintainer", repo)

# Delete using patterns (nil = wildcard)
oso.delete("has_role", user, nil, nil) # All roles for user
using OsoCloud;

string? apiKey = Environment.GetEnvironmentVariable("OSO_CLOUD_API_KEY");
var oso = new Oso("https://api.osohq.com", apiKey);

// Delete specific fact
var user = new Value("User", "alice");
var repo = new Value("Repository", "anvils");
await oso.Delete("has_role", user, "maintainer", repo);

// Delete using patterns (null = wildcard)
await oso.Delete("has_role", user, null, null); // All roles for user
{
  "message": "<string>"
}
{
"message": "<string>"
}

Authorizations

Authorization
string
header
required

Requires an API key to access.

Body

application/json

A pattern object for matching authorization-relevant data, ie: facts.

predicate
string
required
args
object[]
required

Response

message
string
required