Drafts. 10 operations.
10 of them work. Each needs a bearer token with its scope. All operations.
Operations
POST/api/v1/drafts/{id}/acceptdrafts.acceptcatalogue.write
POST/api/v1/draftsdrafts.createcatalogue.write
POST/api/v1/drafts/{id}/editdrafts.editcatalogue.write
GET/api/v1/drafts/{id}drafts.getcatalogue.read
GET/api/v1/draftsdrafts.listcatalogue.read
Parameters
statusquery | stringThe state: pending, accepted, rejected or stale; every state when left out. |
productquery | stringOnly the drafts of the product at this slug; the drafts of every product when left out. |
beforequery | integerThe id to page from: the drafts with an id below it; the newest when left out. |
limitquery | integerThe most drafts in the page: 1 to 100; 50 when left out. |
Answer
Errors: 401, 403, 405, 422, 429
curl -X GET -H "Authorization: Bearer $TOKEN" https://yourshop.example/api/v1/drafts
POST/api/v1/drafts/{id}/rejectdrafts.rejectcatalogue.write
POST/api/v1/drafts/settingsdrafts.save-settingsstore.write
GET/api/v1/drafts/settingsdrafts.settingscatalogue.read
Schemas 16
Draft
Draft is a draft as a person sees it (ASI-4.7, ASI-4.8): the text beside Current, the field's text now, and the Digest to send back.
asked_atrequired | string (date-time) |
asked_byrequired | string |
classesrequired | array of string |
cost_micro_usdrequired | integer |
currentrequired | string |
decided_at | string (date-time) |
decided_by | string |
digestrequired | string |
fieldrequired | string |
findingsrequired | array of DraftFinding |
idrequired | integer |
modelrequired | string |
note | string |
originalrequired | string |
productrequired | string |
providerrequired | string |
statusrequired | string |
textrequired | string |
tokens_inrequired | integer |
tokens_outrequired | integer |
untickedrequired | array of integer |
DraftAcceptRequest
DraftAcceptRequest is the body of drafts.accept: Seen is the digest of what the person saw (none is Invalid); Text, if given, is the text written in place of the draft's; Ticks are the findings the person ticked.
seenrequired | string |
text | string |
ticks | array of integer |
DraftAnswer
DraftAnswer is the answer to one of the store's questions.
questionrequired | string |
textrequired | string |
DraftBrief
DraftBrief is how the store wants its texts written.
avoidrequired | array of string |
lengthrequired | string |
tonerequired | string |
userequired | array of string |
DraftClaimWord
DraftClaimWord is a word of the store's and the kind of claim it is.
kindrequired | string |
wordrequired | string |
DraftEditRequest
DraftEditRequest is the body of drafts.edit: the text the person wants; its findings are made again and its ticks are cleared.
textrequired | string |
DraftFinding
DraftFinding is something the engine found in a draft's text (ASI-4.9): Kind is price, code, phone, contact, claim or number; Start and End are byte places in the text; Detail is the kind the store gave a claim word. Blocks: the accept waits until the finding is out of the text. Ticked: the person ticked it.
blocksrequired | boolean |
detail | string |
endrequired | integer |
kindrequired | string |
startrequired | integer |
textrequired | string |
tickedrequired | boolean |
DraftPage
DraftPage is a page of drafts, newest first; Next is the Before of the next page, 0 for the last.
itemsrequired | array of Draft |
nextrequired | integer |
DraftRejectRequest
DraftRejectRequest is the body of drafts.reject.
note | string |
DraftRequest
DraftRequest is the body of drafts.create: the product, the person's answers to the store's questions and the words the text must say and must not say (ASI-4.5).
answers | array of DraftAnswer |
must | array of string |
must_not | array of string |
productrequired | string |
DraftSettings
DraftSettings are the store's settings of the AI drafts (ASI-4.14, D5), as drafts.settings answers them: each setting; KeyName, the secret store.yaml names for the provider's key, and KeySet, whether it holds one (never the key); Notice, the store's words about where the data goes, and DefaultNotice, the engine's, with the store's country, which a screen shows when Notice is empty; whether the store saved its own, at what revision, by whom and when; and CapChanges, the history of the monthly cap's changes, the newest first.
briefrequired | DraftBrief |
cap_changesrequired | array of DraftSettingsChange |
claim_wordsrequired | array of DraftClaimWord |
default_noticerequired | string |
enabledrequired | boolean |
fieldsrequired | array of string |
keep_monthsrequired | integer |
key_applies_at_next_startrequired | boolean |
key_namerequired | string |
key_setrequired | boolean |
languagerequired | string |
max_tokensrequired | integer |
modelrequired | string |
monthly_cap_centsrequired | integer |
noticerequired | string |
off_wordsrequired | array of string |
per_minuterequired | integer |
percent_wordsrequired | array of string |
photorequired | boolean |
providerrequired | string |
questionsrequired | array of string |
revisionrequired | integer |
savedrequired | boolean |
saved_at | string (date-time) |
saved_by | string |
timeout_secondsrequired | integer |
warn_percentrequired | integer |
DraftSettingsChange
DraftSettingsChange is a line of the monthly cap's history: when, who, and the cap before and after, in US dollars.
afterrequired | string |
atrequired | string (date-time) |
beforerequired | string |
byrequired | string |
DraftSettingsFields
DraftSettingsFields are the settings a store sets: the monthly cap in US cents; the fields, the store's attribute names that may be sent; the questions a person answers when asking; the brief; the claim words and the words for percent and for a reduction, all the store's own.
briefrequired | DraftBrief |
claim_wordsrequired | array of DraftClaimWord |
enabledrequired | boolean |
fieldsrequired | array of string |
keep_monthsrequired | integer |
key_namerequired | string |
languagerequired | string |
max_tokensrequired | integer |
modelrequired | string |
monthly_cap_centsrequired | integer |
noticerequired | string |
off_wordsrequired | array of string |
per_minuterequired | integer |
percent_wordsrequired | array of string |
photorequired | boolean |
providerrequired | string |
questionsrequired | array of string |
timeout_secondsrequired | integer |
warn_percentrequired | integer |
DraftSettingsRequest
DraftSettingsRequest saves the settings whole, at the revision the screen read (0 while none is saved).
revisionrequired | integer |
settingsrequired | DraftSettingsFields |
DraftsConnection
DraftsConnection is the answer of drafts.test-connection (ASI-4.17): OK when the provider answered; else Problem says what, in a word the screen puts in the store's words: key (the provider refused the key), model (it does not have the model), timeout, busy or other. It never holds the key or the provider's text.
okrequired | boolean |
problem | string |
DraftsUsage
DraftsUsage is the month's use of the provider (ASI-4.14), in millionths of a dollar. Stopped: the cap is used, until StoppedUntil. Paused: five failures in a row, until ResumesAt.
callsrequired | integer |
cap_micro_usdrequired | integer |
failuresrequired | integer |
in_progress_micro_usdrequired | integer |
left_micro_usdrequired | integer |
monthrequired | string |
no_keyrequired | boolean |
offrequired | boolean |
pausedrequired | boolean |
resumes_at | string (date-time) |
spent_micro_usdrequired | integer |
stoppedrequired | boolean |
stopped_until | string (date-time) |
testsrequired | integer |
unsure_micro_usdrequired | integer |
warnrequired | boolean |
Made from engine/internal/openapi/openapi.json at commit 6c4cbd921. The contract-only operations come from the engine’s stub file, engine/internal/ops.