Put Achievement Rule
curl --request PUT \
--url https://api.member.dev/api/v1/teams/{team_id}/hubs/{hub_id}/achievements/{achievement_id}/rule \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/vnd.api+json' \
--data '
{
"data": {
"type": "<string>",
"attributes": {
"confirm": false,
"notify_on_backfill": false
}
}
}
'import requests
url = "https://api.member.dev/api/v1/teams/{team_id}/hubs/{hub_id}/achievements/{achievement_id}/rule"
payload = { "data": {
"type": "<string>",
"attributes": {
"confirm": False,
"notify_on_backfill": False
}
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/vnd.api+json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/vnd.api+json'},
body: JSON.stringify({
data: {type: '<string>', attributes: {confirm: false, notify_on_backfill: false}}
})
};
fetch('https://api.member.dev/api/v1/teams/{team_id}/hubs/{hub_id}/achievements/{achievement_id}/rule', 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.member.dev/api/v1/teams/{team_id}/hubs/{hub_id}/achievements/{achievement_id}/rule",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'data' => [
'type' => '<string>',
'attributes' => [
'confirm' => false,
'notify_on_backfill' => false
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/vnd.api+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.member.dev/api/v1/teams/{team_id}/hubs/{hub_id}/achievements/{achievement_id}/rule"
payload := strings.NewReader("{\n \"data\": {\n \"type\": \"<string>\",\n \"attributes\": {\n \"confirm\": false,\n \"notify_on_backfill\": false\n }\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/vnd.api+json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.member.dev/api/v1/teams/{team_id}/hubs/{hub_id}/achievements/{achievement_id}/rule")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/vnd.api+json")
.body("{\n \"data\": {\n \"type\": \"<string>\",\n \"attributes\": {\n \"confirm\": false,\n \"notify_on_backfill\": false\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.member.dev/api/v1/teams/{team_id}/hubs/{hub_id}/achievements/{achievement_id}/rule")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/vnd.api+json'
request.body = "{\n \"data\": {\n \"type\": \"<string>\",\n \"attributes\": {\n \"confirm\": false,\n \"notify_on_backfill\": false\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"meta": {
"preview_count": 123,
"preview_count_is_lower_bound": true
}
}{
"data": {
"attributes": {
"achievement_id": "<string>",
"backfill_status": "<string>",
"compiled_definition_version": 123,
"created_at": "2023-11-07T05:31:56Z",
"hub_id": "<string>",
"is_active": true,
"notify_on_backfill": true,
"rule_state": "<string>",
"segment_id": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"broken_reason": "<string>",
"rule_state_reason": "<string>"
},
"id": "<string>",
"type": "<string>",
"links": {
"self": "<string>"
},
"meta": {},
"relationships": {}
},
"included": [
"<unknown>"
],
"links": {
"self": "<string>"
},
"meta": {}
}{
"errors": [
{
"status": "<string>",
"title": "<string>",
"code": "<string>",
"detail": "<string>",
"id": "<string>",
"meta": {},
"source": {}
}
],
"meta": {}
}{
"errors": [
{
"status": "<string>",
"title": "<string>",
"code": "<string>",
"detail": "<string>",
"id": "<string>",
"meta": {},
"source": {}
}
],
"meta": {}
}{
"errors": [
{
"status": "<string>",
"title": "<string>",
"code": "<string>",
"detail": "<string>",
"id": "<string>",
"meta": {},
"source": {}
}
],
"meta": {}
}{
"errors": [
{
"status": "<string>",
"title": "<string>",
"code": "<string>",
"detail": "<string>",
"id": "<string>",
"meta": {},
"source": {}
}
],
"meta": {}
}{
"errors": [
{
"status": "<string>",
"title": "<string>",
"code": "<string>",
"detail": "<string>",
"id": "<string>",
"meta": {},
"source": {}
}
],
"meta": {}
}achievements-admin
Put Achievement Rule
Compile the achievement’s rule pieces into one segment for this hub offering.
confirm=false (default) previews only — nothing is persisted;
meta.preview_count carries the qualifying-members estimate
(meta.preview_count_is_lower_bound=true above the preview page cap).
confirm=true persists: 201 on the initial bind, 200 on a re-PUT
recompile (e.g. clearing a broken/drifted rule).
PUT
/
api
/
v1
/
teams
/
{team_id}
/
hubs
/
{hub_id}
/
achievements
/
{achievement_id}
/
rule
Put Achievement Rule
curl --request PUT \
--url https://api.member.dev/api/v1/teams/{team_id}/hubs/{hub_id}/achievements/{achievement_id}/rule \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/vnd.api+json' \
--data '
{
"data": {
"type": "<string>",
"attributes": {
"confirm": false,
"notify_on_backfill": false
}
}
}
'import requests
url = "https://api.member.dev/api/v1/teams/{team_id}/hubs/{hub_id}/achievements/{achievement_id}/rule"
payload = { "data": {
"type": "<string>",
"attributes": {
"confirm": False,
"notify_on_backfill": False
}
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/vnd.api+json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/vnd.api+json'},
body: JSON.stringify({
data: {type: '<string>', attributes: {confirm: false, notify_on_backfill: false}}
})
};
fetch('https://api.member.dev/api/v1/teams/{team_id}/hubs/{hub_id}/achievements/{achievement_id}/rule', 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.member.dev/api/v1/teams/{team_id}/hubs/{hub_id}/achievements/{achievement_id}/rule",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'data' => [
'type' => '<string>',
'attributes' => [
'confirm' => false,
'notify_on_backfill' => false
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/vnd.api+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.member.dev/api/v1/teams/{team_id}/hubs/{hub_id}/achievements/{achievement_id}/rule"
payload := strings.NewReader("{\n \"data\": {\n \"type\": \"<string>\",\n \"attributes\": {\n \"confirm\": false,\n \"notify_on_backfill\": false\n }\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/vnd.api+json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.member.dev/api/v1/teams/{team_id}/hubs/{hub_id}/achievements/{achievement_id}/rule")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/vnd.api+json")
.body("{\n \"data\": {\n \"type\": \"<string>\",\n \"attributes\": {\n \"confirm\": false,\n \"notify_on_backfill\": false\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.member.dev/api/v1/teams/{team_id}/hubs/{hub_id}/achievements/{achievement_id}/rule")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/vnd.api+json'
request.body = "{\n \"data\": {\n \"type\": \"<string>\",\n \"attributes\": {\n \"confirm\": false,\n \"notify_on_backfill\": false\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"meta": {
"preview_count": 123,
"preview_count_is_lower_bound": true
}
}{
"data": {
"attributes": {
"achievement_id": "<string>",
"backfill_status": "<string>",
"compiled_definition_version": 123,
"created_at": "2023-11-07T05:31:56Z",
"hub_id": "<string>",
"is_active": true,
"notify_on_backfill": true,
"rule_state": "<string>",
"segment_id": "<string>",
"updated_at": "2023-11-07T05:31:56Z",
"broken_reason": "<string>",
"rule_state_reason": "<string>"
},
"id": "<string>",
"type": "<string>",
"links": {
"self": "<string>"
},
"meta": {},
"relationships": {}
},
"included": [
"<unknown>"
],
"links": {
"self": "<string>"
},
"meta": {}
}{
"errors": [
{
"status": "<string>",
"title": "<string>",
"code": "<string>",
"detail": "<string>",
"id": "<string>",
"meta": {},
"source": {}
}
],
"meta": {}
}{
"errors": [
{
"status": "<string>",
"title": "<string>",
"code": "<string>",
"detail": "<string>",
"id": "<string>",
"meta": {},
"source": {}
}
],
"meta": {}
}{
"errors": [
{
"status": "<string>",
"title": "<string>",
"code": "<string>",
"detail": "<string>",
"id": "<string>",
"meta": {},
"source": {}
}
],
"meta": {}
}{
"errors": [
{
"status": "<string>",
"title": "<string>",
"code": "<string>",
"detail": "<string>",
"id": "<string>",
"meta": {},
"source": {}
}
],
"meta": {}
}{
"errors": [
{
"status": "<string>",
"title": "<string>",
"code": "<string>",
"detail": "<string>",
"id": "<string>",
"meta": {},
"source": {}
}
],
"meta": {}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/vnd.api+json
Top-level JSON:API request envelope for PUT .../rule.
JSON:API data envelope for PUT .../rule.
Show child attributes
Show child attributes
Response
Successful Response
- AchievementRulePreviewResponse
- JsonApiResponse[AchievementRuleAttributes]
Top-level response for PUT .../rule?confirm=false — meta only, no data.
Show child attributes
Show child attributes