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_body

Overview

Partially updates a FAQ. Send only the fields you want to change — e.g. flip isPublished 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

ParamTypeNotes
idstring24-char Mongo ObjectId of the FAQ.

Request body

All fields optional, but at least one must be present.
FieldTypeConstraints
questionstring1..300 chars, trimmed.
answerstring1..5000 chars, trimmed.
orderinteger≥ 0.
isPublishedbooleantrue shows it on the app; false is a draft.
{
  "isPublished": false
}

Response — 200 OK

Returns the updated FAQ row.

Error responses

StatusCodeMeaning
400VALIDATION_FAILEDEmpty body, or a field out of range.
401UNAUTHENTICATEDMissing, malformed, expired, or non-admin-scope token.
403FORBIDDENAdmin authenticated but role is FINANCE (read-only).
404NOT_FOUNDNo FAQ with that id.

Side effects

  • Updates the row in the faqs collection.
  • Writes a faq.updated admin 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 }'