POST
/
api
/
v1
/
admin
/
faqs
Admin create FAQ
curl --request POST \
  --url https://api.example.com/api/v1/admin/faqs
import 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_body

Overview

Creates a FAQ entry. Set isPublished: 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

FieldTypeRequiredConstraintsExample
questionstringyes1..300 chars, trimmed.How does Swappr work?
answerstringyes1..5000 chars, trimmed.You create a profile…
orderintegeryes≥ 0. Lower numbers appear first.1
isPublishedbooleanyestrue 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

StatusCodeMeaning
400VALIDATION_FAILEDMissing/blank field, or out-of-range order.
401UNAUTHENTICATEDMissing, malformed, expired, or non-admin-scope token.
403FORBIDDENAdmin authenticated but role is FINANCE (read-only).

Side effects

  • Inserts a row into the faqs collection.
  • Writes a faq.created admin 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 }'