Skip to content

Generate Pins from a URL

POST
/v1/accounts/{accountId}/generations
curl --request POST \
--url https://api-v1.tailwind.ai/v1/accounts/example/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "url": "https://example.com", "title": "example", "designTier": "basic", "premiumStyle": "image-highlight", "keywords": [ "example" ] }'

Start a one-shot AI Pin generation from a source URL (SmartPin). Asynchronous: the response returns a generation id to poll with GET /v1/generations/{generationId}; resulting drafts appear in the posts list carrying a matching generationId. Each generation spends plan credits by design tier (resolved server-side). If a generation for the same URL is already in flight, the response returns that generation with deduplicated: true and NO additional credit is charged by this call. If the URL already has a SmartPin on this account, it is reused as-is (its stored tier is billed; caller tier parameters are ignored); a SmartPin for the URL on a different account is a 409 conflict.

accountId
required
string

Numeric Tailwind account ID returned by GET /v1/accounts

Media typeapplication/json
object
url
required

Source page to generate Pins from (http/https). Query parameters and fragments are ignored for identity — variants of one page map to one SmartPin.

string format: uri
<= 2048 characters
title

Display name for the SmartPin in the Tailwind dashboard. Defaults to the URL (truncated to 256 characters).

string
<= 256 characters
designTier

Design tier for the generated Pins. Determines the credit cost (approximately: 3 basic / 7 premium / 1 no-template, resolved server-side). Ignored when the URL’s existing SmartPin on this account is reused.

string
default: basic
Allowed values: basic premium no-template
premiumStyle

Visual style for premium generations. Required when designTier is “premium”; must be absent otherwise.

string
Allowed values: image-highlight text-highlight minimalist artistic professional natural
keywords

Keywords to guide the generated Pin copy.

Array<string>
<= 10 items

Generation accepted and processing

Media typeapplication/json
object
data
object
generation
object
id

Generation ID. Poll GET /v1/generations/{generationId} with it.

string
status
string
Allowed values: processing
smartPinId

The SmartPin record this generation runs against.

integer
designTier

Effective design tier of the referenced generation (“template-match” can appear only when an existing record with that tier was reused).

string
Allowed values: basic premium template-match no-template
creditCost

Nominal per-generation credit cost of the referenced generation’s tier. When deduplicated is true, the response refers to an already-charged in-flight generation — no additional credit is charged by this call.

integer
reusedExistingSmartPin

True when an existing SmartPin for this URL and account was reused (caller tier parameters ignored).

boolean
deduplicated

True when a generation for this URL was already in flight and its id is returned instead of starting (and charging) a new one.

boolean
meta
object
requestId

Unique request ID for debugging

string
Example
{
"data": {
"generation": {
"status": "processing",
"designTier": "basic"
}
}
}

Invalid request

Media typeapplication/json
object
error
object
code

Error code

string
message

Error message

string
reason

Machine-readable denial reason. Present on PAYMENT_REQUIRED errors: insufficient_credits, trial_exhausted, no_access, account_not_connected.

string
meta
object
requestId

Unique request ID for debugging

string
Example
{
"error": {
"code": "BAD_REQUEST",
"message": "Invalid request body"
},
"meta": {
"requestId": "abc123"
}
}

Authentication required or invalid bearer credentials

Media typeapplication/json
object
error
object
code

Error code

string
message

Error message

string
reason

Machine-readable denial reason. Present on PAYMENT_REQUIRED errors: insufficient_credits, trial_exhausted, no_access, account_not_connected.

string
meta
object
requestId

Unique request ID for debugging

string
Example
{
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid API key"
},
"meta": {
"requestId": "abc123"
}
}

Billing denied — scheduling requires an available credit or trial allowance on the account

Media typeapplication/json
object
error
object
code

Error code

string
message

Error message

string
reason

Machine-readable denial reason. Present on PAYMENT_REQUIRED errors: insufficient_credits, trial_exhausted, no_access, account_not_connected.

string
meta
object
requestId

Unique request ID for debugging

string
Example
{
"error": {
"code": "PAYMENT_REQUIRED",
"message": "Not enough credits to schedule this post.",
"reason": "insufficient_credits"
},
"meta": {
"requestId": "abc123"
}
}

Resource not found

Media typeapplication/json
object
error
object
code

Error code

string
message

Error message

string
reason

Machine-readable denial reason. Present on PAYMENT_REQUIRED errors: insufficient_credits, trial_exhausted, no_access, account_not_connected.

string
meta
object
requestId

Unique request ID for debugging

string
Example
{
"error": {
"code": "NOT_FOUND",
"message": "Account not found"
},
"meta": {
"requestId": "abc123"
}
}

Conflict: the URL’s SmartPin belongs to a different account in the organization, or a concurrent request for the same URL holds the generation lock (retry shortly)

Rate limit exceeded

Media typeapplication/json
object
error
object
code

Error code

string
message

Error message

string
reason

Machine-readable denial reason. Present on PAYMENT_REQUIRED errors: insufficient_credits, trial_exhausted, no_access, account_not_connected.

string
meta
object
requestId

Unique request ID for debugging

string
Example
{
"error": {
"code": "RATE_LIMIT_EXCEEDED",
"message": "Daily rate limit of 5000 requests exceeded. Resets at midnight UTC."
},
"meta": {
"requestId": "abc123"
}
}