Admin update FAQ
curl --request PATCH \
--url https://api.example.com/api/v1/admin/faqs/{id}import requests
url = "https://api.example.com/api/v1/admin/faqs/{id}"
response = requests.patch(url)
print(response.text)const options = {method: 'PATCH'};
fetch('https://api.example.com/api/v1/admin/faqs/{id}', 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/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
]);
$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/{id}"
req, _ := http.NewRequest("PATCH", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.example.com/api/v1/admin/faqs/{id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/admin/faqs/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
response = http.request(request)
puts response.read_bodyFAQs
Admin update FAQ
Edit a FAQ’s text, order, or published state.
PATCH
/
api
/
v1
/
admin
/
faqs
/
{id}
Admin update FAQ
curl --request PATCH \
--url https://api.example.com/api/v1/admin/faqs/{id}import requests
url = "https://api.example.com/api/v1/admin/faqs/{id}"
response = requests.patch(url)
print(response.text)const options = {method: 'PATCH'};
fetch('https://api.example.com/api/v1/admin/faqs/{id}', 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/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
]);
$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/{id}"
req, _ := http.NewRequest("PATCH", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.example.com/api/v1/admin/faqs/{id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/admin/faqs/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
response = http.request(request)
puts response.read_bodyOverview
Partially updates a FAQ. Send only the fields you want to change — e.g. flipisPublished to publish/unpublish, or change order to reposition it.
Authentication
Bearer <accessToken> with scope: 'admin' required (requireAdmin).
Role-gated to SUPER and MODERATOR. FINANCE is read-only on the FAQs surface.
Path parameters
| Param | Type | Notes |
|---|---|---|
id | string | 24-char Mongo ObjectId of the FAQ. |
Request body
All fields optional, but at least one must be present.| Field | Type | Constraints |
|---|---|---|
question | string | 1..300 chars, trimmed. |
answer | string | 1..5000 chars, trimmed. |
order | integer | ≥ 0. |
isPublished | boolean | true shows it on the app; false is a draft. |
{
"isPublished": false
}
Response — 200 OK
Returns the updated FAQ row.
Error responses
| Status | Code | Meaning |
|---|---|---|
| 400 | VALIDATION_FAILED | Empty body, or a field out of range. |
| 401 | UNAUTHENTICATED | Missing, malformed, expired, or non-admin-scope token. |
| 403 | FORBIDDEN | Admin authenticated but role is FINANCE (read-only). |
| 404 | NOT_FOUND | No FAQ with that id. |
Side effects
- Updates the row in the
faqscollection. - Writes a
faq.updatedadmin audit-log row.
See also
curl
curl -X PATCH "https://api.swappr.co.uk/api/v1/admin/faqs/665f0a1b2c3d4e5f60718293" \
-H "Authorization: Bearer $ADMIN_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "isPublished": false }'