Skip to main content
Fetch Rule
Fetches a single rule by ID. No sign-in is required. A rule of a space the viewer (the signed-in user, or the user a service key names in actingUserId) can’t see answers 404 space/not-found, like a space that doesn’t exist. readingPermission doesn’t apply: anyone who can see the space reads its rules, including a non-member of a members-only space.

Path Parameters

string
required
UUID of the space.
string
required
UUID of the rule.

Query Parameters

string
Service key only: the user to read as. The response is exactly what that user’s own access token would get. Leave it out for the anonymous view. A user token always acts as its own user and must not send it, and neither may a request with no credentials (400 space/acting-user-not-allowed).

Response

A single Rule object with all fields.

Error Responses

Returned when spaceId or ruleId isn’t a valid UUID. Checked before sign-in, permissions and the endpoint’s other checks.
The space doesn’t exist, or the viewer can’t see it (see Space visibility).
A user token, or a request with no credentials, sent actingUserId. Only a service key names the user it acts as.
actingUserId is not a user id.
A service key names an actingUserId that isn’t a user in this project.
See also: useFetchRule