Publish Discussion
curl --request POST \
--url https://api.member.dev/api/v1/discussions/{discussion_id}/publish \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.member.dev/api/v1/discussions/{discussion_id}/publish"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.member.dev/api/v1/discussions/{discussion_id}/publish', 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/discussions/{discussion_id}/publish",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.member.dev/api/v1/discussions/{discussion_id}/publish"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.member.dev/api/v1/discussions/{discussion_id}/publish")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.member.dev/api/v1/discussions/{discussion_id}/publish")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"attributes": {
"attachments": [
{
"id": "<string>",
"media_id": "<string>",
"role": "<string>",
"asset_kind": "<string>",
"file_id": "<string>",
"filename": "<string>",
"mime_type": "<string>",
"size_bytes": 123,
"status_upload": "<string>",
"thumbnail_url": "<string>",
"thumbnail_url_expires_at": "<string>",
"url": "<string>",
"url_expires_at": "<string>"
}
],
"author_contact_id": "<string>",
"author_display_name": "<string>",
"author_photo_thumbnail_url": "<string>",
"author_photo_thumbnail_url_expires_at": "2023-11-07T05:31:56Z",
"author_photo_url": "<string>",
"author_photo_url_expires_at": "2023-11-07T05:31:56Z",
"body": "<string>",
"comment_count": 123,
"created_at": "<string>",
"deleted_at": "<string>",
"external_video_embeds": [
{}
],
"hub_id": "<string>",
"is_broadcast": true,
"is_locked": true,
"is_pinned": true,
"is_published": true,
"last_activity_at": "<string>",
"poll": {
"closed": true,
"deadline_at": "2023-11-07T05:31:56Z",
"id": "<string>",
"options": [
{
"id": "<string>",
"label": "<string>",
"position": 123,
"vote_count": 123
}
],
"total_votes": 123,
"viewer_option_id": "<string>",
"viewer_voted": true
},
"published_at": "<string>",
"reaction_count": 123,
"reactions": [
"<unknown>"
],
"report_count": 0,
"reported_by_me": false,
"repost": {
"author_display_name": "<string>",
"author_photo_thumbnail_url": "<string>",
"author_photo_url": "<string>",
"body": "<string>",
"id": "<string>",
"published_at": "<string>",
"space_name": "<string>",
"space_slug": "<string>",
"title": "<string>"
},
"repost_count": 123,
"scheduled_at": "<string>",
"space_id": "<string>",
"status": "<string>",
"team_id": "<string>",
"title": "<string>",
"updated_at": "<string>"
},
"id": "<string>",
"type": "<string>",
"links": {
"self": "<string>"
},
"meta": {},
"relationships": {}
},
"included": [
"<unknown>"
],
"links": {
"self": "<string>"
},
"meta": {}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}community-discussions
Publish Discussion
Publish a draft discussion (author only).
Transitions a draft (is_published=False) discussion to published state. Idempotent: re-publishing an already-published discussion returns 200 with no side-effects.
Auth order: active-member gate → ownership → space posting gate → idempotency. A stale draft cannot be published if the author has since lost segment access or the space became admins_only.
Returns 200 with the JSON:API discussion resource on success. Returns 403 when the caller is not the author, is banned, or the space gate blocks posting. Returns 404 when the discussion or space does not exist.
POST
/
api
/
v1
/
discussions
/
{discussion_id}
/
publish
Publish Discussion
curl --request POST \
--url https://api.member.dev/api/v1/discussions/{discussion_id}/publish \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.member.dev/api/v1/discussions/{discussion_id}/publish"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.member.dev/api/v1/discussions/{discussion_id}/publish', 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/discussions/{discussion_id}/publish",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.member.dev/api/v1/discussions/{discussion_id}/publish"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.member.dev/api/v1/discussions/{discussion_id}/publish")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.member.dev/api/v1/discussions/{discussion_id}/publish")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"attributes": {
"attachments": [
{
"id": "<string>",
"media_id": "<string>",
"role": "<string>",
"asset_kind": "<string>",
"file_id": "<string>",
"filename": "<string>",
"mime_type": "<string>",
"size_bytes": 123,
"status_upload": "<string>",
"thumbnail_url": "<string>",
"thumbnail_url_expires_at": "<string>",
"url": "<string>",
"url_expires_at": "<string>"
}
],
"author_contact_id": "<string>",
"author_display_name": "<string>",
"author_photo_thumbnail_url": "<string>",
"author_photo_thumbnail_url_expires_at": "2023-11-07T05:31:56Z",
"author_photo_url": "<string>",
"author_photo_url_expires_at": "2023-11-07T05:31:56Z",
"body": "<string>",
"comment_count": 123,
"created_at": "<string>",
"deleted_at": "<string>",
"external_video_embeds": [
{}
],
"hub_id": "<string>",
"is_broadcast": true,
"is_locked": true,
"is_pinned": true,
"is_published": true,
"last_activity_at": "<string>",
"poll": {
"closed": true,
"deadline_at": "2023-11-07T05:31:56Z",
"id": "<string>",
"options": [
{
"id": "<string>",
"label": "<string>",
"position": 123,
"vote_count": 123
}
],
"total_votes": 123,
"viewer_option_id": "<string>",
"viewer_voted": true
},
"published_at": "<string>",
"reaction_count": 123,
"reactions": [
"<unknown>"
],
"report_count": 0,
"reported_by_me": false,
"repost": {
"author_display_name": "<string>",
"author_photo_thumbnail_url": "<string>",
"author_photo_url": "<string>",
"body": "<string>",
"id": "<string>",
"published_at": "<string>",
"space_name": "<string>",
"space_slug": "<string>",
"title": "<string>"
},
"repost_count": 123,
"scheduled_at": "<string>",
"space_id": "<string>",
"status": "<string>",
"team_id": "<string>",
"title": "<string>",
"updated_at": "<string>"
},
"id": "<string>",
"type": "<string>",
"links": {
"self": "<string>"
},
"meta": {},
"relationships": {}
},
"included": [
"<unknown>"
],
"links": {
"self": "<string>"
},
"meta": {}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"ctx": {},
"input": "<unknown>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Query Parameters
⌘I