API Reference: Read Namespace Configuration

A read namespace configuration request is used to read the current configuration for a namespace in an Authzed Tenant.

gRPC Endpoint#

NamespaceService.ReadConfig

Request#

Parameters#

note

It is recommended to specify the at_revision Zookie value, which will return the namespace's configuration as of the logical timestamp represented by that Zookie.

NameTypeRequired
namespacestringYes
at_revisionZookieNo (but recommended)

Request Definition#

message ReadConfigRequest {
string namespace = 1;
Zookie at_revision = 2;
}

Request Example#

{
namespace: "mynotetakingapp/note"
at_revision: { token: "CAESAggB" }
}

Response#

Response Definition#

message ReadConfigResponse {
string namespace = 1;
NamespaceDefinition config = 2;
Zookie revision = 4;
}

Response Example#

{
namespace: "mynotetakingapp/note"
revision: { token: "GeFSffcB" }
config: {
name: "mynotetakingapp/note"
relation: [
{
name: "viewer"
}
... // Elided for brevity
]
}
}

Errors#

  • INVALID_ARGUMENT: a provided value has failed to semantically validate
  • NOT_FOUND: the namespace being requested does not exist
  • OUT_OF_RANGE: the specified zookie is too old to be used

For more generic failures, see the gRPC Status Code documentation.

Code Samples#

Code Sample Parameter Values
Parameter NameValueDescription
Tenant SlugThe slug for your tenant
TokenYour token
NamespaceThe namespace to be read
ZookieThe opaque token that signifies a read should be as fresh as the write that produced this token.
grpcurl -rpc-header "authorization: Bearer t_my_token" -d \
'{
"namespace": "someslug/resource",
"at_revision": { "token": "someopaquevalue" }
}' \
grpc.authzed.com:443 NamespaceService.ReadConfig