Documentation

POST /api/ad/edit

Override the ad copy, or reset it to the generated version.

RequestPOST /api/ad/edit
AuthenticationSession cookie required
Handlerbackend/server.py

What it does

Saves founder-written headline and body copy over the generated artifact, or discards the override with `reset`. The generated version is never lost; reset restores it.

Authentication

Session cookie required. Send the ff_session cookie. Without one the engine treats the caller as a new visitor with no holds and no claims, and returns a new cookie to use from then on.

Parameters

ParameterInTypeRequiredDescription
ff_sessioncookiestringOptionalThe session identifier. Omit it on the first call and store the value the response sets; every later call must send the same one or the engine treats the caller as a new visitor with no holds and no claims.
product_idbodystringOptionalThe product. Defaults to the session's resolved one.
headlinebodystringOptionalThe headline to save.
primary_textbodystringOptionalThe body copy to save.
resetbodybooleanOptionalDiscard the override and restore the generated copy.

Request

The cookie jar carries the session between calls. Angle-bracketed values are the parameter types from the table above.

curl -s -b cookies.txt -c cookies.txt \
  -X POST -H 'Content-Type: application/json' \
  -d '{"product_id":"<string>","headline":"<string>","primary_text":"<string>","reset":"<boolean>"}' \
  "https://flowfinds.ai/api/ad/edit"
const res = await fetch("https://flowfinds.ai/api/ad/edit", {
  method: "POST",
  credentials: "include",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "product_id": "<string>",
    "headline": "<string>",
    "primary_text": "<string>",
    "reset": "<boolean>"
  }),
});
const data = await res.json();
import requests

s = requests.Session()
r = s.post("https://flowfinds.ai/api/ad/edit", json={
    "product_id": "<string>",
    "headline": "<string>",
    "primary_text": "<string>",
    "reset": "<boolean>"
  })
data = r.json()

Recorded example

curl -s -b cookies.txt -c cookies.txt \
  -X POST -H 'Content-Type: application/json' \
  -d '{"headline":"…","primary_text":"…"}' \
  "$FLOWFINDS_ORIGIN/api/ad/edit"

Responses

200Copy was saved.

FieldTypeDescription
statusstring`saved`.
product_idstringThe product.
headlinestringAs stored.
primary_textstringAs stored.

200The override was discarded.

FieldTypeDescription
statusstring`reset`.
product_idstringThe product.

Errors

StatusReasonWhen
400bad_fieldA supplied field is not editable or not usable.
401The session has no account.
409There is no artifact to edit.

Related

Back to the API reference index, or read the cookbook for recipes that compose this endpoint with others.