Content

Generate a draft

Start writing the draft for an opportunity. This spends one of the month's content credits, so it needs confirm_credit: true and an idempotency key.

POSThttps://api.vidrys.com/v1/projects/{project_id}/content-assets/{asset_id}/generate
Plan
Track and above
Key
read-and-write
Rate cost
1 unit

Drafting runs in the background: this returns 202 with the generation pending, and the text arrives at Get the latest draft.

Send the same idempotency_key when you retry. A repeat of a key you have used before returns the original generation instead of spending a second credit.

Drafting is also rate-limited on its own: at most 10 generations a minute per workspace, dashboard ones included.

Reviewed by Garvit Sharma, Co-founder, on 4 November 2026. This call is included from the Track plan, ₹6,999 a month in INR before 18% GST. Requests and responses follow HTTP semantics (RFC 9110), bearer tokens (RFC 6750) and JSON.

What does the request need?

A POST request to /v1/projects/{project_id}/content-assets/{asset_id}/generate sends one header, an API key with read-and-write access, and takes 2 path parameters and 2 body fields. Each part is listed below.

Authorization header

Sent as a header on every request.

Authorizationstringrequired

A Vidrys API key, sent as Bearer vidrys_sk_…. This call changes data, so the key must be read-and-write. See Authentication.

Path parameters

project_idstringrequired

The project's id, from List projects.

asset_idstringrequired

The opportunity's id, from List content opportunities.

Request body

application/json

idempotency_keystringrequired

Your own key for this attempt, 1–128 characters. Reuse it on retries.

confirm_creditbooleandefault false

Send true to proceed. Left out, the call answers confirmation_required and nothing is spent.

What does it return? · 202

application/json

asset_idstring

The content opportunity being drafted.

generation_versioninteger

Which draft this is for the opportunity, counting from 1.

statusstring

pending on a new request. A replayed idempotency_key returns the original generation's current status. refunded is a failure whose credit was returned.

Values:pendingsucceededfailedrefunded

credit_consumedboolean

Whether this generation spent a content credit.

Which errors can it return?

403 write_not_allowedThe key or connection is read-only, or it belongs to a viewer. Writes need a read-and-write key or connection, from a member who can edit.
422 confirmation_requiredA draft spends a content credit, and the call didn't confirm it with `confirm_credit: true`.
402 credits_exhaustedThis month's content credits are used up. Retrying won't help until the credits reset on the 1st (UTC).
402 payment_requiredThe plan doesn't include this capability for the project, or the workspace has reached its daily usage limit. Drafting a content opportunity is the call that can return it.
409 conflictThe item isn't in a state that allows the change — for example marking an opportunity published before it has a draft, or drafting one that is already being drafted.
404 not_foundThe project or item doesn't exist in this workspace. A project from another workspace also returns 404, never 403.
422 invalid_requestA parameter or body field is missing or has the wrong type or value. The message names the field. Also returned when a write would pass the plan's prompt limit.
401 unauthorizedNo key was sent, or the key is unknown, revoked or expired, or the member who created it has left the workspace or been deactivated.
402 plan_requiredThe workspace's plan doesn't include API access. It's included on every plan from Track up — Solo is the one without it.
403 workspace_not_approvedThe workspace is still waiting for approval, or wasn't approved.
429 rate_limitedToo many requests this minute. Wait for the number of seconds in the `Retry-After` header, then retry.

Every code, and what to retry, is in Errors.