Skip to content
ShopAssist Docs
APIAPI referenceKnowledge base

Upsert Faq

Upsert by external_ref: 200 updated, 201 created (the handler sets the status).

PUT/v1/stores/{store_id}/knowledge/faqs/{external_ref}Scope knowledge:write

Upsert by `external_ref`: `200` updated, `201` created (the handler sets the status).

Parameters

Parameters of Upsert Faq
NameInTypeDescription
store_idrequiredpathstring
external_refrequiredpathstringMerchant FAQ key

Request body (FaqUpsert)

Request body of Upsert Faq
FieldTypeDescription
answerrequiredstring1–10000 characters
localestring2–35 characters · pattern `^[A-Za-z]{2,3}(-[A-Za-z0-9]{2,8})*$`
questionrequiredstring1–500 characters

Example request

curl -X PUT "https://api.shopassist.coec.dk/v1/stores/sto_01j8000000e008000000000000/knowledge/faqs/string" \
  -H "Authorization: Bearer $SHOPASSIST_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"answer":"string","locale":"da-DK","question":"string"}'

Response 200 (KnowledgeDocument)

Response of Upsert Faq
FieldTypeDescription
chunk_countrequiredinteger
content_previewrequiredstring
doc_typerequiredstring (enum)one of policy, page, faq, file, blog, size_chart, other
fetched_atrequiredstring | nullformat date-time
idrequiredstringpattern `^kdoc_[0-9a-hjkmnp-tv-z]{26}$`
injection_flagsrequiredInjectionFlag[]
injection_flags[].excerptrequiredstring
injection_flags[].rulerequiredstring
localerequiredstring | null
pending_changerequiredPendingChange | null
pending_change.diff_previewrequiredstring
pending_change.reasonrequired"off_domain" | "crawled_policy" | "content_changed" | "mass_change"
pending_change.sincerequiredstringformat date-time
policy_typerequiredstring (enum) | nullone of refund, return, shipping, privacy, terms, contact, legal_notice, subscription, withdrawal, other
review_statusrequired"approved" | "pending_review" | "rejected"
source_idrequiredstringpattern `^ksrc_[0-9a-hjkmnp-tv-z]{26}$`
statusrequired"active" | "excluded" | "error"
titlerequiredstring
updated_atrequiredstringformat date-time
urlrequiredstring | nullformat uri · ≤ 2048 characters
{
  "chunk_count": 1,
  "content_preview": "string",
  "doc_type": "policy",
  "fetched_at": "2026-09-28T10:15:30.123Z",
  "id": "kdoc_01j8000000e008000000000000",
  "injection_flags": [
    {
      "excerpt": "string",
      "rule": "string"
    }
  ],
  "locale": "da-DK",
  "pending_change": {
    "diff_preview": "string",
    "reason": "off_domain",
    "since": "2026-09-28T10:15:30.123Z"
  },
  "policy_type": "refund",
  "review_status": "approved",
  "source_id": "ksrc_01j8000000e008000000000000",
  "status": "active",
  "title": "string",
  "updated_at": "2026-09-28T10:15:30.123Z",
  "url": "https://shop.example/products/linen-shirt"
}

Errors

Every error uses the error envelope; the code field is stable.

  • 400 Bad Request
  • 401 Unauthorized
  • 403 Forbidden
  • 404 Not Found
  • 422 Unprocessable Content
  • 429 Too Many Requests

Last updated on