Skip to main content
Create Rule
Creates a community rule. Only space admins can create rules. The new rule is appended to the end of the existing rule list.

Path Parameters

string
required
UUID of the space.

Body Parameters

string
required
Short rule title.
string
Optional detailed description.
string
Required with a service key: the user this request acts as. The request has exactly that user’s permissions, so it is refused unless they are an admin of the space, and it is recorded as theirs. A user token always acts as its own user and must not send it (400 space/acting-user-not-allowed).

Response

The created Rule object with all fields including the assigned order value.

Error Responses

Returned when spaceId isn’t a valid UUID. Checked before sign-in, permissions and the endpoint’s other checks.
A service key sent no actingUserId.
actingUserId is not a user id.
A user token sent actingUserId, even naming its own user. Only a service key names the user it acts as; a user token always acts as its own user.
actingUserId was sent in the query string. On this endpoint every field, actingUserId included, goes in the request body.
Returned when a service key names an actingUserId that isn’t a user in this project.
The caller (or the user named by actingUserId) is not an admin of the space.
See also: useCreateRule