Skip to content

Rebuild smart schedule

POST
/v1/accounts/{accountId}/timeslots/rebuild
curl --request POST \
--url https://api-v1.tailwind.ai/v1/accounts/example/timeslots/rebuild \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "slotsPerDay": 1 }'

Replace the account’s smart schedule with a freshly generated one: every non-evergreen slot is deleted, including manual and recommended ones, and slotsPerDay new auto-created slots are spread across each of the 7 days between 5am and 11pm in the account’s timezone. This is the dashboard’s “Generate new SmartSchedule”. Only call it when the user has explicitly asked to rebuild the entire schedule; to move, add or remove individual slots use the create, update and delete endpoints instead. There is no day-part preference: the generator cannot be asked for mornings only.

Pins already scheduled keep their times and become off-slot. Evergreen (SmartLoop) slots survive. Rebuilds are serialized per account: a second one arriving while the first is still running is rejected with a 409 rather than racing it, so a client that retries after a timeout cannot end up with a doubled schedule. Within a single call the delete and the insert are still separate writes, so a failure between them can leave the account with no schedule; re-running the rebuild is the recovery. timezoneSource reports fallback when the account has no timezone set and the schedule was generated in America/New_York instead.

accountId
required
string

Numeric Tailwind account ID returned by GET /v1/accounts

Media typeapplication/json
object
slotsPerDay
required

How many slots to generate on each of the 7 days. The same 1-50 range the dashboard allows.

integer
>= 1 <= 50
Examplegenerated
{
"slotsPerDay": 1
}

Schedule rebuilt

Media typeapplication/json
object
data
object
rebuilt
required
boolean
slotsPerDay
required

The requested slots per day

integer
timeslotCount
required

Total non-evergreen slots the schedule now holds (slotsPerDay × 7)

integer
timezoneSource
required

user when the schedule was generated in the account’s own timezone; fallback when the account has none set and America/New_York was used

string
Allowed values: user fallback
meta
object
requestId

Unique request ID for debugging

string
Example
{
"data": {
"rebuilt": true,
"timezoneSource": "user"
}
}

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, legacy_post_limit_exceeded.

string
resolve_url

Present on PAYMENT_REQUIRED errors: where the denial can be resolved. Reason-specific, because buying credits does not clear a trial, access or connection denial. Requests sent with X-Request-Source: mcp receive an informational plans page instead, so agent surfaces never present a purchase link.

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, legacy_post_limit_exceeded.

string
resolve_url

Present on PAYMENT_REQUIRED errors: where the denial can be resolved. Reason-specific, because buying credits does not clear a trial, access or connection denial. Requests sent with X-Request-Source: mcp receive an informational plans page instead, so agent surfaces never present a purchase link.

string
meta
object
requestId

Unique request ID for debugging

string
Example
{
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid API key"
},
"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, legacy_post_limit_exceeded.

string
resolve_url

Present on PAYMENT_REQUIRED errors: where the denial can be resolved. Reason-specific, because buying credits does not clear a trial, access or connection denial. Requests sent with X-Request-Source: mcp receive an informational plans page instead, so agent surfaces never present a purchase link.

string
meta
object
requestId

Unique request ID for debugging

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

Another write to this account’s smart schedule holds the lock — in practice a rebuild, which replaces every slot and so cannot run alongside other changes. Nothing was written; retry in a moment.

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, legacy_post_limit_exceeded.

string
resolve_url

Present on PAYMENT_REQUIRED errors: where the denial can be resolved. Reason-specific, because buying credits does not clear a trial, access or connection denial. Requests sent with X-Request-Source: mcp receive an informational plans page instead, so agent surfaces never present a purchase link.

string
meta
object
requestId

Unique request ID for debugging

string
Example
{
"error": {
"code": "CONFLICT",
"message": "This account's schedule is being updated elsewhere. Retry in a moment."
},
"meta": {
"requestId": "abc123"
}
}

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, legacy_post_limit_exceeded.

string
resolve_url

Present on PAYMENT_REQUIRED errors: where the denial can be resolved. Reason-specific, because buying credits does not clear a trial, access or connection denial. Requests sent with X-Request-Source: mcp receive an informational plans page instead, so agent surfaces never present a purchase link.

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"
}
}