Admin create FAQ
curl --request POST \
--url https://api.example.com/api/v1/admin/faqsimport requests
url = "https://api.example.com/api/v1/admin/faqs"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/api/v1/admin/faqs', 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.example.com/api/v1/admin/faqs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$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.example.com/api/v1/admin/faqs"
req, _ := http.NewRequest("POST", url, nil)
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.example.com/api/v1/admin/faqs")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/admin/faqs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyFAQs
Admin create FAQ
Add a FAQ entry shown on the mobile app FAQ screen.
POST
/
api
/
v1
/
admin
/
faqs
Admin create FAQ
curl --request POST \
--url https://api.example.com/api/v1/admin/faqsimport requests
url = "https://api.example.com/api/v1/admin/faqs"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/api/v1/admin/faqs', 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.example.com/api/v1/admin/faqs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$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.example.com/api/v1/admin/faqs"
req, _ := http.NewRequest("POST", url, nil)
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.example.com/api/v1/admin/faqs")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/admin/faqs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyOverview
Creates a FAQ entry. SetisPublished: true to make it immediately visible on the public GET /faqs endpoint, or false to keep it as a draft.
Authentication
Bearer <accessToken> with scope: 'admin' required (requireAdmin).
Role-gated to SUPER and MODERATOR. FINANCE is read-only on the FAQs surface.
Request body
| Field | Type | Required | Constraints | Example |
|---|---|---|---|---|
question | string | yes | 1..300 chars, trimmed. | How does Swappr work? |
answer | string | yes | 1..5000 chars, trimmed. | You create a profile… |
order | integer | yes | ≥ 0. Lower numbers appear first. | 1 |
isPublished | boolean | yes | true shows it on the app; false is a draft. | true |
{
"question": "How does Swappr work?",
"answer": "You create a profile, upload details and photos of your home and then browse other verified tenants looking to swap.",
"order": 1,
"isPublished": true
}
Response — 201 Created
Returns the created FAQ row (id, question, answer, order, isPublished, createdAt, updatedAt).
Error responses
| Status | Code | Meaning |
|---|---|---|
| 400 | VALIDATION_FAILED | Missing/blank field, or out-of-range order. |
| 401 | UNAUTHENTICATED | Missing, malformed, expired, or non-admin-scope token. |
| 403 | FORBIDDEN | Admin authenticated but role is FINANCE (read-only). |
Side effects
- Inserts a row into the
faqscollection. - Writes a
faq.createdadmin audit-log row.
See also
curl
curl -X POST "https://api.swappr.co.uk/api/v1/admin/faqs" \
-H "Authorization: Bearer $ADMIN_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "question": "How does Swappr work?", "answer": "You create a profile…", "order": 1, "isPublished": true }'