Skip to main content
POST
Starts building a playbook with AI, as the Wordsmith app’s playbook import does. Wordsmith reads your precedent contracts and drafts the checks, each with its instructions and standard position. Generation usually takes several minutes, so the call returns an operation straight away. See Long-running operations for how to wait for it. The operation’s resource names the new playbook. It has no checks until the operation succeeds; checks appear one by one while it runs, and progress.completed counts them. If the operation fails, Wordsmith deletes the playbook when it still has no checks. A generation that fills the playbook to the largest size Wordsmith can store fails with playbook_capacity_exceeded, which is not retryable; the playbook keeps the checks that fit. Cancel operation stops a generation; the playbook keeps the checks drafted so far, even when there are none. On success, result holds { "playbook_id" }. Read the checks with Get playbook and adjust them with Update check. Like any new playbook, it is visible only to you until you share it with Update sharing.

Authentication

Requires an API key, or an OAuth token with playbooks:write and files:read.

Headers

string
A unique key for this request. A retry with the same key and body within 30 days returns the same operation instead of starting a second one. See Retrying safely.

Body parameters

string
required
The name of the new playbook, up to 200 characters.
string[]
required
1 to 10 example or precedent contracts, as file_ids from the files API. Signed agreements on your own terms work best: Wordsmith takes their positions as your standard. A file_id comes from Complete upload or Import file, not from Upload URL, which returns a job_id.
integer
default:"0"
Seconds to wait for the operation to finish before responding, from 0 to 20. Generation rarely finishes this fast, so expect a running operation.
string
An HTTPS URL that receives a signed POST with the operation when it finishes. An API key signs it with its webhook secret. For an OAuth app, the response carries the callback_secret that signs it. See Callbacks for OAuth apps.

Query parameters

boolean
default:"false"
true answers an operation that is still queued or running with 202 Accepted, a Location header and a Retry-After header in seconds. Location is the operation’s Get operation URL, with respond_async=true. Poll it until the response is not 202; that response is the finished operation. A succeeded operation is a 200. A failed or cancelled one is a 422 with the operation as its body, so an automation’s step fails instead of passing on a result that is not there. Power Automate and Logic Apps follow this pattern by themselves. Pass true to turn it on. A value that is not a boolean is a 400, and a call that starts work then starts nothing.

Response

Returns 202 with the operation, of type playbook_generation. A repeat with the same Idempotency-Key returns 200 with the same operation. With respond_async=true, the status code follows the operation’s status instead, as the respond_async query parameter above describes.

Errors