{"openapi":"3.1.0","info":{"title":"Rork API","version":"1.0.0","description":"Versioned REST API for Rork native clients."},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}},"schemas":{"ProjectListResponse":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/ProjectListItem"}},"nextCursor":{"type":["string","null"]}},"required":["items","nextCursor"]},"ProjectListItem":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":["string","null"]},"slug":{"type":"string"},"framework":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"editedAt":{"type":"string","format":"date-time"},"isOwner":{"type":"boolean"},"isFavorite":{"type":"boolean"},"screenshotUrl":{"type":"string"},"appIconUrl":{"type":"string"},"appIcons":{"$ref":"#/components/schemas/ProjectAppIcons"},"appMetadata":{"$ref":"#/components/schemas/ProjectAppMetadata"}},"required":["id","title","slug","framework","createdAt","editedAt","isOwner","isFavorite","appMetadata"]},"ProjectAppIcons":{"type":"object","properties":{"ios":{"$ref":"#/components/schemas/ProjectAppIcon"}}},"ProjectAppIcon":{"type":"object","properties":{"url":{"type":"string"},"path":{"type":"string"},"source":{"type":"string","description":"Icon origin, currently \"snapshot\" or \"git\"."},"snapshotId":{"type":"string"}},"required":["url","path","source"]},"ProjectAppMetadata":{"type":["object","null"],"properties":{"ref":{"type":"string","description":"Tip commit sha of the project's default ref."},"snapshotId":{"type":["string","null"]},"apps":{"type":["array","null"],"items":{"type":"object","properties":{"name":{"type":"string"},"path":{"type":"string"},"framework":{"type":"string"},"sourceHash":{"type":"string"}},"required":["name","path","framework"]}}},"required":["ref","snapshotId","apps"]},"ApiError":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","example":"FORBIDDEN"},"message":{"type":"string"}},"required":["code","message"]}},"required":["error"]},"CreateProjectResponse":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]},"CreateProjectRequest":{"type":"object","properties":{"prompt":{"type":"string","minLength":1},"attachments":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"url":{"type":"string"},"contentType":{"type":"string","minLength":1},"thumbnailUrl":{"type":"string"}},"required":["url","contentType"]}},"isPrivate":{"type":"boolean","default":true},"isMobile":{"type":"boolean","default":false},"planMode":{"type":"boolean"},"framework":{"type":"string","description":"Creation framework: \"swift\", \"kotlin\", or \"web\". Defaults to \"web\". Expo/React Native is retired."},"preferredModel":{"type":"string","description":"Model name from the allowed backend model list."}},"required":["prompt"]},"Project":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":["string","null"]},"slug":{"type":"string"},"framework":{"type":["string","null"]},"createdAt":{"type":"string","format":"date-time"},"editedAt":{"type":"string","format":"date-time"},"isFavorite":{"type":"boolean"},"creatorEmail":{"type":["string","null"]},"hasCloneJob":{"type":"boolean"},"supportedDevices":{"type":["array","null"],"items":{"type":"string"}},"platformAppVersions":{"type":["object","null"],"additionalProperties":{"type":"string"}},"appMetadata":{"$ref":"#/components/schemas/ProjectAppMetadata"},"gitAuth":{"$ref":"#/components/schemas/ProjectGitAuth"}},"required":["id","title","slug","framework","createdAt","editedAt","isFavorite","creatorEmail","hasCloneJob","supportedDevices","platformAppVersions","appMetadata","gitAuth"]},"ProjectGitAuth":{"type":"object","properties":{"token":{"type":"string"},"defaultUserId":{"type":"string"}},"required":["token","defaultUserId"]},"ProjectAccessLevelResponse":{"type":"object","properties":{"accessLevel":{"$ref":"#/components/schemas/AccessLevel"}},"required":["accessLevel"]},"AccessLevel":{"type":"string","enum":["owner","editor","viewer"]},"ProjectAppIconsResponse":{"type":"object","properties":{"appIconsByProjectId":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/ProjectAppIcons"}}},"required":["appIconsByProjectId"]},"ProjectAppIconsRequest":{"type":"object","properties":{"projectIds":{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":100}},"required":["projectIds"]},"UserProfile":{"type":"object","properties":{"isSubscribed":{"type":"boolean"},"subscriptionStatus":{"type":["string","null"]},"subscriptionPriceId":{"type":["string","null"]},"rcSubProductName":{"type":["string","null"]},"currentPeriodEnd":{"type":["string","null"],"format":"date-time"},"cancelAtPeriodEnd":{"type":["boolean","null"]},"totalMessageCount":{"type":"integer"}},"required":["isSubscribed","subscriptionStatus","subscriptionPriceId","rcSubProductName","currentPeriodEnd","cancelAtPeriodEnd","totalMessageCount"]},"UserPermissions":{"type":"object","properties":{"isAdmin":{"type":"boolean"}},"required":["isAdmin"]}},"parameters":{}},"paths":{"/api/v1/projects":{"get":{"operationId":"listProjects","summary":"List projects accessible to the authenticated user","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","enum":["all","owned","shared","favorites"],"default":"all"},"required":false,"name":"filter","in":"query"},{"schema":{"type":"string"},"required":false,"name":"search","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":"Paginated project list","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectListResponse"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"post":{"operationId":"createProject","summary":"Create a project from a prompt","security":[{"bearerAuth":[]}],"requestBody":{"description":"Project creation input","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateProjectRequest"}}}},"responses":{"200":{"description":"Created project id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateProjectResponse"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/projects/{projectId}":{"get":{"operationId":"getProject","summary":"Get a project by id","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"projectId","in":"path"}],"responses":{"200":{"description":"Project detail","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Project"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/projects/{projectId}/access-level":{"get":{"operationId":"getProjectAccessLevel","summary":"Get the caller's access level for a project","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"projectId","in":"path"}],"responses":{"200":{"description":"Access level","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectAccessLevelResponse"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/projects/app-icons":{"post":{"operationId":"listProjectAppIcons","summary":"Resolve app icons for a set of projects","security":[{"bearerAuth":[]}],"requestBody":{"description":"Project ids","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectAppIconsRequest"}}}},"responses":{"200":{"description":"Icons keyed by project id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectAppIconsResponse"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/user/profile":{"get":{"operationId":"getUserProfile","summary":"Get the authenticated user's subscription profile","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"User profile","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserProfile"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/user/permissions":{"get":{"operationId":"getUserPermissions","summary":"Get the authenticated user's permissions","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"User permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserPermissions"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing or invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Insufficient access","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Internal error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}}},"webhooks":{}}