Tillwire Read the guide
API reference

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

Parameters

idpathstring
idpathstring
Idempotency-KeyheaderstringSee common parameters

Request body

DraftAcceptRequest

Answer

Draft

Errors: 401, 403, 404, 405, 409, 413, 422, 429

curl -X POST -H "Authorization: Bearer $TOKEN" https://yourshop.example/api/v1/drafts/{id}/accept

POST/api/v1/draftsdrafts.createcatalogue.write

Parameters

Idempotency-KeyheaderstringSee common parameters

Request body

DraftRequest

Answer

Draft

Errors: 401, 403, 405, 409, 413, 422, 429

curl -X POST -H "Authorization: Bearer $TOKEN" https://yourshop.example/api/v1/drafts

POST/api/v1/drafts/{id}/editdrafts.editcatalogue.write

Parameters

idpathstring
idpathstring
Idempotency-KeyheaderstringSee common parameters

Request body

DraftEditRequest

Answer

Draft

Errors: 401, 403, 404, 405, 409, 413, 422, 429

curl -X POST -H "Authorization: Bearer $TOKEN" https://yourshop.example/api/v1/drafts/{id}/edit

GET/api/v1/drafts/{id}drafts.getcatalogue.read

Parameters

idpathstring
idpathstring

Answer

Draft

Errors: 401, 403, 404, 405, 422, 429

curl -X GET -H "Authorization: Bearer $TOKEN" https://yourshop.example/api/v1/drafts/{id}

GET/api/v1/draftsdrafts.listcatalogue.read

Parameters

statusquerystringThe state: pending, accepted, rejected or stale; every state when left out.
productquerystringOnly the drafts of the product at this slug; the drafts of every product when left out.
beforequeryintegerThe id to page from: the drafts with an id below it; the newest when left out.
limitqueryintegerThe most drafts in the page: 1 to 100; 50 when left out.

Answer

DraftPage

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

Parameters

idpathstring
idpathstring
Idempotency-KeyheaderstringSee common parameters

Request body

DraftRejectRequest

Answer

Draft

Errors: 401, 403, 404, 405, 409, 413, 422, 429

curl -X POST -H "Authorization: Bearer $TOKEN" https://yourshop.example/api/v1/drafts/{id}/reject

POST/api/v1/drafts/settingsdrafts.save-settingsstore.write

Parameters

Idempotency-KeyheaderstringSee common parameters

Errors: 401, 403, 405, 409, 413, 422, 429

curl -X POST -H "Authorization: Bearer $TOKEN" https://yourshop.example/api/v1/drafts/settings

GET/api/v1/drafts/settingsdrafts.settingscatalogue.read

Errors: 401, 403, 405, 422, 429

curl -X GET -H "Authorization: Bearer $TOKEN" https://yourshop.example/api/v1/drafts/settings

POST/api/v1/drafts/testdrafts.test-connectionstore.write

Parameters

Idempotency-KeyheaderstringSee common parameters

Errors: 401, 403, 405, 409, 422, 429

curl -X POST -H "Authorization: Bearer $TOKEN" https://yourshop.example/api/v1/drafts/test

GET/api/v1/drafts/usagedrafts.usagecatalogue.read

Errors: 401, 403, 405, 422, 429

curl -X GET -H "Authorization: Bearer $TOKEN" https://yourshop.example/api/v1/drafts/usage

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_atrequiredstring (date-time)
asked_byrequiredstring
classesrequiredarray of string
cost_micro_usdrequiredinteger
currentrequiredstring
decided_atstring (date-time)
decided_bystring
digestrequiredstring
fieldrequiredstring
findingsrequiredarray of DraftFinding
idrequiredinteger
modelrequiredstring
notestring
originalrequiredstring
productrequiredstring
providerrequiredstring
statusrequiredstring
textrequiredstring
tokens_inrequiredinteger
tokens_outrequiredinteger
untickedrequiredarray 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.

seenrequiredstring
textstring
ticksarray of integer
DraftAnswer

DraftAnswer is the answer to one of the store's questions.

questionrequiredstring
textrequiredstring
DraftBrief

DraftBrief is how the store wants its texts written.

avoidrequiredarray of string
lengthrequiredstring
tonerequiredstring
userequiredarray of string
DraftClaimWord

DraftClaimWord is a word of the store's and the kind of claim it is.

kindrequiredstring
wordrequiredstring
DraftEditRequest

DraftEditRequest is the body of drafts.edit: the text the person wants; its findings are made again and its ticks are cleared.

textrequiredstring
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.

blocksrequiredboolean
detailstring
endrequiredinteger
kindrequiredstring
startrequiredinteger
textrequiredstring
tickedrequiredboolean
DraftPage

DraftPage is a page of drafts, newest first; Next is the Before of the next page, 0 for the last.

itemsrequiredarray of Draft
nextrequiredinteger
DraftRejectRequest

DraftRejectRequest is the body of drafts.reject.

notestring
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).

answersarray of DraftAnswer
mustarray of string
must_notarray of string
productrequiredstring
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.

briefrequiredDraftBrief
cap_changesrequiredarray of DraftSettingsChange
claim_wordsrequiredarray of DraftClaimWord
default_noticerequiredstring
enabledrequiredboolean
fieldsrequiredarray of string
keep_monthsrequiredinteger
key_applies_at_next_startrequiredboolean
key_namerequiredstring
key_setrequiredboolean
languagerequiredstring
max_tokensrequiredinteger
modelrequiredstring
monthly_cap_centsrequiredinteger
noticerequiredstring
off_wordsrequiredarray of string
per_minuterequiredinteger
percent_wordsrequiredarray of string
photorequiredboolean
providerrequiredstring
questionsrequiredarray of string
revisionrequiredinteger
savedrequiredboolean
saved_atstring (date-time)
saved_bystring
timeout_secondsrequiredinteger
warn_percentrequiredinteger
DraftSettingsChange

DraftSettingsChange is a line of the monthly cap's history: when, who, and the cap before and after, in US dollars.

afterrequiredstring
atrequiredstring (date-time)
beforerequiredstring
byrequiredstring
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.

briefrequiredDraftBrief
claim_wordsrequiredarray of DraftClaimWord
enabledrequiredboolean
fieldsrequiredarray of string
keep_monthsrequiredinteger
key_namerequiredstring
languagerequiredstring
max_tokensrequiredinteger
modelrequiredstring
monthly_cap_centsrequiredinteger
noticerequiredstring
off_wordsrequiredarray of string
per_minuterequiredinteger
percent_wordsrequiredarray of string
photorequiredboolean
providerrequiredstring
questionsrequiredarray of string
timeout_secondsrequiredinteger
warn_percentrequiredinteger
DraftSettingsRequest

DraftSettingsRequest saves the settings whole, at the revision the screen read (0 while none is saved).

revisionrequiredinteger
settingsrequiredDraftSettingsFields
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.

okrequiredboolean
problemstring
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.

callsrequiredinteger
cap_micro_usdrequiredinteger
failuresrequiredinteger
in_progress_micro_usdrequiredinteger
left_micro_usdrequiredinteger
monthrequiredstring
no_keyrequiredboolean
offrequiredboolean
pausedrequiredboolean
resumes_atstring (date-time)
spent_micro_usdrequiredinteger
stoppedrequiredboolean
stopped_untilstring (date-time)
testsrequiredinteger
unsure_micro_usdrequiredinteger
warnrequiredboolean

Made from engine/internal/openapi/openapi.json at commit 6c4cbd921. The contract-only operations come from the engine’s stub file, engine/internal/ops.