{"openapi":"3.1.0","info":{"title":"Tsuzuro API","version":"2026-05-01","description":"Programmable conversational runtime. Public REST API at `/v1`. Error codes use `tsuzuro/<area>/<reason>`."},"tags":[{"name":"system"},{"name":"studio-auth"},{"name":"api-keys"},{"name":"workspaces"},{"name":"projects"},{"name":"environments"},{"name":"threads"},{"name":"messages"},{"name":"console"},{"name":"channels"},{"name":"whatsapp"},{"name":"agents"},{"name":"agent-runs"},{"name":"looms"},{"name":"tools"},{"name":"byok-credentials"},{"name":"meta-apps"},{"name":"stitches"}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Studio access JWT (`typ=studio`) or project API key (`tsu_test_...` / `tsu_live_...`)."}},"schemas":{"TsuzuroEventEnvelope":{"type":"object","properties":{"eventId":{"$ref":"#/components/schemas/EventId"},"eventName":{"type":"string","pattern":"^[a-z][a-z0-9_]*\\.[a-z][a-z0-9_]*\\.[a-z][a-z0-9_]*$","example":"thread.message.received"},"occurredAt":{"type":"string","format":"date-time","example":"2026-05-07T12:00:00.000Z"},"apiVersion":{"type":"string","example":"2026-05-01"},"projectId":{"$ref":"#/components/schemas/ProjectId"},"data":{"type":"object","additionalProperties":{"nullable":true},"description":"Event-specific payload"}},"required":["eventId","eventName","occurredAt","apiVersion","projectId","data"]},"EventId":{"type":"string","pattern":"^evt_[A-Za-z0-9_-]+$","description":"Event identifier","example":"evt_01example"},"ProjectId":{"type":"string","pattern":"^prj_[A-Za-z0-9_-]+$","description":"Project identifier","example":"prj_01example"},"StudioAuthTokenResponse":{"type":"object","properties":{"accessToken":{"type":"string","description":"JWT (15 min typical)"},"tokenType":{"type":"string","enum":["Bearer"]},"expiresIn":{"type":"integer","minimum":0,"exclusiveMinimum":true,"example":900}},"required":["accessToken","tokenType","expiresIn"]},"TsuzuroErrorResponse":{"type":"object","properties":{"error":{"type":"string","pattern":"^tsuzuro\\/[a-z_]+\\/[a-z0-9_]+$","description":"Stable machine code","example":"tsuzuro/runtime/not_implemented"},"message":{"type":"string","example":"This endpoint is not implemented yet."},"requestId":{"type":"string","example":"req_01example"},"docsUrl":{"type":"string","format":"uri","description":"Link to human-readable documentation for this error"},"details":{"type":"object","additionalProperties":{"nullable":true},"description":"Optional structured details; must not leak cross-tenant data"}},"required":["error","message","requestId"]},"StudioAuthSignupBody":{"type":"object","properties":{"email":{"type":"string","maxLength":320,"format":"email","example":"dev@example.com"},"password":{"type":"string","minLength":8,"maxLength":256,"description":"Minimum 8 characters"},"workspaceName":{"type":"string","minLength":1,"maxLength":256,"example":"Acme"}},"required":["email","password"]},"StudioAuthLoginBody":{"type":"object","properties":{"email":{"type":"string","maxLength":320,"format":"email"},"password":{"type":"string","minLength":1,"maxLength":256}},"required":["email","password"]},"StudioMeResponse":{"type":"object","properties":{"userId":{"$ref":"#/components/schemas/UserId"},"email":{"type":"string","format":"email"},"emailVerified":{"type":"boolean"},"workspaceId":{"$ref":"#/components/schemas/WorkspaceId"},"workspaceRole":{"$ref":"#/components/schemas/StudioWorkspaceRole"},"projectId":{"$ref":"#/components/schemas/ProjectId"},"projectRole":{"$ref":"#/components/schemas/StudioProjectRole"}},"required":["userId","email","emailVerified","workspaceId","workspaceRole"]},"UserId":{"type":"string","pattern":"^usr_[A-Za-z0-9_-]+$","description":"User identifier","example":"usr_01example"},"WorkspaceId":{"type":"string","pattern":"^ws_[A-Za-z0-9_-]+$","description":"Workspace identifier","example":"ws_01example"},"StudioWorkspaceRole":{"type":"string","enum":["owner","admin","viewer"]},"StudioProjectRole":{"type":"string","enum":["developer","viewer"]},"AuthActionAcceptedResponse":{"type":"object","properties":{"accepted":{"type":"boolean","enum":[true]}},"required":["accepted"]},"VerifyEmailBody":{"type":"object","properties":{"token":{"type":"string","minLength":1}},"required":["token"]},"ForgotPasswordBody":{"type":"object","properties":{"email":{"type":"string","maxLength":320,"format":"email"}},"required":["email"]},"ResetPasswordBody":{"type":"object","properties":{"token":{"type":"string","minLength":1},"password":{"type":"string","minLength":8,"maxLength":256}},"required":["token","password"]},"ListWorkspacesResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Workspace"}},"nextCursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}},"required":["data","nextCursor","hasMore"]},"Workspace":{"type":"object","properties":{"workspaceId":{"$ref":"#/components/schemas/WorkspaceId"},"name":{"type":"string","minLength":1,"maxLength":256},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"archivedAt":{"type":"string","nullable":true,"format":"date-time"}},"required":["workspaceId","name","createdAt","updatedAt"]},"CreateWorkspaceBody":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":256}},"required":["name"]},"ListProjectsResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Project"}},"nextCursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}},"required":["data","nextCursor","hasMore"]},"Project":{"type":"object","properties":{"projectId":{"$ref":"#/components/schemas/ProjectId"},"workspaceId":{"$ref":"#/components/schemas/WorkspaceId"},"name":{"type":"string","minLength":1,"maxLength":256},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"archivedAt":{"type":"string","nullable":true,"format":"date-time"}},"required":["projectId","workspaceId","name","createdAt","updatedAt"]},"ListEnvironmentsResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Environment"}},"nextCursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}},"required":["data","nextCursor","hasMore"]},"Environment":{"type":"object","properties":{"environmentId":{"$ref":"#/components/schemas/EnvironmentId"},"projectId":{"$ref":"#/components/schemas/ProjectId"},"name":{"type":"string","minLength":1,"maxLength":128},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["environmentId","projectId","name","createdAt","updatedAt"]},"EnvironmentId":{"type":"string","pattern":"^env_[A-Za-z0-9_-]+$","description":"Environment identifier","example":"env_01example"},"WorkspaceInvitation":{"type":"object","properties":{"invitationId":{"$ref":"#/components/schemas/WorkspaceInvitationId"},"workspaceId":{"$ref":"#/components/schemas/WorkspaceId"},"email":{"type":"string","format":"email"},"studioRole":{"$ref":"#/components/schemas/StudioWorkspaceRole"},"consoleRole":{"$ref":"#/components/schemas/ConsoleProjectRole"},"invitedByUserId":{"$ref":"#/components/schemas/UserId"},"expiresAt":{"type":"string","format":"date-time"},"acceptedAt":{"type":"string","nullable":true,"format":"date-time"},"revokedAt":{"type":"string","nullable":true,"format":"date-time"},"createdAt":{"type":"string","format":"date-time"}},"required":["invitationId","workspaceId","email","studioRole","consoleRole","invitedByUserId","expiresAt","createdAt"]},"WorkspaceInvitationId":{"type":"string","pattern":"^wsi_[A-Za-z0-9_-]+$","description":"Workspace invitation identifier","example":"wsi_01example"},"ConsoleProjectRole":{"type":"string","enum":["project_owner","agent","viewer"]},"CreateWorkspaceInvitationBody":{"type":"object","properties":{"email":{"type":"string","maxLength":320,"format":"email"},"studioRole":{"type":"string","enum":["admin","viewer"],"default":"admin"},"consoleRole":{"$ref":"#/components/schemas/ConsoleProjectRole"}},"required":["email"]},"ListWorkspaceInvitationsResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WorkspaceInvitation"}},"nextCursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}},"required":["data","nextCursor","hasMore"]},"AcceptWorkspaceInvitationBody":{"type":"object","properties":{"token":{"type":"string","minLength":1},"password":{"type":"string","minLength":8,"maxLength":256}},"required":["token"]},"ListApiKeysResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ApiKey"}},"nextCursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}},"required":["data","nextCursor","hasMore"]},"ApiKey":{"type":"object","properties":{"apiKeyId":{"$ref":"#/components/schemas/ApiKeyId"},"projectId":{"$ref":"#/components/schemas/ProjectId"},"name":{"type":"string","minLength":1,"maxLength":128},"environment":{"$ref":"#/components/schemas/ApiKeyEnvironment"},"keyPrefix":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}},"status":{"$ref":"#/components/schemas/ApiKeyStatus"},"createdAt":{"type":"string","format":"date-time"},"expiresAt":{"type":"string","nullable":true,"format":"date-time"},"revokedAt":{"type":"string","nullable":true,"format":"date-time"},"rotationGraceExpiresAt":{"type":"string","nullable":true,"format":"date-time"},"lastUsedAt":{"type":"string","nullable":true,"format":"date-time"},"lastUsedIp":{"type":"string","nullable":true}},"required":["apiKeyId","projectId","name","environment","keyPrefix","scopes","status","createdAt"]},"ApiKeyId":{"type":"string","pattern":"^key_[A-Za-z0-9_-]+$","description":"API key identifier","example":"key_01example"},"ApiKeyEnvironment":{"type":"string","enum":["test","live"]},"ApiKeyStatus":{"type":"string","enum":["active","revoked","rotating"]},"ApiKeyCreatedResponse":{"type":"object","properties":{"apiKeyId":{"$ref":"#/components/schemas/ApiKeyId"},"projectId":{"$ref":"#/components/schemas/ProjectId"},"name":{"type":"string"},"keyPrefix":{"type":"string","example":"tsu_test_key_..."},"environment":{"$ref":"#/components/schemas/ApiKeyEnvironment"},"scopes":{"type":"array","items":{"type":"string"}},"secret":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"expiresAt":{"type":"string","nullable":true,"format":"date-time"}},"required":["apiKeyId","projectId","name","keyPrefix","environment","scopes","secret","createdAt"]},"CreateApiKeyBody":{"type":"object","properties":{"projectId":{"$ref":"#/components/schemas/ProjectId"},"name":{"type":"string","minLength":1,"maxLength":128},"environment":{"$ref":"#/components/schemas/ApiKeyEnvironment"},"scopes":{"type":"array","items":{"$ref":"#/components/schemas/ApiKeyScope"},"minItems":1},"expiresAt":{"type":"string","nullable":true,"format":"date-time"}},"required":["projectId","name","environment","scopes"]},"ApiKeyScope":{"type":"string","enum":["threads:read","threads:write","messages:read","messages:write","agents:read","agents:write","agents:run","tools:read","tools:write","tools:execute","channels:read","channels:write","channels:connect","webhooks:read","webhooks:write","usage:read","audit:read","*"]},"ApiKeyRotatedResponse":{"type":"object","properties":{"newKey":{"$ref":"#/components/schemas/ApiKeyCreatedResponse"},"previousKeyId":{"$ref":"#/components/schemas/ApiKeyId"},"rotationGraceExpiresAt":{"type":"string","nullable":true,"format":"date-time"}},"required":["newKey","previousKeyId"]},"RotateApiKeyBody":{"type":"object","properties":{"gracePeriodSeconds":{"type":"integer","minimum":0,"maximum":86400,"default":300}}},"ListMetaAppCredentialsResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/MetaAppCredential"}},"nextCursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}},"required":["data","nextCursor","hasMore"]},"MetaAppCredential":{"type":"object","properties":{"metaAppCredentialId":{"$ref":"#/components/schemas/MetaAppCredentialId"},"workspaceId":{"$ref":"#/components/schemas/WorkspaceId"},"name":{"type":"string","minLength":1,"maxLength":128},"appId":{"type":"string","minLength":1,"maxLength":128},"status":{"$ref":"#/components/schemas/MetaAppCredentialStatus"},"keyFingerprint":{"type":"string"},"metadata":{"type":"object","additionalProperties":{"nullable":true},"default":{}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"revokedAt":{"type":"string","nullable":true,"format":"date-time"}},"required":["metaAppCredentialId","workspaceId","name","appId","status","keyFingerprint","createdAt","updatedAt"]},"MetaAppCredentialId":{"type":"string","pattern":"^map_[A-Za-z0-9_-]+$","description":"Meta app credential identifier","example":"map_01example"},"MetaAppCredentialStatus":{"type":"string","enum":["active","revoked"]},"MetaAppCredentialCreatedResponse":{"allOf":[{"$ref":"#/components/schemas/MetaAppCredential"},{"type":"object","properties":{"verifyToken":{"type":"string","minLength":16,"maxLength":256},"webhookUrl":{"type":"string","format":"uri"}},"required":["verifyToken","webhookUrl"]}]},"CreateMetaAppCredentialBody":{"type":"object","properties":{"workspaceId":{"$ref":"#/components/schemas/WorkspaceId"},"name":{"type":"string","minLength":1,"maxLength":128},"appId":{"type":"string","minLength":1,"maxLength":128},"appSecret":{"type":"string","minLength":8,"maxLength":4096},"metadata":{"type":"object","additionalProperties":{"nullable":true},"default":{}}},"required":["workspaceId","name","appId","appSecret"]},"RotateMetaAppCredentialBody":{"type":"object","properties":{"appSecret":{"type":"string","minLength":8,"maxLength":4096}},"required":["appSecret"]},"ListThreadsResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Thread"}},"nextCursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}},"required":["data","nextCursor","hasMore"]},"Thread":{"type":"object","properties":{"threadId":{"$ref":"#/components/schemas/ThreadId"},"projectId":{"$ref":"#/components/schemas/ProjectId"},"environmentId":{"$ref":"#/components/schemas/EnvironmentId"},"channelId":{"$ref":"#/components/schemas/ChannelId"},"status":{"$ref":"#/components/schemas/ThreadStatus"},"agentMode":{"$ref":"#/components/schemas/AgentMode"},"tags":{"type":"array","items":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9][a-zA-Z0-9_-]*$"},"default":[]},"customFields":{"$ref":"#/components/schemas/ThreadCustomFields"},"metadata":{"type":"object","additionalProperties":{"nullable":true},"default":{}},"lastMessageAt":{"type":"string","format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"archivedAt":{"type":"string","nullable":true,"format":"date-time"}},"required":["threadId","projectId","environmentId","status","lastMessageAt","createdAt","updatedAt"]},"ThreadId":{"type":"string","pattern":"^thread_[A-Za-z0-9_-]+$","description":"Thread identifier","example":"thread_01example"},"ChannelId":{"type":"string","nullable":true,"pattern":"^ch_[A-Za-z0-9_-]+$","description":"Channel identifier","example":"ch_01example"},"ThreadStatus":{"type":"string","enum":["open","closed","archived"]},"AgentMode":{"type":"string","nullable":true,"enum":["auto","suggest","paused",null]},"ThreadCustomFields":{"type":"object","additionalProperties":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]},"default":{}},"CreateThreadBody":{"type":"object","properties":{"projectId":{"$ref":"#/components/schemas/ProjectId"},"environmentId":{"$ref":"#/components/schemas/EnvironmentId"},"channelId":{"$ref":"#/components/schemas/ChannelId"},"externalRef":{"type":"string","minLength":1,"maxLength":256},"metadata":{"type":"object","additionalProperties":{"nullable":true},"default":{}}},"required":["projectId","environmentId"]},"ListMessagesResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Message"}},"nextCursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}},"required":["data","nextCursor","hasMore"]},"Message":{"type":"object","properties":{"messageId":{"$ref":"#/components/schemas/MessageId"},"threadId":{"$ref":"#/components/schemas/ThreadId"},"projectId":{"$ref":"#/components/schemas/ProjectId"},"direction":{"$ref":"#/components/schemas/MessageDirection"},"body":{"type":"string"},"externalMessageId":{"type":"string","nullable":true},"status":{"$ref":"#/components/schemas/MessageStatus"},"attachments":{"type":"array","items":{"$ref":"#/components/schemas/MessageAttachment"},"default":[]},"metadata":{"type":"object","additionalProperties":{"nullable":true},"default":{}},"createdAt":{"type":"string","format":"date-time"}},"required":["messageId","threadId","projectId","direction","body","createdAt"]},"MessageId":{"type":"string","pattern":"^msg_[A-Za-z0-9_-]+$","description":"Message identifier","example":"msg_01example"},"MessageDirection":{"type":"string","enum":["inbound","outbound"]},"MessageStatus":{"type":"string","nullable":true,"enum":["queued","sent","delivered","read","failed",null]},"MessageAttachment":{"type":"object","properties":{"attachmentId":{"type":"string","minLength":1,"maxLength":128},"kind":{"type":"string","enum":["image","audio","video","document","sticker"]},"mimeType":{"type":"string","minLength":1,"maxLength":128},"filename":{"type":"string","minLength":1,"maxLength":256},"sizeBytes":{"type":"integer","minimum":0},"r2Key":{"type":"string","minLength":1,"maxLength":1024},"url":{"type":"string","format":"uri"},"providerMediaId":{"type":"string","minLength":1,"maxLength":256},"metadata":{"type":"object","additionalProperties":{"nullable":true},"default":{}}},"required":["kind"]},"CreateThreadMessageBody":{"type":"object","properties":{"projectId":{"$ref":"#/components/schemas/ProjectId"},"direction":{"$ref":"#/components/schemas/MessageDirection"},"body":{"type":"string","minLength":1,"maxLength":16000},"attachments":{"type":"array","items":{"$ref":"#/components/schemas/MessageAttachment"},"maxItems":10,"default":[]},"metadata":{"type":"object","additionalProperties":{"nullable":true},"default":{}}},"required":["projectId","body"]},"ListChannelsResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Channel"}},"nextCursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}},"required":["data","nextCursor","hasMore"]},"Channel":{"type":"object","properties":{"channelId":{"$ref":"#/components/schemas/ChannelId"},"projectId":{"$ref":"#/components/schemas/ProjectId"},"environmentId":{"$ref":"#/components/schemas/EnvironmentId"},"name":{"type":"string","minLength":1,"maxLength":256},"kind":{"$ref":"#/components/schemas/ChannelKind"},"status":{"$ref":"#/components/schemas/ChannelStatus"},"metadata":{"type":"object","additionalProperties":{"nullable":true},"default":{}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["channelId","projectId","environmentId","name","kind","status","createdAt","updatedAt"]},"ChannelKind":{"type":"string","enum":["sandbox","custom","whatsapp"]},"ChannelStatus":{"type":"string","enum":["disconnected","connecting","connected","error"]},"CreateChannelBody":{"type":"object","properties":{"projectId":{"$ref":"#/components/schemas/ProjectId"},"environmentId":{"$ref":"#/components/schemas/EnvironmentId"},"name":{"type":"string","minLength":1,"maxLength":256},"kind":{"$ref":"#/components/schemas/ChannelKind"},"metadata":{"type":"object","additionalProperties":{"nullable":true},"default":{}}},"required":["projectId","environmentId","name","kind"]},"InboundChannelMessageBody":{"type":"object","properties":{"projectId":{"$ref":"#/components/schemas/ProjectId"},"threadId":{"$ref":"#/components/schemas/ThreadId"},"externalThreadRef":{"type":"string","minLength":1,"maxLength":256},"externalParticipantRef":{"type":"string","minLength":1,"maxLength":256},"body":{"type":"string","minLength":1,"maxLength":16000},"attachments":{"type":"array","items":{"$ref":"#/components/schemas/MessageAttachment"},"maxItems":10,"default":[]},"metadata":{"type":"object","additionalProperties":{"nullable":true},"default":{}}},"required":["projectId","body"]},"ListChannelCommandsResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ChannelCommand"}},"nextCursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}},"required":["data","nextCursor","hasMore"]},"ChannelCommand":{"type":"object","properties":{"eventId":{"type":"string"},"eventName":{"type":"string"},"occurredAt":{"type":"string","format":"date-time"},"projectId":{"$ref":"#/components/schemas/ProjectId"},"channelId":{"$ref":"#/components/schemas/ChannelId"},"data":{"type":"object","additionalProperties":{"nullable":true},"default":{}}},"required":["eventId","eventName","occurredAt","projectId","channelId"]},"ListStitchesResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Stitch"}},"nextCursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}},"required":["data","nextCursor","hasMore"]},"Stitch":{"type":"object","properties":{"stitchId":{"$ref":"#/components/schemas/StitchId"},"projectId":{"$ref":"#/components/schemas/ProjectId"},"name":{"type":"string","minLength":1,"maxLength":256},"webhookUrl":{"type":"string","nullable":true,"format":"uri"},"status":{"$ref":"#/components/schemas/StitchStatus"},"eventNames":{"type":"array","items":{"type":"string","minLength":1},"default":[]},"metadata":{"type":"object","additionalProperties":{"nullable":true},"default":{}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"archivedAt":{"type":"string","nullable":true,"format":"date-time"}},"required":["stitchId","projectId","name","status","createdAt","updatedAt"]},"StitchId":{"type":"string","pattern":"^stitch_[A-Za-z0-9_-]+$","description":"Stitch identifier","example":"stitch_01example"},"StitchStatus":{"type":"string","enum":["active","disabled","error"]},"StitchCreatedResponse":{"type":"object","properties":{"stitch":{"$ref":"#/components/schemas/Stitch"},"secret":{"type":"string","minLength":24}},"required":["stitch","secret"]},"CreateStitchBody":{"type":"object","properties":{"projectId":{"$ref":"#/components/schemas/ProjectId"},"name":{"type":"string","minLength":1,"maxLength":256},"webhookUrl":{"type":"string","format":"uri"},"eventNames":{"type":"array","items":{"type":"string","minLength":1},"default":[]},"metadata":{"type":"object","additionalProperties":{"nullable":true},"default":{}}},"required":["projectId","name","webhookUrl"]},"RotateStitchSecretResponse":{"type":"object","properties":{"stitch":{"$ref":"#/components/schemas/Stitch"},"secret":{"type":"string","minLength":24}},"required":["stitch","secret"]},"ListWebhookDeliveriesResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WebhookDelivery"}},"nextCursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}},"required":["data","nextCursor","hasMore"]},"WebhookDelivery":{"type":"object","properties":{"deliveryId":{"$ref":"#/components/schemas/WebhookDeliveryId"},"projectId":{"$ref":"#/components/schemas/ProjectId"},"stitchId":{"allOf":[{"$ref":"#/components/schemas/StitchId"},{"nullable":true}]},"eventId":{"type":"string","nullable":true},"status":{"$ref":"#/components/schemas/WebhookDeliveryStatus"},"attemptCount":{"type":"integer","minimum":0},"responseStatus":{"type":"integer","nullable":true},"lastError":{"type":"string","nullable":true},"lastAttemptAt":{"type":"string","nullable":true,"format":"date-time"},"nextAttemptAt":{"type":"string","nullable":true,"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["deliveryId","projectId","status","attemptCount","createdAt","updatedAt"]},"WebhookDeliveryId":{"type":"string","pattern":"^whd_[A-Za-z0-9_-]+$","description":"Webhook delivery identifier","example":"whd_01example"},"WebhookDeliveryStatus":{"type":"string","enum":["pending","delivering","delivered","retrying","failed","cancelled"]},"ListByokCredentialsResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ByokCredential"}},"nextCursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}},"required":["data","nextCursor","hasMore"]},"ByokCredential":{"type":"object","properties":{"byokCredentialId":{"$ref":"#/components/schemas/ByokCredentialId"},"projectId":{"$ref":"#/components/schemas/ProjectId"},"provider":{"$ref":"#/components/schemas/LlmProvider"},"displayName":{"type":"string","minLength":1,"maxLength":128},"status":{"$ref":"#/components/schemas/ByokCredentialStatus"},"keyFingerprint":{"type":"string"},"modelAllowlist":{"type":"array","items":{"type":"string"}},"lastUsedAt":{"type":"string","nullable":true,"format":"date-time"},"rotationGraceExpiresAt":{"type":"string","nullable":true,"format":"date-time"},"revokedAt":{"type":"string","nullable":true,"format":"date-time"},"metadata":{"type":"object","additionalProperties":{"nullable":true},"default":{}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["byokCredentialId","projectId","provider","displayName","status","keyFingerprint","modelAllowlist","createdAt","updatedAt"]},"ByokCredentialId":{"type":"string","pattern":"^byok_[A-Za-z0-9_-]+$","description":"BYOK credential identifier","example":"byok_01example"},"LlmProvider":{"type":"string","enum":["openai","anthropic","openrouter"]},"ByokCredentialStatus":{"type":"string","enum":["active","revoked","rotating"]},"CreateByokCredentialBody":{"type":"object","properties":{"projectId":{"$ref":"#/components/schemas/ProjectId"},"provider":{"$ref":"#/components/schemas/LlmProvider"},"displayName":{"type":"string","minLength":1,"maxLength":128},"secret":{"type":"string","minLength":8,"maxLength":4096},"modelAllowlist":{"type":"array","items":{"type":"string","minLength":1,"maxLength":256},"default":[]},"metadata":{"type":"object","additionalProperties":{"nullable":true},"default":{}}},"required":["projectId","provider","displayName","secret"]},"RotateByokCredentialBody":{"type":"object","properties":{"secret":{"type":"string","minLength":8,"maxLength":4096},"gracePeriodSeconds":{"type":"integer","minimum":0,"maximum":86400,"default":300}},"required":["secret"]},"ListToolsResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Tool"}},"nextCursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}},"required":["data","nextCursor","hasMore"]},"Tool":{"type":"object","properties":{"toolId":{"$ref":"#/components/schemas/ToolId"},"projectId":{"$ref":"#/components/schemas/ProjectId"},"name":{"type":"string","minLength":1,"maxLength":256},"url":{"type":"string","nullable":true,"format":"uri"},"method":{"$ref":"#/components/schemas/ToolHttpMethod"},"headers":{"type":"object","additionalProperties":{"nullable":true},"default":{}},"timeoutMs":{"type":"integer","minimum":100,"maximum":30000},"retryMaxAttempts":{"type":"integer","minimum":1,"maximum":5},"retryBackoffMs":{"type":"integer","minimum":0,"maximum":30000},"status":{"$ref":"#/components/schemas/ToolStatus"},"metadata":{"type":"object","additionalProperties":{"nullable":true},"default":{}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["toolId","projectId","name","method","timeoutMs","retryMaxAttempts","retryBackoffMs","status","createdAt","updatedAt"]},"ToolId":{"type":"string","pattern":"^tool_[A-Za-z0-9_-]+$","description":"Tool identifier","example":"tool_01example"},"ToolHttpMethod":{"type":"string","enum":["GET","POST","PATCH","PUT","DELETE"]},"ToolStatus":{"type":"string","enum":["active","disabled","error"]},"CreateToolBody":{"type":"object","properties":{"projectId":{"$ref":"#/components/schemas/ProjectId"},"name":{"type":"string","minLength":1,"maxLength":256},"url":{"type":"string","format":"uri"},"method":{"$ref":"#/components/schemas/ToolHttpMethod"},"headers":{"type":"object","additionalProperties":{"nullable":true},"default":{}},"timeoutMs":{"type":"integer","minimum":100,"maximum":30000,"default":5000},"retryMaxAttempts":{"type":"integer","minimum":1,"maximum":5,"default":1},"retryBackoffMs":{"type":"integer","minimum":0,"maximum":30000,"default":250},"metadata":{"type":"object","additionalProperties":{"nullable":true},"default":{}}},"required":["projectId","name","url"]},"ListLoomsResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Loom"}},"nextCursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}},"required":["data","nextCursor","hasMore"]},"Loom":{"type":"object","properties":{"loomId":{"$ref":"#/components/schemas/LoomId"},"projectId":{"$ref":"#/components/schemas/ProjectId"},"name":{"type":"string","minLength":1,"maxLength":256},"status":{"$ref":"#/components/schemas/LoomStatus"},"activeVersionId":{"$ref":"#/components/schemas/LoomVersionId"},"metadata":{"type":"object","additionalProperties":{"nullable":true},"default":{}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"archivedAt":{"type":"string","nullable":true,"format":"date-time"}},"required":["loomId","projectId","name","status","createdAt","updatedAt"]},"LoomId":{"type":"string","pattern":"^loom_[A-Za-z0-9_-]+$","description":"Loom identifier","example":"loom_01example"},"LoomStatus":{"type":"string","enum":["active","archived"]},"LoomVersionId":{"type":"string","nullable":true,"pattern":"^lver_[A-Za-z0-9_-]+$","description":"Loom version identifier","example":"lver_01example"},"LoomVersion":{"type":"object","properties":{"loomVersionId":{"$ref":"#/components/schemas/LoomVersionId"},"projectId":{"$ref":"#/components/schemas/ProjectId"},"loomId":{"$ref":"#/components/schemas/LoomId"},"version":{"type":"integer","minimum":0,"exclusiveMinimum":true},"status":{"$ref":"#/components/schemas/LoomVersionStatus"},"systemPrompt":{"type":"string"},"rules":{"type":"array","items":{"type":"string"}},"provider":{"$ref":"#/components/schemas/LlmProvider"},"model":{"type":"string"},"byokCredentialId":{"allOf":[{"$ref":"#/components/schemas/ByokCredentialId"},{"nullable":true}]},"mode":{"$ref":"#/components/schemas/AgentMode"},"temperature":{"type":"number","nullable":true,"minimum":0,"maximum":2},"maxTokens":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true},"toolIds":{"type":"array","items":{"$ref":"#/components/schemas/ToolId"}},"metadata":{"type":"object","additionalProperties":{"nullable":true},"default":{}},"createdAt":{"type":"string","format":"date-time"}},"required":["loomVersionId","projectId","loomId","version","status","systemPrompt","rules","provider","model","mode","toolIds","createdAt"]},"LoomVersionStatus":{"type":"string","enum":["published","archived"]},"CreateLoomBody":{"type":"object","properties":{"projectId":{"$ref":"#/components/schemas/ProjectId"},"name":{"type":"string","minLength":1,"maxLength":256},"systemPrompt":{"type":"string","minLength":1,"maxLength":64000},"rules":{"type":"array","items":{"type":"string","minLength":1,"maxLength":2000},"default":[]},"provider":{"$ref":"#/components/schemas/LlmProvider"},"model":{"type":"string","minLength":1,"maxLength":256},"byokCredentialId":{"$ref":"#/components/schemas/ByokCredentialId"},"mode":{"$ref":"#/components/schemas/AgentMode"},"temperature":{"type":"number","minimum":0,"maximum":2},"maxTokens":{"type":"integer","minimum":0,"exclusiveMinimum":true},"toolIds":{"type":"array","items":{"$ref":"#/components/schemas/ToolId"},"default":[]},"metadata":{"type":"object","additionalProperties":{"nullable":true},"default":{}}},"required":["projectId","name","systemPrompt","provider","model"]},"CreateLoomVersionBody":{"type":"object","properties":{"systemPrompt":{"type":"string","minLength":1,"maxLength":64000},"rules":{"type":"array","items":{"type":"string","minLength":1,"maxLength":2000},"default":[]},"provider":{"$ref":"#/components/schemas/LlmProvider"},"model":{"type":"string","minLength":1,"maxLength":256},"byokCredentialId":{"$ref":"#/components/schemas/ByokCredentialId"},"mode":{"$ref":"#/components/schemas/AgentMode"},"temperature":{"type":"number","minimum":0,"maximum":2},"maxTokens":{"type":"integer","minimum":0,"exclusiveMinimum":true},"toolIds":{"type":"array","items":{"$ref":"#/components/schemas/ToolId"},"default":[]},"metadata":{"type":"object","additionalProperties":{"nullable":true},"default":{}},"projectId":{"$ref":"#/components/schemas/ProjectId"},"activate":{"type":"boolean","default":true}},"required":["systemPrompt","provider","model","projectId"]},"ActivateLoomVersionBody":{"type":"object","properties":{"projectId":{"$ref":"#/components/schemas/ProjectId"},"loomVersionId":{"$ref":"#/components/schemas/LoomVersionId"}},"required":["projectId","loomVersionId"]},"ListAgentsResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Agent"}},"nextCursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}},"required":["data","nextCursor","hasMore"]},"Agent":{"type":"object","properties":{"agentId":{"$ref":"#/components/schemas/AgentId"},"projectId":{"$ref":"#/components/schemas/ProjectId"},"name":{"type":"string","minLength":1,"maxLength":256},"mode":{"$ref":"#/components/schemas/AgentMode"},"loomId":{"allOf":[{"$ref":"#/components/schemas/LoomId"},{"nullable":true}]},"activeLoomVersionId":{"$ref":"#/components/schemas/LoomVersionId"},"metadata":{"type":"object","additionalProperties":{"nullable":true},"default":{}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"archivedAt":{"type":"string","nullable":true,"format":"date-time"}},"required":["agentId","projectId","name","mode","createdAt","updatedAt"]},"AgentId":{"type":"string","pattern":"^agt_[A-Za-z0-9_-]+$","description":"Agent identifier","example":"agt_01example"},"CreateAgentBody":{"type":"object","properties":{"projectId":{"$ref":"#/components/schemas/ProjectId"},"name":{"type":"string","minLength":1,"maxLength":256},"mode":{"$ref":"#/components/schemas/AgentMode"},"loomId":{"$ref":"#/components/schemas/LoomId"},"metadata":{"type":"object","additionalProperties":{"nullable":true},"default":{}}},"required":["projectId","name"]},"AgentRun":{"type":"object","properties":{"agentRunId":{"$ref":"#/components/schemas/AgentRunId"},"projectId":{"$ref":"#/components/schemas/ProjectId"},"agentId":{"allOf":[{"$ref":"#/components/schemas/AgentId"},{"nullable":true}]},"loomId":{"allOf":[{"$ref":"#/components/schemas/LoomId"},{"nullable":true}]},"loomVersionId":{"$ref":"#/components/schemas/LoomVersionId"},"threadId":{"allOf":[{"$ref":"#/components/schemas/ThreadId"},{"nullable":true}]},"inputMessageId":{"allOf":[{"$ref":"#/components/schemas/MessageId"},{"nullable":true}]},"outputMessageId":{"allOf":[{"$ref":"#/components/schemas/MessageId"},{"nullable":true}]},"status":{"$ref":"#/components/schemas/AgentRunStatus"},"provider":{"$ref":"#/components/schemas/LlmProvider"},"model":{"type":"string"},"mode":{"$ref":"#/components/schemas/AgentMode"},"promptTokens":{"type":"integer","nullable":true},"completionTokens":{"type":"integer","nullable":true},"totalTokens":{"type":"integer","nullable":true},"estimatedCostMicros":{"type":"integer","nullable":true},"errorCode":{"type":"string","nullable":true},"errorMessage":{"type":"string","nullable":true},"toolCallCount":{"type":"integer"},"trace":{"type":"object","additionalProperties":{"nullable":true},"default":{}},"metadata":{"type":"object","additionalProperties":{"nullable":true},"default":{}},"startedAt":{"type":"string","nullable":true,"format":"date-time"},"completedAt":{"type":"string","nullable":true,"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["agentRunId","projectId","status","provider","model","mode","toolCallCount","createdAt","updatedAt"]},"AgentRunId":{"type":"string","pattern":"^run_[A-Za-z0-9_-]+$","description":"Agent run identifier","example":"run_01example"},"AgentRunStatus":{"type":"string","enum":["pending","running","succeeded","failed","cancelled"]},"CreateAgentRunBody":{"type":"object","properties":{"projectId":{"$ref":"#/components/schemas/ProjectId"},"threadId":{"$ref":"#/components/schemas/ThreadId"},"inputMessageId":{"$ref":"#/components/schemas/MessageId"},"metadata":{"type":"object","additionalProperties":{"nullable":true},"default":{}}},"required":["projectId"]},"ListAgentRunsResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AgentRun"}},"nextCursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}},"required":["data","nextCursor","hasMore"]},"ResolveAgentRunSuggestionBody":{"type":"object","properties":{"projectId":{"$ref":"#/components/schemas/ProjectId"},"action":{"type":"string","enum":["approve","discard"]},"body":{"type":"string","minLength":1,"maxLength":64000}},"required":["projectId","action"]},"UpdateThreadBody":{"type":"object","properties":{"projectId":{"$ref":"#/components/schemas/ProjectId"},"status":{"$ref":"#/components/schemas/ThreadStatus"},"agentMode":{"$ref":"#/components/schemas/AgentMode"},"tags":{"type":"array","items":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9][a-zA-Z0-9_-]*$"},"maxItems":20},"customFields":{"$ref":"#/components/schemas/ThreadCustomFields"}},"required":["projectId"]},"ListThreadNotesResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ThreadNote"}},"nextCursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}},"required":["data","nextCursor","hasMore"]},"ThreadNote":{"type":"object","properties":{"threadNoteId":{"$ref":"#/components/schemas/ThreadNoteId"},"projectId":{"$ref":"#/components/schemas/ProjectId"},"threadId":{"$ref":"#/components/schemas/ThreadId"},"authorUserId":{"$ref":"#/components/schemas/UserId"},"body":{"type":"string","minLength":1,"maxLength":4000},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["threadNoteId","projectId","threadId","authorUserId","body","createdAt","updatedAt"]},"ThreadNoteId":{"type":"string","pattern":"^note_[A-Za-z0-9_-]+$","description":"Thread note identifier","example":"note_01example"},"CreateThreadNoteBody":{"type":"object","properties":{"projectId":{"$ref":"#/components/schemas/ProjectId"},"body":{"type":"string","minLength":1,"maxLength":4000}},"required":["projectId","body"]},"ListConsoleProjectMembersResponse":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ConsoleProjectMembership"}},"nextCursor":{"type":"string","nullable":true},"hasMore":{"type":"boolean"}},"required":["data","nextCursor","hasMore"]},"ConsoleProjectMembership":{"type":"object","properties":{"projectId":{"$ref":"#/components/schemas/ProjectId"},"userId":{"$ref":"#/components/schemas/UserId"},"role":{"$ref":"#/components/schemas/ConsoleProjectRole"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["projectId","userId","role","createdAt","updatedAt"]},"UpsertConsoleProjectMembershipBody":{"type":"object","properties":{"userId":{"$ref":"#/components/schemas/UserId"},"role":{"$ref":"#/components/schemas/ConsoleProjectRole"}},"required":["userId","role"]},"ConsoleEventStream":{"type":"string"},"ConsoleStreamEvent":{"type":"object","properties":{"eventId":{"type":"string"},"eventName":{"type":"string"},"occurredAt":{"type":"string","format":"date-time"},"projectId":{"$ref":"#/components/schemas/ProjectId"},"data":{"type":"object","additionalProperties":{"nullable":true},"default":{}}},"required":["eventId","eventName","occurredAt","projectId"]},"WhatsappConnectBody":{"type":"object","properties":{"projectId":{"$ref":"#/components/schemas/ProjectId"},"code":{"type":"string","minLength":1,"maxLength":4096},"accessToken":{"type":"string","minLength":1,"maxLength":4096},"metaAppCredentialId":{"$ref":"#/components/schemas/MetaAppCredentialId"},"redirectUri":{"type":"string","format":"uri"},"phoneNumberId":{"type":"string","minLength":1,"maxLength":128},"wabaId":{"type":"string","minLength":1,"maxLength":128}},"required":["projectId"]},"WhatsappReadiness":{"type":"object","properties":{"channelId":{"$ref":"#/components/schemas/ChannelId"},"projectId":{"$ref":"#/components/schemas/ProjectId"},"ok":{"type":"boolean"},"checks":{"type":"array","items":{"$ref":"#/components/schemas/WhatsappReadinessCheck"}}},"required":["channelId","projectId","ok","checks"]},"WhatsappReadinessCheck":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":64},"label":{"type":"string","minLength":1,"maxLength":256},"ok":{"type":"boolean"},"reason":{"type":"string","minLength":1,"maxLength":512}},"required":["id","label","ok"]},"WhatsappTemplate":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":128},"name":{"type":"string","minLength":1,"maxLength":512},"language":{"type":"string","minLength":1,"maxLength":32},"category":{"type":"string","minLength":1,"maxLength":128},"status":{"type":"string","minLength":1,"maxLength":128},"components":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true},"default":{}},"default":[]}},"required":["id","name","language"]},"SendTemplateBody":{"type":"object","properties":{"projectId":{"$ref":"#/components/schemas/ProjectId"},"threadId":{"$ref":"#/components/schemas/ThreadId"},"to":{"type":"string","minLength":3,"maxLength":64},"templateName":{"type":"string","minLength":1,"maxLength":512},"language":{"type":"string","minLength":1,"maxLength":32},"components":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true},"default":{}},"default":[]},"metadata":{"type":"object","additionalProperties":{"nullable":true},"default":{}}},"required":["projectId","threadId","templateName","language"]}},"parameters":{}},"paths":{"/_internal/schemas/event-envelope":{"get":{"responses":{"501":{"description":"Example payload illustrating the outbound stitch/event envelope (`data` varies by `eventName`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroEventEnvelope"}}}}}}},"/studio/auth/signup":{"post":{"tags":["studio-auth"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StudioAuthSignupBody"}}}},"responses":{"200":{"description":"Signed up; sets refresh cookie and returns access token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StudioAuthTokenResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"409":{"description":"Conflict.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"422":{"description":"Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}}}}},"/studio/auth/login":{"post":{"tags":["studio-auth"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StudioAuthLoginBody"}}}},"responses":{"200":{"description":"Login success.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StudioAuthTokenResponse"}}}},"401":{"description":"Authentication failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"422":{"description":"Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}}}}},"/studio/auth/refresh":{"post":{"tags":["studio-auth"],"responses":{"200":{"description":"Rotates refresh cookie; returns new access token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StudioAuthTokenResponse"}}}},"401":{"description":"Authentication failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}}}}},"/studio/auth/logout":{"post":{"tags":["studio-auth"],"responses":{"204":{"description":"Refresh cookie cleared; session tokens revoked when possible."}}}},"/studio/me":{"get":{"tags":["studio-auth"],"security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Current Studio user.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StudioMeResponse"}}}},"401":{"description":"Authentication failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}}}}},"/studio/auth/verify-email":{"post":{"tags":["studio-auth"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyEmailBody"}}}},"responses":{"200":{"description":"Email verified.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthActionAcceptedResponse"}}}},"401":{"description":"Authentication failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}}}}},"/studio/auth/resend-verification":{"post":{"tags":["studio-auth"],"security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Verification email re-sent when the account is not verified yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthActionAcceptedResponse"}}}},"401":{"description":"Authentication failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}}}}},"/studio/auth/forgot-password":{"post":{"tags":["studio-auth"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForgotPasswordBody"}}}},"responses":{"200":{"description":"Accepted regardless of whether the email is registered (does not leak existence).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthActionAcceptedResponse"}}}}}}},"/studio/auth/reset-password":{"post":{"tags":["studio-auth"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResetPasswordBody"}}}},"responses":{"200":{"description":"Password updated; all sessions revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthActionAcceptedResponse"}}}},"401":{"description":"Authentication failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"422":{"description":"Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}}}}},"/workspaces":{"get":{"tags":["workspaces"],"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Workspaces visible to the current Studio user.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListWorkspacesResponse"}}}},"401":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"422":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}}}},"post":{"tags":["workspaces"],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWorkspaceBody"}}}},"responses":{"201":{"description":"Workspace created with a default project and sandbox environment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Workspace"}}}},"401":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"422":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}}}}},"/projects":{"get":{"tags":["projects"],"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":false,"name":"workspaceId","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Projects visible to the current Studio user.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListProjectsResponse"}}}},"401":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"422":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}}}}},"/environments":{"get":{"tags":["environments"],"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":false,"name":"projectId","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Environments visible to the current Studio user.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListEnvironmentsResponse"}}}},"401":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"422":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}}}}},"/workspaces/{workspaceId}/invitations":{"post":{"tags":["workspaces"],"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"$ref":"#/components/schemas/WorkspaceId"},"required":true,"description":"Workspace identifier","name":"workspaceId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateWorkspaceInvitationBody"}}}},"responses":{"201":{"description":"Invitation created and emailed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkspaceInvitation"}}}},"401":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"403":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"404":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"409":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"422":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}}}},"get":{"tags":["workspaces"],"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"$ref":"#/components/schemas/WorkspaceId"},"required":true,"description":"Workspace identifier","name":"workspaceId","in":"path"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Pending and past invitations for the workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListWorkspaceInvitationsResponse"}}}},"401":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"404":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}}}}},"/workspaces/{workspaceId}/invitations/{invitationId}":{"delete":{"tags":["workspaces"],"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"$ref":"#/components/schemas/WorkspaceId"},"required":true,"description":"Workspace identifier","name":"workspaceId","in":"path"},{"schema":{"$ref":"#/components/schemas/WorkspaceInvitationId"},"required":true,"description":"Workspace invitation identifier","name":"invitationId","in":"path"}],"responses":{"204":{"description":"Revoked."},"401":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"404":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}}}}},"/studio/auth/accept-invitation":{"post":{"tags":["studio-auth"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AcceptWorkspaceInvitationBody"}}}},"responses":{"200":{"description":"Invitation accepted; sets refresh cookie and returns access token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StudioAuthTokenResponse"}}}},"401":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"403":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"404":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"422":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}}}}},"/api-keys":{"get":{"tags":["api-keys"],"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"$ref":"#/components/schemas/ProjectId"},"required":true,"description":"Project identifier","name":"projectId","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"API keys for the project (no secrets).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListApiKeysResponse"}}}},"401":{"description":"Unauthorized.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"422":{"description":"Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}}}},"post":{"tags":["api-keys"],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateApiKeyBody"}}}},"responses":{"201":{"description":"Key created; secret returned once.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyCreatedResponse"}}}},"401":{"description":"Unauthorized.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"403":{"description":"Forbidden.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"422":{"description":"Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}}}}},"/api-keys/{apiKeyId}/rotate":{"post":{"tags":["api-keys"],"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"$ref":"#/components/schemas/ApiKeyId"},"required":true,"description":"API key identifier","name":"apiKeyId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RotateApiKeyBody"}}}},"responses":{"200":{"description":"New key issued; old key enters grace period.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyRotatedResponse"}}}},"401":{"description":"Unauthorized.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"422":{"description":"Validation failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}}}}},"/api-keys/{apiKeyId}":{"delete":{"tags":["api-keys"],"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"$ref":"#/components/schemas/ApiKeyId"},"required":true,"description":"API key identifier","name":"apiKeyId","in":"path"}],"responses":{"204":{"description":"Revoked."},"401":{"description":"Unauthorized.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"404":{"description":"Not found.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}}}}},"/meta-apps":{"get":{"tags":["meta-apps"],"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"$ref":"#/components/schemas/WorkspaceId"},"required":true,"description":"Workspace identifier","name":"workspaceId","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Meta app credentials visible to this workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListMetaAppCredentialsResponse"}}}},"401":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"403":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"404":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"422":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}}}},"post":{"tags":["meta-apps"],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateMetaAppCredentialBody"}}}},"responses":{"201":{"description":"Meta app credential created. `verifyToken` is only returned once.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetaAppCredentialCreatedResponse"}}}},"401":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"403":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"404":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"422":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}}}}},"/meta-apps/{metaAppCredentialId}/rotate-secret":{"post":{"tags":["meta-apps"],"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"$ref":"#/components/schemas/MetaAppCredentialId"},"required":true,"description":"Meta app credential identifier","name":"metaAppCredentialId","in":"path"},{"schema":{"type":"string"},"required":true,"name":"workspaceId","in":"query"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RotateMetaAppCredentialBody"}}}},"responses":{"200":{"description":"Meta app secret rotated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetaAppCredential"}}}},"401":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"403":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"404":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"422":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}}}}},"/meta-apps/{metaAppCredentialId}":{"delete":{"tags":["meta-apps"],"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"$ref":"#/components/schemas/MetaAppCredentialId"},"required":true,"description":"Meta app credential identifier","name":"metaAppCredentialId","in":"path"},{"schema":{"type":"string"},"required":true,"name":"workspaceId","in":"query"}],"responses":{"200":{"description":"Meta app credential revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetaAppCredential"}}}},"401":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"403":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"404":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"409":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"422":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}}}}},"/threads":{"get":{"tags":["threads"],"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"$ref":"#/components/schemas/ProjectId"},"required":true,"description":"Project identifier","name":"projectId","in":"query"},{"schema":{"$ref":"#/components/schemas/EnvironmentId"},"required":false,"description":"Environment identifier","name":"environmentId","in":"query"},{"schema":{"$ref":"#/components/schemas/ChannelId"},"required":false,"description":"Channel identifier","name":"channelId","in":"query"},{"schema":{"$ref":"#/components/schemas/ThreadStatus"},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[a-zA-Z0-9][a-zA-Z0-9_-]*$"},"required":false,"name":"tag","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Threads.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListThreadsResponse"}}}},"401":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"403":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"404":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"422":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}}}},"post":{"tags":["threads"],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateThreadBody"}}}},"responses":{"201":{"description":"Thread created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Thread"}}}},"400":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"401":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"403":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"404":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"409":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"422":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}}}}},"/messages":{"get":{"tags":["messages"],"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"$ref":"#/components/schemas/ProjectId"},"required":true,"description":"Project identifier","name":"projectId","in":"query"},{"schema":{"$ref":"#/components/schemas/ThreadId"},"required":false,"description":"Thread identifier","name":"threadId","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Messages.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListMessagesResponse"}}}},"401":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"403":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"404":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"422":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}}}}},"/threads/{threadId}/messages":{"get":{"tags":["messages"],"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"$ref":"#/components/schemas/ThreadId"},"required":true,"description":"Thread identifier","name":"threadId","in":"path"},{"schema":{"$ref":"#/components/schemas/ProjectId"},"required":true,"description":"Project identifier","name":"projectId","in":"query"},{"schema":{"$ref":"#/components/schemas/ThreadId"},"required":false,"description":"Thread identifier","name":"threadId","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Thread messages.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListMessagesResponse"}}}},"401":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"403":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"404":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"422":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}}}},"post":{"tags":["messages"],"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"$ref":"#/components/schemas/ThreadId"},"required":true,"description":"Thread identifier","name":"threadId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateThreadMessageBody"}}}},"responses":{"201":{"description":"Message created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}},"400":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"401":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"403":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"404":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"409":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"422":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}}}}},"/channels":{"get":{"tags":["channels"],"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"$ref":"#/components/schemas/ProjectId"},"required":true,"description":"Project identifier","name":"projectId","in":"query"},{"schema":{"$ref":"#/components/schemas/EnvironmentId"},"required":false,"description":"Environment identifier","name":"environmentId","in":"query"},{"schema":{"$ref":"#/components/schemas/ChannelKind"},"required":false,"name":"kind","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Channels.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListChannelsResponse"}}}},"401":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"403":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"404":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"422":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}}}},"post":{"tags":["channels"],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateChannelBody"}}}},"responses":{"201":{"description":"Channel created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Channel"}}}},"400":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"401":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"403":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"404":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"409":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"422":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}}}}},"/channels/{channelId}/sandbox/inbound":{"post":{"tags":["channels"],"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"$ref":"#/components/schemas/ChannelId"},"required":true,"description":"Channel identifier","name":"channelId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InboundChannelMessageBody"}}}},"responses":{"201":{"description":"Inbound message accepted.","content":{"application/json":{"schema":{"type":"object","properties":{"thread":{"$ref":"#/components/schemas/Thread"},"message":{"$ref":"#/components/schemas/Message"}},"required":["thread","message"]}}}},"400":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"401":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"403":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"404":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"409":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"422":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}}}}},"/channels/{channelId}/custom/inbound":{"post":{"tags":["channels"],"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"$ref":"#/components/schemas/ChannelId"},"required":true,"description":"Channel identifier","name":"channelId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InboundChannelMessageBody"}}}},"responses":{"201":{"description":"Inbound message accepted.","content":{"application/json":{"schema":{"type":"object","properties":{"thread":{"$ref":"#/components/schemas/Thread"},"message":{"$ref":"#/components/schemas/Message"}},"required":["thread","message"]}}}},"400":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"401":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"403":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"404":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"409":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"422":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}}}}},"/channels/{channelId}/commands":{"get":{"tags":["channels"],"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"$ref":"#/components/schemas/ChannelId"},"required":true,"description":"Channel identifier","name":"channelId","in":"path"},{"schema":{"$ref":"#/components/schemas/ProjectId"},"required":true,"description":"Project identifier","name":"projectId","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Channel command/event log.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListChannelCommandsResponse"}}}},"401":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"403":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"404":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"422":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}}}}},"/stitches":{"get":{"tags":["stitches"],"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"$ref":"#/components/schemas/ProjectId"},"required":true,"description":"Project identifier","name":"projectId","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Stitches.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListStitchesResponse"}}}},"401":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"403":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"404":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"422":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}}}},"post":{"tags":["stitches"],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateStitchBody"}}}},"responses":{"201":{"description":"Stitch created; secret returned once.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StitchCreatedResponse"}}}},"400":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"401":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"403":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"404":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"409":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"422":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}}}}},"/stitches/{stitchId}/rotate-secret":{"post":{"tags":["stitches"],"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"$ref":"#/components/schemas/StitchId"},"required":true,"description":"Stitch identifier","name":"stitchId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"projectId":{"$ref":"#/components/schemas/ProjectId"}},"required":["projectId"]}}}},"responses":{"200":{"description":"Stitch secret rotated; secret returned once.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RotateStitchSecretResponse"}}}},"400":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"401":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"403":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"404":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"409":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"422":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}}}}},"/stitches/{stitchId}/deliveries":{"get":{"tags":["stitches"],"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"$ref":"#/components/schemas/StitchId"},"required":true,"description":"Stitch identifier","name":"stitchId","in":"path"},{"schema":{"$ref":"#/components/schemas/ProjectId"},"required":true,"description":"Project identifier","name":"projectId","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Webhook deliveries.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListWebhookDeliveriesResponse"}}}},"401":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"403":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"404":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"422":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}}}}},"/stitches/{stitchId}/deliveries/{deliveryId}/retry":{"post":{"tags":["stitches"],"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"$ref":"#/components/schemas/StitchId"},"required":true,"description":"Stitch identifier","name":"stitchId","in":"path"},{"schema":{"$ref":"#/components/schemas/WebhookDeliveryId"},"required":true,"description":"Webhook delivery identifier","name":"deliveryId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"projectId":{"$ref":"#/components/schemas/ProjectId"}},"required":["projectId"]}}}},"responses":{"200":{"description":"Webhook delivery queued for retry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDelivery"}}}},"400":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"401":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"403":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"404":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"409":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"422":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}}}}},"/byok-credentials":{"get":{"tags":["byok-credentials"],"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"$ref":"#/components/schemas/ProjectId"},"required":true,"description":"Project identifier","name":"projectId","in":"query"},{"schema":{"$ref":"#/components/schemas/LlmProvider"},"required":false,"name":"provider","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"BYOK credentials.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListByokCredentialsResponse"}}}},"401":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"403":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"404":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"422":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}}}},"post":{"tags":["byok-credentials"],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateByokCredentialBody"}}}},"responses":{"201":{"description":"BYOK credential created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ByokCredential"}}}},"401":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"403":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"404":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"422":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}}}}},"/byok-credentials/{byokCredentialId}/rotate":{"post":{"tags":["byok-credentials"],"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"$ref":"#/components/schemas/ByokCredentialId"},"required":true,"description":"BYOK credential identifier","name":"byokCredentialId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RotateByokCredentialBody"}}}},"responses":{"200":{"description":"BYOK credential rotated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ByokCredential"}}}},"401":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"403":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"404":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"422":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}}}}},"/byok-credentials/{byokCredentialId}":{"delete":{"tags":["byok-credentials"],"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"$ref":"#/components/schemas/ByokCredentialId"},"required":true,"description":"BYOK credential identifier","name":"byokCredentialId","in":"path"},{"schema":{"type":"string"},"required":true,"name":"projectId","in":"query"}],"responses":{"200":{"description":"BYOK credential revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ByokCredential"}}}},"401":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"403":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"404":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"422":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}}}}},"/tools":{"get":{"tags":["tools"],"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"$ref":"#/components/schemas/ProjectId"},"required":true,"description":"Project identifier","name":"projectId","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Tools.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListToolsResponse"}}}},"401":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"403":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"404":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"422":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}}}},"post":{"tags":["tools"],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateToolBody"}}}},"responses":{"201":{"description":"Tool created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tool"}}}},"401":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"403":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"404":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"422":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}}}}},"/looms":{"get":{"tags":["looms"],"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"$ref":"#/components/schemas/ProjectId"},"required":true,"description":"Project identifier","name":"projectId","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Looms.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListLoomsResponse"}}}},"401":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"403":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"404":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"422":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}}}},"post":{"tags":["looms"],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateLoomBody"}}}},"responses":{"201":{"description":"Loom created.","content":{"application/json":{"schema":{"type":"object","properties":{"loom":{"$ref":"#/components/schemas/Loom"},"version":{"$ref":"#/components/schemas/LoomVersion"}},"required":["loom","version"]}}}},"401":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"403":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"404":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"422":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}}}}},"/looms/{loomId}/versions":{"post":{"tags":["looms"],"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"$ref":"#/components/schemas/LoomId"},"required":true,"description":"Loom identifier","name":"loomId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateLoomVersionBody"}}}},"responses":{"201":{"description":"Loom version created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoomVersion"}}}},"401":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"403":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"404":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"422":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}}}}},"/looms/{loomId}/activate-version":{"post":{"tags":["looms"],"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"$ref":"#/components/schemas/LoomId"},"required":true,"description":"Loom identifier","name":"loomId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActivateLoomVersionBody"}}}},"responses":{"200":{"description":"Loom version activated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Loom"}}}},"401":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"403":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"404":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"422":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}}}}},"/agents":{"get":{"tags":["agents"],"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"$ref":"#/components/schemas/ProjectId"},"required":true,"description":"Project identifier","name":"projectId","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Agents.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListAgentsResponse"}}}},"401":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"403":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"404":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"422":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}}}},"post":{"tags":["agents"],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAgentBody"}}}},"responses":{"201":{"description":"Agent created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Agent"}}}},"401":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"403":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"404":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"422":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}}}}},"/agents/{agentId}/runs":{"post":{"tags":["agents","agent-runs"],"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"$ref":"#/components/schemas/AgentId"},"required":true,"description":"Agent identifier","name":"agentId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAgentRunBody"}}}},"responses":{"202":{"description":"Agent run queued.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentRun"}}}},"401":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"403":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"404":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"422":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}}}}},"/agent-runs":{"get":{"tags":["agent-runs"],"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"$ref":"#/components/schemas/ProjectId"},"required":true,"description":"Project identifier","name":"projectId","in":"query"},{"schema":{"$ref":"#/components/schemas/ThreadId"},"required":false,"description":"Thread identifier","name":"threadId","in":"query"},{"schema":{"$ref":"#/components/schemas/AgentRunStatus"},"required":false,"name":"status","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Agent runs.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListAgentRunsResponse"}}}},"401":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"403":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"404":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"422":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}}}}},"/agent-runs/{agentRunId}/suggestion":{"post":{"tags":["agent-runs"],"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"$ref":"#/components/schemas/AgentRunId"},"required":true,"description":"Agent run identifier","name":"agentRunId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResolveAgentRunSuggestionBody"}}}},"responses":{"200":{"description":"Suggestion resolved.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentRun"}}}},"401":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"403":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"404":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"409":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"422":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}}}}},"/threads/{threadId}":{"get":{"tags":["console","threads"],"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"$ref":"#/components/schemas/ThreadId"},"required":true,"description":"Thread identifier","name":"threadId","in":"path"},{"schema":{"$ref":"#/components/schemas/ProjectId"},"required":true,"description":"Project identifier","name":"projectId","in":"query"}],"responses":{"200":{"description":"Thread detail for Operator Console.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Thread"}}}},"401":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"403":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"404":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"422":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}}}},"patch":{"tags":["console","threads"],"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"$ref":"#/components/schemas/ThreadId"},"required":true,"description":"Thread identifier","name":"threadId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateThreadBody"}}}},"responses":{"200":{"description":"Updated thread.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Thread"}}}},"401":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"403":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"404":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"422":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}}}}},"/threads/{threadId}/notes":{"get":{"tags":["console"],"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"$ref":"#/components/schemas/ThreadId"},"required":true,"description":"Thread identifier","name":"threadId","in":"path"},{"schema":{"$ref":"#/components/schemas/ProjectId"},"required":true,"description":"Project identifier","name":"projectId","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Internal thread notes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListThreadNotesResponse"}}}},"401":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"403":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"404":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"422":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}}}},"post":{"tags":["console"],"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"$ref":"#/components/schemas/ThreadId"},"required":true,"description":"Thread identifier","name":"threadId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateThreadNoteBody"}}}},"responses":{"201":{"description":"Internal thread note created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ThreadNote"}}}},"401":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"403":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"404":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"422":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}}}}},"/console/projects/{projectId}/members":{"get":{"tags":["console"],"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"$ref":"#/components/schemas/ProjectId"},"required":true,"description":"Project identifier","name":"projectId","in":"path"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Console project members.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListConsoleProjectMembersResponse"}}}},"401":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"403":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"404":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"422":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}}}},"post":{"tags":["console"],"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"$ref":"#/components/schemas/ProjectId"},"required":true,"description":"Project identifier","name":"projectId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpsertConsoleProjectMembershipBody"}}}},"responses":{"200":{"description":"Console project member upserted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsoleProjectMembership"}}}},"401":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"403":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"404":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"422":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}}}}},"/console/projects/{projectId}/members/{userId}":{"delete":{"tags":["console"],"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"$ref":"#/components/schemas/ProjectId"},"required":true,"description":"Project identifier","name":"projectId","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"userId","in":"path"}],"responses":{"204":{"description":"Console project member removed."},"401":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"403":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"404":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"422":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}}}}},"/console/stream":{"get":{"tags":["console"],"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"$ref":"#/components/schemas/ProjectId"},"required":true,"description":"Project identifier","name":"projectId","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0},"required":false,"name":"cursor","in":"query"}],"responses":{"200":{"description":"Server-sent events for Operator Console updates.","content":{"text/event-stream":{"schema":{"$ref":"#/components/schemas/ConsoleEventStream"}},"application/json":{"schema":{"$ref":"#/components/schemas/ConsoleStreamEvent"}}}},"401":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"403":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"404":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"422":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}}}}},"/channels/{channelId}/whatsapp/webhook":{"get":{"tags":["whatsapp"],"parameters":[{"schema":{"$ref":"#/components/schemas/ChannelId"},"required":true,"description":"Channel identifier","name":"channelId","in":"path"},{"schema":{"type":"string"},"required":false,"name":"hub.mode","in":"query"},{"schema":{"type":"string"},"required":false,"name":"hub.verify_token","in":"query"},{"schema":{"type":"string"},"required":false,"name":"hub.challenge","in":"query"}],"responses":{"200":{"description":"Meta webhook challenge.","content":{"text/plain":{"schema":{"type":"string"}}}},"401":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"404":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"422":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}}}},"post":{"tags":["whatsapp"],"parameters":[{"schema":{"$ref":"#/components/schemas/ChannelId"},"required":true,"description":"Channel identifier","name":"channelId","in":"path"}],"responses":{"200":{"description":"Webhook accepted.","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}}}},"401":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"404":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"409":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"422":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}}}}},"/channels/{channelId}/whatsapp/connect":{"post":{"tags":["whatsapp"],"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"$ref":"#/components/schemas/ChannelId"},"required":true,"description":"Channel identifier","name":"channelId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsappConnectBody"}}}},"responses":{"200":{"description":"WhatsApp channel connected.","content":{"application/json":{"schema":{"type":"object","properties":{"channelId":{"$ref":"#/components/schemas/ChannelId"},"projectId":{"$ref":"#/components/schemas/ProjectId"},"wabaId":{"type":"string"},"phoneNumberId":{"type":"string"},"verifiedAt":{"type":"string"}},"required":["channelId","projectId","wabaId","phoneNumberId","verifiedAt"]}}}},"401":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"403":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"404":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"422":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}}}}},"/channels/{channelId}/whatsapp/readiness":{"get":{"tags":["whatsapp"],"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"$ref":"#/components/schemas/ChannelId"},"required":true,"description":"Channel identifier","name":"channelId","in":"path"},{"schema":{"$ref":"#/components/schemas/ProjectId"},"required":true,"description":"Project identifier","name":"projectId","in":"query"}],"responses":{"200":{"description":"WhatsApp readiness.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsappReadiness"}}}},"401":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"403":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"404":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"422":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}}}}},"/channels/{channelId}/whatsapp/templates":{"get":{"tags":["whatsapp"],"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"$ref":"#/components/schemas/ChannelId"},"required":true,"description":"Channel identifier","name":"channelId","in":"path"},{"schema":{"$ref":"#/components/schemas/ProjectId"},"required":true,"description":"Project identifier","name":"projectId","in":"query"}],"responses":{"200":{"description":"WhatsApp templates.","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/WhatsappTemplate"}}}}},"401":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"403":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"404":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"422":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}}}}},"/channels/{channelId}/whatsapp/templates/send":{"post":{"tags":["whatsapp"],"security":[{"BearerAuth":[]}],"parameters":[{"schema":{"$ref":"#/components/schemas/ChannelId"},"required":true,"description":"Channel identifier","name":"channelId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendTemplateBody"}}}},"responses":{"201":{"description":"Template send queued.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}},"401":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"403":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"404":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}},"422":{"description":"Tsuzuro error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TsuzuroErrorResponse"}}}}}}}}}