### Install Sleek Agent Skills Interactively Source: https://github.com/sleekdotdesign/agent-skills/blob/main/README.md Use this command to browse and install skills interactively. Ensure you have Node.js and npm installed. ```bash npx skills add sleekdotdesign/agent-skills ``` -------------------------------- ### Install Specific Sleek Agent Skill Source: https://github.com/sleekdotdesign/agent-skills/blob/main/README.md Use this command to install a specific skill, such as 'sleek-design-mobile-apps', directly. Requires Node.js and npm. ```bash npx skills add sleekdotdesign/agent-skills -s sleek-design-mobile-apps ``` -------------------------------- ### Get or Delete Project with Sleek API Source: https://github.com/sleekdotdesign/agent-skills/blob/main/skills/design-mobile-apps/SKILL.md Use these endpoints to retrieve details of a specific project or delete it. Requires `projects:read` for GET and `projects:write` for DELETE. DELETE returns `204 No Content` on success. ```http GET /api/v1/projects/:projectId DELETE /api/v1/projects/:projectId → 204 No Content ``` -------------------------------- ### Get Component Source: https://github.com/sleekdotdesign/agent-skills/blob/main/skills/design-mobile-apps/SKILL.md Retrieves details of a specific component within a project. Project ID and Component ID are required. ```APIDOC ## Get Component ### Description Retrieves details of a specific component within a project. Project ID and Component ID are required. ### Method GET ### Endpoint /api/v1/projects/:id/components/:componentId ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the project. - **componentId** (string) - Required - The unique identifier of the component. ### Scope `components:read` ``` -------------------------------- ### Get / Delete Project Source: https://github.com/sleekdotdesign/agent-skills/blob/main/skills/design-mobile-apps/SKILL.md Retrieves details of a specific project or deletes it. Project ID is required. ```APIDOC ## Get / Delete Project ### Description Retrieves details of a specific project or deletes it. Project ID is required. ### Method GET, DELETE ### Endpoint /api/v1/projects/:projectId ### Parameters #### Path Parameters - **projectId** (string) - Required - The unique identifier of the project. ### Response #### Success Response (200 for GET) Returns the project object details. #### Success Response (204 for DELETE) No Content. Indicates the project was successfully deleted. ``` -------------------------------- ### Get Component Source: https://github.com/sleekdotdesign/agent-skills/blob/main/skills/design-mobile-apps/SKILL.md Fetches a single component by its ID. Useful for retrieving the code of a specific screen. ```APIDOC ## GET /api/v1/projects/:projectId/components/:componentId ### Description Fetches a single component by its ID. This is useful when you need the code for a specific screen, for example, after a chat run returns a `componentId`. ### Method GET ### Endpoint /api/v1/projects/:projectId/components/:componentId ### Response #### Success Response (200) - **data** (object) - The component object, with the same shape as a single item from the list endpoint. - **id** (string) - The unique identifier of the component. - **name** (string) - The name of the component. - **activeVersion** (integer) - The ID of the active version. - **versions** (array) - An array of version objects. - **createdAt** (string) - Timestamp of creation. - **updatedAt** (string) - Timestamp of last update. #### Response Example ```json { "data": { "id": "cmp_xyz", "name": "Hero Section", "activeVersion": 3, "versions": [{ "id": "ver_001", "version": 1, "code": "...", "createdAt": "..." }], "createdAt": "...", "updatedAt": "..." } } ``` ``` -------------------------------- ### Get Single Project Component Source: https://github.com/sleekdotdesign/agent-skills/blob/main/skills/design-mobile-apps/SKILL.md Fetches a specific component by its ID. This is useful when you need the code for a particular screen, such as after a chat operation returns a `componentId`. ```http GET /api/v1/projects/:projectId/components/:componentId Authorization: Bearer $SLEEK_API_KEY ``` -------------------------------- ### List Projects with Sleek API Source: https://github.com/sleekdotdesign/agent-skills/blob/main/skills/design-mobile-apps/SKILL.md Use this endpoint to list existing projects. Supports pagination with limit and offset parameters. Requires `projects:read` scope. ```http GET /api/v1/projects?limit=50&offset=0 Authorization: Bearer $SLEEK_API_KEY ``` ```json { "data": [ { "id": "proj_abc", "name": "My App", "slug": "my-app", "createdAt": "2026-01-01T00:00:00Z", "updatedAt": "..." } ], "pagination": { "total": 12, "limit": 50, "offset": 0 } } ``` -------------------------------- ### Create Project Source: https://github.com/sleekdotdesign/agent-skills/blob/main/skills/design-mobile-apps/SKILL.md Creates a new project with a specified name. Each project has its own theme, style, and design system. ```APIDOC ## POST /api/v1/projects ### Description Creates a new project. ### Method POST ### Endpoint /api/v1/projects ### Request Body - **name** (string) - Required - The name of the project. ### Request Example ```json { "name": "My Awesome App" } ``` ### Response #### Success Response (200) - **projectId** (string) - The ID of the newly created project. ``` -------------------------------- ### Create Project with Sleek API Source: https://github.com/sleekdotdesign/agent-skills/blob/main/skills/design-mobile-apps/SKILL.md Use this endpoint to create a new mobile app project. Requires `projects:write` scope. The response includes the newly created project's details. ```http POST /api/v1/projects Authorization: Bearer $SLEEK_API_KEY Content-Type: application/json { "name": "My New App" } ``` ```json { "id": "proj_xyz", "name": "My New App", "slug": "my-new-app", "createdAt": "2026-01-01T00:00:00Z", "updatedAt": "..." } ``` -------------------------------- ### Create a New Project Source: https://github.com/sleekdotdesign/agent-skills/blob/main/skills/design-mobile-apps/SKILL.md Initiate a new project using this API endpoint. Projects manage themes, styles, and design systems. If multiple design variations are needed, create a separate project for each. ```http POST /api/v1/projects ``` -------------------------------- ### Paginate Project List Source: https://github.com/sleekdotdesign/agent-skills/blob/main/skills/design-mobile-apps/SKILL.md Use `limit` and `offset` query parameters to paginate through lists of projects. The response includes total count for full pagination. ```http GET /api/v1/projects?limit=10&offset=20 ``` -------------------------------- ### Create Project Source: https://github.com/sleekdotdesign/agent-skills/blob/main/skills/design-mobile-apps/SKILL.md Creates a new mobile app project. Requires a project name. ```APIDOC ## Create Project ### Description Creates a new mobile app project. Requires a project name. ### Method POST ### Endpoint /api/v1/projects ### Request Body - **name** (string) - Required - The name for the new project. ### Request Example ```http POST /api/v1/projects Authorization: Bearer $SLEEK_API_KEY Content-Type: application/json { "name": "My New App" } ``` ### Response #### Success Response (201) Returns the newly created project object, with the same shape as a single project returned by the 'Get project' endpoint. ``` -------------------------------- ### List Project Components Source: https://github.com/sleekdotdesign/agent-skills/blob/main/skills/design-mobile-apps/SKILL.md Use this endpoint to retrieve a list of components within a project. Supports pagination and an optional `inlineIcons` parameter to control icon rendering. ```http GET /api/v1/projects/:projectId/components?limit=50&offset=0 Authorization: Bearer $SLEEK_API_KEY ``` -------------------------------- ### List Components Source: https://github.com/sleekdotdesign/agent-skills/blob/main/skills/design-mobile-apps/SKILL.md Retrieves a list of components within a project. Supports pagination and an option to inline icons. ```APIDOC ## GET /api/v1/projects/:projectId/components?limit=50&offset=0 ### Description Retrieves a list of components for a given project. Supports pagination with `limit` and `offset` query parameters. An optional `inlineIcons` query parameter can be used to get self-contained SVGs. ### Method GET ### Endpoint /api/v1/projects/:projectId/components #### Query Parameters - **limit** (integer) - Optional - The maximum number of components to return. - **offset** (integer) - Optional - The number of components to skip. - **inlineIcons** (boolean) - Optional - If true, returns icons as self-contained SVGs. Defaults to false. ### Request Example ```http GET /api/v1/projects/proj_abc/components?limit=10&offset=0&inlineIcons=true Authorization: Bearer $SLEEK_API_KEY ``` ### Response #### Success Response (200) - **data** (array) - An array of component objects. - **id** (string) - The unique identifier of the component. - **name** (string) - The name of the component. - **activeVersion** (integer) - The ID of the active version. - **versions** (array) - An array of version objects. - **createdAt** (string) - Timestamp of creation. - **updatedAt** (string) - Timestamp of last update. - **pagination** (object) - Pagination details. - **total** (integer) - Total number of components. - **limit** (integer) - The limit used for pagination. - **offset** (integer) - The offset used for pagination. #### Response Example ```json { "data": [ { "id": "cmp_xyz", "name": "Hero Section", "activeVersion": 3, "versions": [{ "id": "ver_001", "version": 1, "code": "...", "createdAt": "..." }], "createdAt": "...", "updatedAt": "..." } ], "pagination": { "total": 5, "limit": 50, "offset": 0 } } ``` ``` -------------------------------- ### List Components Source: https://github.com/sleekdotdesign/agent-skills/blob/main/skills/design-mobile-apps/SKILL.md Retrieves a list of all components within a specific project. Project ID is required. ```APIDOC ## List Components ### Description Retrieves a list of all components within a specific project. Project ID is required. ### Method GET ### Endpoint /api/v1/projects/:id/components ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the project. ### Scope `components:read` ``` -------------------------------- ### Create Screenshot Source: https://github.com/sleekdotdesign/agent-skills/blob/main/skills/design-mobile-apps/SKILL.md Takes a snapshot of one or more rendered components. Supports various image formats and customization options for padding, scale, and background. ```APIDOC ## POST /api/v1/screenshots ### Description Takes a snapshot of one or more rendered components. ### Method POST ### Endpoint /api/v1/screenshots ### Request Body - **componentIds** (array[string]) - Required - IDs of the components to capture. - **projectId** (string) - Required - The ID of the project. - **format** (string) - Optional - Image format (`png` or `webp`). Defaults to `png`. - **scale** (integer) - Optional - Device pixel ratio (1-3). Defaults to `2`. - **gap** (integer) - Optional - Pixels between components. Defaults to `40`. - **padding** (integer) - Optional - Uniform padding on all sides. Defaults to `40`. - **paddingX** (integer) - Optional - Horizontal padding; overrides `padding`. - **paddingY** (integer) - Optional - Vertical padding; overrides `padding`. - **paddingTop** (integer) - Optional - Top padding; overrides `paddingY`. - **paddingRight** (integer) - Optional - Right padding; overrides `paddingX`. - **paddingBottom** (integer) - Optional - Bottom padding; overrides `paddingY`. - **paddingLeft** (integer) - Optional - Left padding; overrides `paddingX`. - **background** (string) - Optional - Any CSS color (hex, named, `transparent`). Defaults to `transparent`. - **showDots** (boolean) - Optional - Overlay a subtle dot grid on the background. Defaults to `false`. - **radius** (integer) - Optional - Squircle corner radius per component in pixels (integer ≥ 0). Defaults to `48`. ### Request Example ```json { "componentIds": ["cmp_xyz", "cmp_abc"], "projectId": "proj_abc", "format": "png", "scale": 2, "gap": 40, "padding": 40, "background": "transparent" } ``` ### Response #### Success Response (200) Raw binary image (`image/png` or `image/webp`) with `Content-Disposition: attachment` header. ``` -------------------------------- ### List Projects Source: https://github.com/sleekdotdesign/agent-skills/blob/main/skills/design-mobile-apps/SKILL.md Retrieves a list of all projects associated with your account. Supports pagination with limit and offset parameters. ```APIDOC ## List Projects ### Description Retrieves a list of all projects associated with your account. Supports pagination with limit and offset parameters. ### Method GET ### Endpoint /api/v1/projects ### Query Parameters - **limit** (integer) - Optional - The maximum number of projects to return. - **offset** (integer) - Optional - The number of projects to skip before starting to collect the result set. ### Request Example ```http GET /api/v1/projects?limit=50&offset=0 Authorization: Bearer $SLEEK_API_KEY ``` ### Response #### Success Response (200) - **data** (array) - An array of project objects. - **id** (string) - The unique identifier for the project. - **name** (string) - The name of the project. - **slug** (string) - A URL-friendly version of the project name. - **createdAt** (string) - The timestamp when the project was created. - **updatedAt** (string) - The timestamp when the project was last updated. - **pagination** (object) - Pagination details. - **total** (integer) - The total number of projects available. - **limit** (integer) - The limit used for the current request. - **offset** (integer) - The offset used for the current request. #### Response Example ```json { "data": [ { "id": "proj_abc", "name": "My App", "slug": "my-app", "createdAt": "2026-01-01T00:00:00Z", "updatedAt": "..." } ], "pagination": { "total": 12, "limit": 50, "offset": 0 } } ``` ``` -------------------------------- ### Take Screenshots of Components Source: https://github.com/sleekdotdesign/agent-skills/blob/main/skills/design-mobile-apps/SKILL.md Use this endpoint to capture images of specified components. You can customize the output format, scale, padding, and background. Ensure your API key is valid and included in the Authorization header. ```http POST /api/v1/screenshots Authorization: Bearer $SLEEK_API_KEY Content-Type: application/json { "componentIds": ["cmp_xyz", "cmp_abc"], "projectId": "proj_abc", "format": "png", "scale": 2, "gap": 40, "padding": 40, "background": "transparent" } ``` -------------------------------- ### Render Screenshot Source: https://github.com/sleekdotdesign/agent-skills/blob/main/skills/design-mobile-apps/SKILL.md Renders a screenshot of a component or screen within a project. Requires a project ID and component ID. ```APIDOC ## Render Screenshot ### Description Renders a screenshot of a component or screen within a project. Requires a project ID and component ID. ### Method POST ### Endpoint /api/v1/screenshots ### Scope `screenshots` ``` -------------------------------- ### Create Screenshots Source: https://github.com/sleekdotdesign/agent-skills/blob/main/skills/design-mobile-apps/SKILL.md Generates screenshots of the designed screens. This is crucial for user verification after design operations. ```APIDOC ## POST /api/v1/screenshots ### Description Creates screenshots for the designed screens. This endpoint should be called after a chat run that results in `screen_created` or `screen_updated` operations to provide visual feedback to the user. ### Method POST ### Endpoint /api/v1/screenshots ### Request Body - **projectId** (string) - Required - The ID of the project for which to generate screenshots. - **screenIds** (array of strings) - Required - A list of screen IDs for which to generate screenshots. If empty, screenshots for all screens in the project will be generated. - **background** (string) - Optional - The background color for the screenshots. Defaults to 'transparent'. ### Response #### Success Response (200) - **screenshots** (array of objects) - A list of generated screenshots. - **screenId** (string) - The ID of the screen the screenshot belongs to. - **imageUrl** (string) - The URL of the generated screenshot. - **type** (string) - The type of screenshot ('single' or 'combined'). ``` -------------------------------- ### List Projects Source: https://github.com/sleekdotdesign/agent-skills/blob/main/skills/design-mobile-apps/SKILL.md Retrieves a list of projects with optional pagination. Used for managing and accessing different design projects. ```APIDOC ## GET /api/v1/projects ### Description Retrieves a list of projects. Supports pagination to manage large numbers of projects. ### Method GET ### Endpoint /api/v1/projects #### Query Parameters - **limit** (integer) - Optional - The maximum number of projects to return (1-100, default 50). - **offset** (integer) - Optional - The number of projects to skip (>=0). ### Response #### Success Response (200) - **projects** (array of objects) - A list of projects. - **pagination** (object) - **total** (integer) - The total number of projects available. ``` -------------------------------- ### Send Chat Message to Project Source: https://github.com/sleekdotdesign/agent-skills/blob/main/skills/design-mobile-apps/SKILL.md Send a natural language message to a project's chat. The AI interprets the intent and decides on screens. Use `?wait=true` for a blocking call, otherwise, poll for completion. ```http POST /api/v1/projects/:id/chat/messages ``` -------------------------------- ### Generate Screenshots for Project Screens Source: https://github.com/sleekdotdesign/agent-skills/blob/main/skills/design-mobile-apps/SKILL.md After a chat run that modifies screens, always generate screenshots. This endpoint is used to capture the visual state of screens. ```http POST /api/v1/screenshots ``` -------------------------------- ### Fetch Icon SVG from Iconify API Source: https://github.com/sleekdotdesign/agent-skills/blob/main/skills/design-mobile-apps/SKILL.md When implementing icons in native frameworks and a project-specific icon system is not available, fetch SVGs directly from the Iconify API using the provided prefix and name. ```http GET https://api.iconify.design/{prefix}/{name}.svg ``` ```http https://api.iconify.design/solar/heart-bold.svg ``` -------------------------------- ### Send Chat Message for Design Source: https://github.com/sleekdotdesign/agent-skills/blob/main/skills/design-mobile-apps/SKILL.md The core endpoint for AI-driven design. Describe desired changes in `message.text`. Supports optional `imageUrls` for context and `target.screenId` to specify a screen for editing. ```http POST /api/v1/projects/:projectId/chat/messages?wait=false Authorization: Bearer $SLEEK_API_KEY Content-Type: application/json idempotency-key: { "message": { "text": "Add a pricing section with three tiers" }, "imageUrls": ["https://example.com/ref.png"], "target": { "screenId": "scr_abc" } } ``` -------------------------------- ### Fetch Component HTML Code Source: https://github.com/sleekdotdesign/agent-skills/blob/main/skills/design-mobile-apps/SKILL.md Retrieves the HTML code for a specific component. This is used when users want to implement the designs in code. ```APIDOC ## GET /api/v1/projects/:id/components/:componentId ### Description Fetches the HTML code for a specific component. This is essential for implementing designs in native frameworks or for generating HTML prototypes. ### Method GET ### Endpoint /api/v1/projects/:id/components/:componentId ### Response #### Success Response (200) - **code** (string) - The HTML code of the component. This is a complete HTML document. - **componentId** (string) - The ID of the component. ``` -------------------------------- ### Send Message to Chat Source: https://github.com/sleekdotdesign/agent-skills/blob/main/skills/design-mobile-apps/SKILL.md Sends a message to the AI to create or modify screens. Supports synchronous and asynchronous responses. ```APIDOC ## POST /api/v1/projects/:projectId/chat/messages?wait=false ### Description This is the core chat action. Describe what you want in `message.text`, and the AI will create or modify screens. Supports asynchronous (default) and synchronous response modes. ### Method POST ### Endpoint /api/v1/projects/:projectId/chat/messages #### Query Parameters - **wait** (boolean) - Optional - If true, enables sync wait mode. Defaults to false. #### Headers - **Authorization** (string) - Required - Bearer token for authentication. - **Content-Type** (string) - Required - Must be `application/json`. - **idempotency-key** (string) - Optional - Max 255 characters. Used for replay-safe re-sends. #### Request Body - **message** (object) - Required - The message content. - **text** (string) - Required - The user's message describing the desired changes (1+ chars, trimmed). - **imageUrls** (array) - Optional - An array of HTTPS URLs for visual context. - **target** (object) - Optional - Specifies a target for the AI's operations. - **screenId** (string) - Optional - The `screenId` of a specific screen to edit. Omit to let the AI decide. ### Request Example ```json { "message": { "text": "Add a pricing section with three tiers" }, "imageUrls": ["https://example.com/ref.png"], "target": { "screenId": "scr_abc" } } ``` ### Response #### Response - async (default, `wait=false`) Status `202 Accepted`. `result` and `error` are absent until the run reaches a terminal state. ```json { "data": { "runId": "run_111", "status": "queued", "statusUrl": "/api/v1/projects/proj_abc/chat/runs/run_111" } } ``` #### Response - sync (`wait=true`) Blocks up to 300 seconds. Returns `200` when completed, `202` if timed out. ```json { "data": { "runId": "run_111", "status": "completed", "statusUrl": "...", "result": { "assistantText": "I added a pricing section with...", "operations": [ { "type": "screen_created", "screenId": "scr_xyz", "screenName": "Pricing", "componentId": "cmp_xyz" }, { "type": "screen_updated", "screenId": "scr_abc", "componentId": "cmp_abc" }, { "type": "theme_updated" } ] } } } ``` ``` -------------------------------- ### Send Chat Message Source: https://github.com/sleekdotdesign/agent-skills/blob/main/skills/design-mobile-apps/SKILL.md Send a natural language prompt to generate or modify app designs. The AI interprets the user's intent and creates or updates screens. Results are asynchronous by default, requiring polling for completion. ```APIDOC ## POST /api/v1/projects/:id/chat/messages ### Description Sends a chat message to the AI to generate or modify app designs. The AI interprets natural language and can create or update screens. Results are asynchronous. ### Method POST ### Endpoint /api/v1/projects/:id/chat/messages #### Query Parameters - **wait** (boolean) - Optional - If true, the call is blocking and waits for completion (up to 300s), otherwise it returns immediately with a `runId` for polling. #### Headers - **idempotency-key** (string) - Optional - Used for replay-safe re-sends to ensure operations are not duplicated. ### Request Body - **message** (string) - Required - The user's natural language prompt. - **target** (object) - Optional - Specifies a target for the changes. - **screenId** (string) - Required if target is provided - The ID of the screen to direct changes to. ### Response #### Success Response (200 or 202) - **runId** (string) - The ID of the asynchronous run. Used for polling. #### Error Response (409 CONFLICT) - Indicates that another run is already in progress for the project. Wait for the current run to complete before sending a new message. ``` -------------------------------- ### Chat Run Status - Queued/Running Source: https://github.com/sleekdotdesign/agent-skills/blob/main/skills/design-mobile-apps/SKILL.md Response indicating the current status of a chat run, such as 'queued' or 'running'. ```json { "data": { "runId": "run_111", "status": "queued", "statusUrl": "..." } } ``` -------------------------------- ### Chat Run Status - Completed Source: https://github.com/sleekdotdesign/agent-skills/blob/main/skills/design-mobile-apps/SKILL.md Response indicating a chat run has successfully completed. Includes the `result` object with assistant output and performed operations. ```json { "data": { "runId": "run_111", "status": "completed", "statusUrl": "...", "result": { "assistantText": "...", "operations": [...] } } } ``` -------------------------------- ### Fetch Component HTML Code Source: https://github.com/sleekdotdesign/agent-skills/blob/main/skills/design-mobile-apps/SKILL.md Retrieve the HTML code for a specific component. This is essential for implementing designs in native frameworks, providing structure, styling, and content. ```http GET /api/v1/projects/:id/components/:componentId ``` -------------------------------- ### Chat Run Status - Failed Source: https://github.com/sleekdotdesign/agent-skills/blob/main/skills/design-mobile-apps/SKILL.md Response indicating a chat run has failed. Includes the `error` object with details about the failure. ```json { "data": { "runId": "run_111", "status": "failed", "statusUrl": "...", "error": { "code": "execution_failed", "message": "..." } } } ``` -------------------------------- ### Send Chat Message Source: https://github.com/sleekdotdesign/agent-skills/blob/main/skills/design-mobile-apps/SKILL.md Sends a message to the chat interface for a specific project. Used for design-related queries or instructions. Project ID is required. ```APIDOC ## Send Chat Message ### Description Sends a message to the chat interface for a specific project. Used for design-related queries or instructions. Project ID is required. ### Method POST ### Endpoint /api/v1/projects/:id/chat/messages ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the project. ### Scope `chats:write` ``` -------------------------------- ### Sync Chat Send Response Source: https://github.com/sleekdotdesign/agent-skills/blob/main/skills/design-mobile-apps/SKILL.md Response for a synchronous chat message request. Returns `200` upon completion or `202` if timed out. Includes `result` with assistant output and operations performed. ```json { "data": { "runId": "run_111", "status": "completed", "statusUrl": "...", "result": { "assistantText": "I added a pricing section with...", "operations": [ { "type": "screen_created", "screenId": "scr_xyz", "screenName": "Pricing", "componentId": "cmp_xyz" }, { "type": "screen_updated", "screenId": "scr_abc", "componentId": "cmp_abc" }, { "type": "theme_updated" } ] } } } ``` -------------------------------- ### Poll Chat Run Completion Source: https://github.com/sleekdotdesign/agent-skills/blob/main/skills/design-mobile-apps/SKILL.md Poll for the completion of an asynchronous chat run using the provided `runId`. Implement exponential backoff for polling intervals. ```http GET /api/v1/projects/:id/chat/runs/:runId ``` -------------------------------- ### Common API Error Responses Source: https://github.com/sleekdotdesign/agent-skills/blob/main/skills/design-mobile-apps/SKILL.md Understand the structure of error responses from the Sleek API. These JSON objects indicate the type of error and provide a message. Common HTTP status codes are mapped to specific error codes. ```json { "code": "UNAUTHORIZED", "message": "..." } ``` -------------------------------- ### Poll Chat Run Completion Source: https://github.com/sleekdotdesign/agent-skills/blob/main/skills/design-mobile-apps/SKILL.md Polls for the completion status of an asynchronous chat message run. Use the `runId` obtained from the initial POST request. ```APIDOC ## GET /api/v1/projects/:id/chat/runs/:runId ### Description Polls for the completion status of an asynchronous chat run. This endpoint is used to track the progress and retrieve the results of a design generation or modification task. ### Method GET ### Endpoint /api/v1/projects/:id/chat/runs/:runId ### Response #### Success Response (200) - **status** (string) - The current status of the run (e.g., 'pending', 'running', 'completed', 'failed'). - **result** (object) - The result of the run, which may contain operations like `screen_created` or `screen_updated`. - **operations** (array) - A list of operations performed during the run, including component IDs. #### Response Example (Completed) { "status": "completed", "result": { "operations": [ { "type": "screen_created", "screenId": "screen-123", "componentId": "comp-abc" } ] } } ``` -------------------------------- ### Chat Run-Level Error Codes Source: https://github.com/sleekdotdesign/agent-skills/blob/main/skills/design-mobile-apps/SKILL.md These error codes appear within the `data.error` field for chat run-level issues. They indicate problems such as insufficient credits or execution failures. ```json { "code": "out_of_credits", "message": "Organization has no credits left" } ``` ```json { "code": "execution_failed", "message": "AI execution error" } ``` -------------------------------- ### Async Chat Send Response Source: https://github.com/sleekdotdesign/agent-skills/blob/main/skills/design-mobile-apps/SKILL.md Response for an asynchronous chat message request. Indicates the operation has been accepted and provides a URL to poll for status updates. ```json { "data": { "runId": "run_111", "status": "queued", "statusUrl": "/api/v1/projects/proj_abc/chat/runs/run_111" } } ``` -------------------------------- ### Poll Chat Run Status Source: https://github.com/sleekdotdesign/agent-skills/blob/main/skills/design-mobile-apps/SKILL.md Polls the status of a chat run for a specific project. Useful for tracking the progress of asynchronous chat operations. Project ID and Run ID are required. ```APIDOC ## Poll Chat Run Status ### Description Polls the status of a chat run for a specific project. Useful for tracking the progress of asynchronous chat operations. Project ID and Run ID are required. ### Method GET ### Endpoint /api/v1/projects/:id/chat/runs/:runId ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the project. - **runId** (string) - Required - The unique identifier of the chat run. ### Scope `chats:read` ``` -------------------------------- ### Poll Chat Run Status Source: https://github.com/sleekdotdesign/agent-skills/blob/main/skills/design-mobile-apps/SKILL.md Use this endpoint to check the progress of an asynchronous chat operation. The response shape is similar to the send message response. ```http GET /api/v1/projects/:projectId/chat/runs/:runId Authorization: Bearer $SLEEK_API_KEY ``` -------------------------------- ### Poll Run Status Source: https://github.com/sleekdotdesign/agent-skills/blob/main/skills/design-mobile-apps/SKILL.md Checks the progress of an asynchronous chat operation using the run ID. ```APIDOC ## GET /api/v1/projects/:projectId/chat/runs/:runId ### Description Polls the status of an asynchronous chat operation using the provided `runId`. Use this after initiating a chat message to check its progress. ### Method GET ### Endpoint /api/v1/projects/:projectId/chat/runs/:runId ### Response #### Success Response (200) - **data** (object) - Contains the run status and results. - **runId** (string) - The unique identifier for the run. - **status** (string) - The current status of the run (e.g., `queued`, `running`, `completed`, `failed`). - **statusUrl** (string) - URL to poll for status updates. - **result** (object) - Present when the run is `completed`. Contains the AI's response and operations performed. - **assistantText** (string) - The AI's textual response. - **operations** (array) - A list of operations performed by the AI. - **error** (object) - Present when the run `failed`. Contains error details. - **code** (string) - The error code. - **message** (string) - A description of the error. #### Response Example (Queued) ```json { "data": { "runId": "run_111", "status": "queued", "statusUrl": "..." } } ``` #### Response Example (Completed) ```json { "data": { "runId": "run_111", "status": "completed", "statusUrl": "...", "result": { "assistantText": "...", "operations": [...] } } } ``` #### Response Example (Failed) ```json { "data": { "runId": "run_111", "status": "failed", "statusUrl": "...", "error": { "code": "execution_failed", "message": "..." } } } ``` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.