AddRelationships

Adds or updates multiple relationships as a single atomic update.

Parameters

  • relationships - List of relationships to add or update.

Returns

  • A task representing the asynchronous operation, with a ZedToken? indicating the version of the data after the operation.

Example Code

var client = new SpiceDbClient("your_token", "your_schema_prefix");
var relationships = new List<Relationship>
{
    new Relationship("document:firstdoc", "reader", "user:alice")
};

// Add or update multiple relationships as a single atomic operation.
var resultToken = await client.AddRelationshipsAsync(relationships);
Console.WriteLine($"Relationships added at token: {resultToken?.Token}");