Rebuild smart schedule
const url = 'https://api-v1.tailwind.ai/v1/accounts/example/timeslots/rebuild';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"slotsPerDay":1}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Numeric Tailwind account ID returned by GET /v1/accounts
Request Bodyrequired
Section titled “Request Bodyrequired”object
How many slots to generate on each of the 7 days. The same 1-50 range the dashboard allows.
Examplegenerated
{ "slotsPerDay": 1}Responses
Section titled “Responses”Schedule rebuilt
object
object
The requested slots per day
Total non-evergreen slots the schedule now holds (slotsPerDay × 7)
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
object
Unique request ID for debugging
Example
{ "data": { "rebuilt": true, "timezoneSource": "user" }}Invalid request
object
object
Error code
Error message
Machine-readable denial reason. Present on PAYMENT_REQUIRED errors: insufficient_credits, trial_exhausted, no_access, account_not_connected, legacy_post_limit_exceeded.
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.
object
Unique request ID for debugging
Example
{ "error": { "code": "BAD_REQUEST", "message": "Invalid request body" }, "meta": { "requestId": "abc123" }}Authentication required or invalid bearer credentials
object
object
Error code
Error message
Machine-readable denial reason. Present on PAYMENT_REQUIRED errors: insufficient_credits, trial_exhausted, no_access, account_not_connected, legacy_post_limit_exceeded.
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.
object
Unique request ID for debugging
Example
{ "error": { "code": "UNAUTHORIZED", "message": "Invalid API key" }, "meta": { "requestId": "abc123" }}Resource not found
object
object
Error code
Error message
Machine-readable denial reason. Present on PAYMENT_REQUIRED errors: insufficient_credits, trial_exhausted, no_access, account_not_connected, legacy_post_limit_exceeded.
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.
object
Unique request ID for debugging
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.
object
object
Error code
Error message
Machine-readable denial reason. Present on PAYMENT_REQUIRED errors: insufficient_credits, trial_exhausted, no_access, account_not_connected, legacy_post_limit_exceeded.
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.
object
Unique request ID for debugging
Example
{ "error": { "code": "CONFLICT", "message": "This account's schedule is being updated elsewhere. Retry in a moment." }, "meta": { "requestId": "abc123" }}Rate limit exceeded
object
object
Error code
Error message
Machine-readable denial reason. Present on PAYMENT_REQUIRED errors: insufficient_credits, trial_exhausted, no_access, account_not_connected, legacy_post_limit_exceeded.
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.
object
Unique request ID for debugging
Example
{ "error": { "code": "RATE_LIMIT_EXCEEDED", "message": "Daily rate limit of 5000 requests exceeded. Resets at midnight UTC." }, "meta": { "requestId": "abc123" }}