curl --request POST \
--url https://api.1club.ai/v1/platform/document-rules \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"documentIds": [
123
],
"isActive": true,
"mandatoryToAccept": true,
"requiresTypedNameAcceptance": true,
"requiredForEntry": true,
"filters": {
"contactTypes": [],
"planIds": [
123
],
"tags": [
123
],
"householdRoles": []
}
}
'import requests
url = "https://api.1club.ai/v1/platform/document-rules"
payload = {
"name": "<string>",
"documentIds": [123],
"isActive": True,
"mandatoryToAccept": True,
"requiresTypedNameAcceptance": True,
"requiredForEntry": True,
"filters": {
"contactTypes": [],
"planIds": [123],
"tags": [123],
"householdRoles": []
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
documentIds: [123],
isActive: true,
mandatoryToAccept: true,
requiresTypedNameAcceptance: true,
requiredForEntry: true,
filters: {contactTypes: [], planIds: [123], tags: [123], householdRoles: []}
})
};
fetch('https://api.1club.ai/v1/platform/document-rules', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.1club.ai/v1/platform/document-rules",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'documentIds' => [
123
],
'isActive' => true,
'mandatoryToAccept' => true,
'requiresTypedNameAcceptance' => true,
'requiredForEntry' => true,
'filters' => [
'contactTypes' => [
],
'planIds' => [
123
],
'tags' => [
123
],
'householdRoles' => [
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.1club.ai/v1/platform/document-rules"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"documentIds\": [\n 123\n ],\n \"isActive\": true,\n \"mandatoryToAccept\": true,\n \"requiresTypedNameAcceptance\": true,\n \"requiredForEntry\": true,\n \"filters\": {\n \"contactTypes\": [],\n \"planIds\": [\n 123\n ],\n \"tags\": [\n 123\n ],\n \"householdRoles\": []\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.1club.ai/v1/platform/document-rules")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"documentIds\": [\n 123\n ],\n \"isActive\": true,\n \"mandatoryToAccept\": true,\n \"requiresTypedNameAcceptance\": true,\n \"requiredForEntry\": true,\n \"filters\": {\n \"contactTypes\": [],\n \"planIds\": [\n 123\n ],\n \"tags\": [\n 123\n ],\n \"householdRoles\": []\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.1club.ai/v1/platform/document-rules")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"documentIds\": [\n 123\n ],\n \"isActive\": true,\n \"mandatoryToAccept\": true,\n \"requiresTypedNameAcceptance\": true,\n \"requiredForEntry\": true,\n \"filters\": {\n \"contactTypes\": [],\n \"planIds\": [\n 123\n ],\n \"tags\": [\n 123\n ],\n \"householdRoles\": []\n }\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"name": "<string>",
"description": "<string>",
"isActive": true,
"mandatoryToAccept": true,
"requiresTypedNameAcceptance": true,
"requiredForEntry": true,
"consentChannel": "marketing_email",
"filters": {
"contactTypes": [
"<string>"
],
"planIds": [
123
],
"tags": [
123
],
"householdRoles": [
"<string>"
]
},
"documentIds": [
123
],
"documents": [
{
"id": 123,
"title": "<string>",
"slug": "<string>",
"status": "<string>"
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}Create a document rule
Makes one or more documents something the matching members are asked to accept. Every document must be one of the organization’s content items of type document; only a published one is ever asked of anybody. Every filters.planIds entry and every numeric filters.tags entry must be one of the organization’s plans and tags.
mandatoryToAccept defaults to true. requiresTypedNameAcceptance and requiredForEntry exist only on a mandatory rule, and consentChannel only on an optional one: asking for either on the wrong kind of rule is a 400 with code DOCUMENT_RULE_FLAGS_CONFLICT, rather than a rule saved without what you asked for.
A rule that is active, mandatory and required for entry starts refusing self check-in (tablet, member QR, portal, door access) to every matching member who has not signed, as soon as it is saved. Supports the Idempotency-Key header.
curl --request POST \
--url https://api.1club.ai/v1/platform/document-rules \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"documentIds": [
123
],
"isActive": true,
"mandatoryToAccept": true,
"requiresTypedNameAcceptance": true,
"requiredForEntry": true,
"filters": {
"contactTypes": [],
"planIds": [
123
],
"tags": [
123
],
"householdRoles": []
}
}
'import requests
url = "https://api.1club.ai/v1/platform/document-rules"
payload = {
"name": "<string>",
"documentIds": [123],
"isActive": True,
"mandatoryToAccept": True,
"requiresTypedNameAcceptance": True,
"requiredForEntry": True,
"filters": {
"contactTypes": [],
"planIds": [123],
"tags": [123],
"householdRoles": []
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
documentIds: [123],
isActive: true,
mandatoryToAccept: true,
requiresTypedNameAcceptance: true,
requiredForEntry: true,
filters: {contactTypes: [], planIds: [123], tags: [123], householdRoles: []}
})
};
fetch('https://api.1club.ai/v1/platform/document-rules', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.1club.ai/v1/platform/document-rules",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'documentIds' => [
123
],
'isActive' => true,
'mandatoryToAccept' => true,
'requiresTypedNameAcceptance' => true,
'requiredForEntry' => true,
'filters' => [
'contactTypes' => [
],
'planIds' => [
123
],
'tags' => [
123
],
'householdRoles' => [
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.1club.ai/v1/platform/document-rules"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"documentIds\": [\n 123\n ],\n \"isActive\": true,\n \"mandatoryToAccept\": true,\n \"requiresTypedNameAcceptance\": true,\n \"requiredForEntry\": true,\n \"filters\": {\n \"contactTypes\": [],\n \"planIds\": [\n 123\n ],\n \"tags\": [\n 123\n ],\n \"householdRoles\": []\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.1club.ai/v1/platform/document-rules")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"documentIds\": [\n 123\n ],\n \"isActive\": true,\n \"mandatoryToAccept\": true,\n \"requiresTypedNameAcceptance\": true,\n \"requiredForEntry\": true,\n \"filters\": {\n \"contactTypes\": [],\n \"planIds\": [\n 123\n ],\n \"tags\": [\n 123\n ],\n \"householdRoles\": []\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.1club.ai/v1/platform/document-rules")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"documentIds\": [\n 123\n ],\n \"isActive\": true,\n \"mandatoryToAccept\": true,\n \"requiresTypedNameAcceptance\": true,\n \"requiredForEntry\": true,\n \"filters\": {\n \"contactTypes\": [],\n \"planIds\": [\n 123\n ],\n \"tags\": [\n 123\n ],\n \"householdRoles\": []\n }\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"name": "<string>",
"description": "<string>",
"isActive": true,
"mandatoryToAccept": true,
"requiresTypedNameAcceptance": true,
"requiredForEntry": true,
"consentChannel": "marketing_email",
"filters": {
"contactTypes": [
"<string>"
],
"planIds": [
123
],
"tags": [
123
],
"householdRoles": [
"<string>"
]
},
"documentIds": [
123
],
"documents": [
{
"id": 123,
"title": "<string>",
"slug": "<string>",
"status": "<string>"
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"code": "<string>",
"details": {}
}Authorizations
Organization-scoped bearer credential: a customer API key (1club_sk_live_...) or an MCP OAuth access token.
Headers
Retry-safe key; a repeat of the same request replays the first response
255Body
Fields accepted when creating a document rule. Unknown fields are refused.
Internal name, shown to staff in the admin portal.
1 - 255The documents the rule requires: content ids of type document in this organization. Duplicates are ignored. Replaces the whole set when sent on an update.
1 - 50 elementsA switched-off rule asks nobody. Defaults to true on create.
true: members must accept before they can finish setting up their account. false: optional - members may decline. Defaults to true on create.
Members must scroll to the end and type their full name, instead of ticking a box. Mandatory rules only.
A matching member who has not signed cannot check themselves in (tablet, member QR, portal, door access) until they do. Staff check-in is never refused. Mandatory rules only.
Optional rules only: each member's answer is also written to this channel's marketing consent. null records nothing.
marketing_email, marketing_sms, whatsapp, null Who the rule asks. Every axis means everyone when empty or left out. Sent as one object that replaces the stored filters wholesale: an axis left out is cleared. Plan and tag ids must be the organization's (an id already on the rule is kept even if it no longer exists).
Show child attributes
Show child attributes
Response
Document rule created
A document rule: which members are asked to read and accept which documents, and how.
true: members must accept to finish setting up their account. false: optional, they may decline.
Members type their full name to accept. Only ever true on a mandatory rule.
An unsigned matching member cannot check themselves in. Only ever true on a mandatory rule.
The marketing channel each answer is written to. Only ever set on an optional rule.
marketing_email, marketing_sms, whatsapp, null Who the rule asks. Every axis means everyone when empty; a member must match every axis the rule sets.
Show child attributes
Show child attributes
The documents the rule requires, ascending.
Show child attributes
Show child attributes
Was this page helpful?