### Sample Response for Get Workspace by ID Source: https://onecompiler.com/apis/embed-studio Example JSON response for a single workspace's details. Includes ID, external ID, creation date, template, status, last seen, usage, backup URL, and workspace name. ```json { "status": "success", "workspace": { "_id": "42964snje", "externalId": "74528374", "properties": { "foo": "bar", "baz": "qux" }, "created": "2024-03-20T02:56:05.838Z", "template": { "_id": "python" }, "status": "stopped", "lastSeen": "2024-03-21T10:15:30.000Z", "usageTotal": 24, "backup": "https://studio.datashortener.com/workspaces/abc/xyz.zip", "url": "https://onecompiler.com/studio/python/42964snje", "name": "My Python Project" } } ``` -------------------------------- ### Interview Catalogue Response Example Source: https://onecompiler.com/apis/embed-ai-interviewer This is an example of the JSON response you will receive when querying the interview catalogue. It includes details about personas, tracks, and specific interviews. ```json { "status": "success", "personas": [ { "id": "maya", "name": "Maya", "title": "Supportive coach" } ], "tracks": [ { "id": "dsa", "cat": "technical", "name": "DSA / Problem solving" } ], "interviews": { "dsa": [ { "id": "dsa-1", "title": "Arrays & hashing warm-up", "level": "Easy", "mins": 25, "kind": "code", "skills": ["Hash maps", "Two pointers"], "blurb": "Two classic problems with follow-ups on complexity.", "hasProblem": true } ] } } ``` -------------------------------- ### Start a Session for a Custom Interview Source: https://onecompiler.com/apis/embed-ai-interviewer Initiate a new interview session against a custom-created interview. Ensure to include `custom: true` and optionally specify a `personaId`. ```bash curl --request POST 'https://onecompiler.com/v1/ai-interviewer/sessions' \ --header 'X-API-Key: your_api_key' \ --header 'X-User-Token: users_api_token' \ --header 'Content-Type: application/json' \ --data '{ "interviewId": "44xkq2m1p", "custom": true, "personaId": "alex" }' ``` -------------------------------- ### Create AI Interviewer Session Source: https://onecompiler.com/apis/embed-ai-interviewer Call this from your backend when the user starts an interview. Requires the user's API token. ```bash curl --request POST 'https://onecompiler.com/v1/ai-interviewer/sessions' \ --header 'X-API-Key: your_api_key' \ --header 'X-User-Token: users_api_token' \ --header 'Content-Type: application/json' \ --data '{ \ "interviewId": "dsa-1", \ "personaId": "maya", \ "mode": "voice" \ }' ``` -------------------------------- ### Sample Response for Listing Templates Source: https://onecompiler.com/apis/embed-studio Example JSON response when listing available Studio templates via the API. It includes details like template ID, title, and description. ```json { "status": "success", "templates": [ { "_id": "react", "title": "React", "description": "React is a popular frontend library for building web applications.", "logo": "/images/logos/react.png", "categories": ["Frontend"], "freeTier": true, "vm": "2 vCPU, 4 GB", "launchTime": "~ 1 minute" }, { "_id": "nodejs", "title": "NodeJS", "description": "NodeJS is a popular stack for building web applications.", "logo": "/images/logos/node-js.png", "categories": ["Backend"], "freeTier": true, "vm": "1 vCPU, 2 GB", "launchTime": "~ 30 seconds" } ] } ``` -------------------------------- ### Sample Response for Reading Workspaces Source: https://onecompiler.com/apis/embed-studio Example JSON response when retrieving a user's workspaces. It details workspace ID, creation date, template used, status, and backup URL. ```json { "status": "success", "workspaces": [ { "_id": "42964snje", "externalId": "74528374", "properties" : { "foo": "bar", "baz": "qux" }, "created": "2024-03-20T02:56:05.838Z", "template": { "_id": "python" }, "status": "stopped", "usageTotal": 24, "backup" : "https://studio.datashortener.com/workspaces/abc/xyz.zip", "url": "https://onecompiler.com/studio/python/42964snje" }, { "_id": "42964t2ex", "externalId": null, "created": "2024-04-01T02:56:10.840Z", "template": { "_id": "react" }, "status": "stopped", "usageTotal": 0, "backup" : "https://studio.datashortener.com/workspaces/abc/xyz.zip", "url": "https://onecompiler.com/studio/react/42964t2ex" } ] } ``` -------------------------------- ### Example API Response for Interview Report Source: https://onecompiler.com/apis/embed-ai-interviewer This is a truncated example of the JSON response you can expect when fetching a full interview report. It includes the session status, overall score, and detailed feedback. ```json { "status": "success", "session": { "_id": "44s2rmqbh", "status": "completed", "score": 78, "feedback": { "score": 78, "verdict": "Strong problem solving; tighten complexity analysis.", "strengths": ["..."], "improvements": ["..."], "skills": [{ "name": "Hash maps", "score": 82 }], "questions": [{ "q": "...", "answer": "...", "score": 80 }] } } } ``` -------------------------------- ### Unsupported Language Error Response Source: https://onecompiler.com/apis/code-execution Example response for an unsupported language, with an error code E006. ```json { "status": "failed", "error": "E006: unsupported language xyz" } ``` -------------------------------- ### Create Interview Session Source: https://onecompiler.com/apis/embed-ai-interviewer Creates a new interview session for a user. This is called when a user starts an interview. Requires user authentication and specifies the interview, persona, and mode. ```APIDOC ## POST /v1/ai-interviewer/sessions ### Description Creates a new interview session for a specified user and interview. ### Method POST ### Endpoint https://onecompiler.com/v1/ai-interviewer/sessions ### Parameters #### Headers - **X-API-Key** (string) - Required - Your API key. - **X-User-Token** (string) - Required - The API token of the user. - **Content-Type** (string) - Required - Must be application/json. #### Request Body - **interviewId** (string) - Required - The ID of the interview to start. - **custom** (boolean) - Optional - Set to true if `interviewId` refers to a custom interview. - **personaId** (string) - Optional - The ID of the interviewer persona. Defaults to 'maya'. - **mode** (string) - Optional - The interview mode ('voice' or 'chat'). Defaults to 'voice'. - **grade** (string) - Required for grade-adaptive interviews - The grade for the interview (e.g., "Grade 6"). - **resume** (object) - Optional - Candidate's resume details with `text` and `name` fields. ### Request Example ```json { "interviewId": "dsa-1", "personaId": "maya", "mode": "voice" } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the success of the operation. - **session** (object) - Contains the session ID and status. - **embedUrl** (string) - The URL to embed the interview interface. ``` -------------------------------- ### Get Workspace by ID Source: https://onecompiler.com/apis/embed-studio Retrieve detailed information about a specific workspace using its unique ID. Requires an `X-User-Token` header. ```APIDOC ### Get workspace by ID Retrieve details of a specific workspace by its ID. ```bash curl --location --request GET 'https://api.onecompiler.com/v1/studio/workspaces/42964snje' \ --header 'X-User-Token: user_api_token' ``` #### Sample Response ```json { "status": "success", "workspace": { "_id": "42964snje", "externalId": "74528374", "properties": { "foo": "bar", "baz": "qux" }, "created": "2024-03-20T02:56:05.838Z", "template": { "_id": "python" }, "status": "stopped", "lastSeen": "2024-03-21T10:15:30.000Z", "usageTotal": 24, "backup": "https://studio.datashortener.com/workspaces/abc/xyz.zip", "url": "https://onecompiler.com/studio/python/42964snje", "name": "My Python Project" } } ``` ``` -------------------------------- ### Get Workspace by ID Source: https://onecompiler.com/apis/embed-studio Retrieve detailed information for a specific workspace using its ID. Requires authentication via 'X-User-Token' header. ```curl curl --location --request GET 'https://api.onecompiler.com/v1/studio/workspaces/42964snje' \ --header 'X-User-Token: user_api_token' ``` -------------------------------- ### Create Session for Custom Interview Source: https://onecompiler.com/apis/embed-ai-interviewer Initiates a new interview session against a specified custom interview. This endpoint is used to start a live interview session, optionally specifying a persona for the AI interviewer. ```APIDOC ## POST /v1/ai-interviewer/sessions ### Description Creates a new session for an AI interview. This can be used for both catalogue and custom interviews. For custom interviews, `custom: true` must be included. ### Method POST ### Endpoint /v1/ai-interviewer/sessions ### Parameters #### Request Body - **interviewId** (string) - Required - The ID of the interview to create a session for. - **custom** (boolean) - Required - Set to `true` when creating a session for a custom interview. - **personaId** (string) - Optional - The ID of the AI persona to use for the interviewer. ### Request Example ```json { "interviewId": "44xkq2m1p", "custom": true, "personaId": "alex" } ``` ### Response (Response details for session creation are not explicitly provided in the source, but typically would include session details or a link to the session room.) ``` -------------------------------- ### Create a Custom AI Interview Source: https://onecompiler.com/apis/embed-ai-interviewer This cURL command demonstrates how to create a custom interview by sending a POST request to the /v1/ai-interviewer/interviews endpoint. Include details like title, kind, level, skills, blurb, and a private brief to guide the AI interviewer. Ensure you set the correct Content-Type header and provide your API key and user token. ```bash curl --request POST 'https://onecompiler.com/v1/ai-interviewer/interviews' \ --header 'X-API-Key: your_api_key' \ --header 'X-User-Token: users_api_token' \ --header 'Content-Type: application/json' \ --data '{ "title": "Backend engineer screen — payments team", "kind": "talk", "level": "Medium", "mins": 30, "skills": ["APIs", "SQL", "Debugging"], "blurb": "A screening round for backend candidates.", "brief": "Interview for a mid-level backend role on a payments team. Cover REST API design, one SQL question on joins, and a debugging scenario with a failing webhook. Probe for reasoning, not memorized answers.", "status": "published" }' ``` -------------------------------- ### Get Workspace by ID Source: https://onecompiler.com/apis/embed-studio Retrieve detailed information for a specific workspace using its unique ID. Authentication is required via the 'X-User-Token' header. ```curl curl --location --request GET 'https://api.onecompiler.com/v1/studio/workspaces/42964snje' \ --header 'X-User-Token: user_api_token' ``` -------------------------------- ### Create AI Interviewer Session Source: https://onecompiler.com/apis/embed-ai-interviewer Creates a new AI interviewer session for a user. This should be called from your backend when a user starts an interview. Requires user API token obtained from user creation. ```APIDOC ## POST /v1/ai-interviewer/sessions ### Description Creates a new AI interviewer session for a user. This should be called from your backend when a user starts an interview. Requires user API token obtained from user creation. ### Method POST ### Endpoint https://onecompiler.com/v1/ai-interviewer/sessions ### Headers - **X-API-Key** (string) - Required - Your API account key - **X-User-Token** (string) - Required - The API token of the user - **Content-Type** (string) - Required - application/json ### Request Body - **interviewId** (string) - Required - An interview ID from the catalogue or a custom interview ID. - **custom** (boolean) - Optional - Set to `true` if `interviewId` is a custom interview. - **personaId** (string) - Optional - The persona for the interviewer. Defaults to `maya`. Options: `maya` (supportive coach), `alex` (neutral professional), `leo` (bar raiser). - **mode** (string) - Optional - The interview mode. Defaults to `voice`. Options: `voice`, `chat`. - **grade** (string) - Required for grade-adaptive interviews - The grade for the interview, e.g., "Grade 6". - **resume** (object) - Optional - Candidate's resume details. - **text** (string) - The resume text. - **name** (string) - The name of the resume file. ### Request Example ```json { "interviewId": "dsa-1", "personaId": "maya", "mode": "voice" } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the success of the operation. - **session** (object) - Details of the created session. - **_id** (string) - The unique ID of the session. - **interviewId** (string) - The ID of the interview. - **status** (string) - The current status of the session. - **embedUrl** (string) - The URL to embed the interview room. #### Response Example ```json { "status": "success", "session": { "_id": "44s2rmqbh", "interviewId": "dsa-1", "status": "active" }, "embedUrl": "https://onecompiler.com/embed/ai-interviewer/44s2rmqbh" } ``` ``` -------------------------------- ### Get Challenge High-Level Summary API Source: https://onecompiler.com/apis/enterprise Use this GET API call to retrieve the high-level summary of a challenge. It requires an access token and one or more challenge IDs. ```http https://api.onecompiler.com/v1/challenges/stats/summary?access_token=&challengeIds= ``` ```http https://api.onecompiler.com/v1/challenges/stats/summary?access_token=xyz123456&challengeIds=3w7dby3mt ``` -------------------------------- ### Create a new Studio workspace Source: https://onecompiler.com/apis/embed-studio Use this endpoint to programmatically create a new workspace. Specify the template ID and an optional name for the workspace. ```bash curl --location 'https://api.onecompiler.com/v1/studio/workspaces' \ --header 'Content-Type: application/json' \ --header 'X-User-Token: user_api_token' \ --data '{ "templateId": "nodejs", "name": "My Project" }' ``` -------------------------------- ### Get Challenge High-Level Summary API Source: https://onecompiler.com/apis/enterprise Use this GET API call to retrieve the high-level summary of a challenge. It requires an access token and one or more challenge IDs. ```http https://api.onecompiler.com/v1/challenges/stats/summary?access_token=&challengeIds= ``` ```http https://api.onecompiler.com/v1/challenges/stats/summary?access_token=xyz123456&challengeIds=3w7dby3mt ``` ```json { "status": "success", "statsSummary": { "3w7dby3mt": { "totalAttempted": 708, "currentAttempting": 12, "totalChallengeScore": 20 } } } ``` -------------------------------- ### Get Challenge User-Level Details API Source: https://onecompiler.com/apis/enterprise This GET API call returns user-level details for a challenge, including a list of users who attempted it, their scores, and the total score achieved. It requires an access token and one or more challenge IDs. ```http https://api.onecompiler.com/v1/challenges/stats?access_token=&challengeIds= ``` ```http https://api.onecompiler.com/v1/challenges/stats?access_token=xyz123456&challengeIds=3w7dby3mt ``` ```json { "status": "success", "stats": { "3w7dby3mt": [ { "_id": "3w7dby3mt_3ttkdkdkd", "score": 10, "challenge": { "_id": "3w7dby3mt" }, "user": { "_id": "3ttkdkdkd" }, "created": "2023-06-30T12:33:30.985Z", "updated": "2023-06-30T13:06:26.240Z", "accessCode": "s51lkpwo7qbb96bokktj3q1xyo5cgqghjsok2x5dgmwdqgjme4v7z8wntxs3xl8nwiyg1sed66hwu78jxl08fiz7cfozdhuz5nbazrkwjn5vel01sopm5becyrhhybdu", "tabChanges": 6 }, {}, {}, . . . ] } } ``` -------------------------------- ### Get Challenge User-Level Details API Source: https://onecompiler.com/apis/enterprise This GET API call retrieves user-level details for a challenge, including a list of users who attempted it, their scores, and the total score achieved by each user. It requires an access token and one or more challenge IDs. ```http https://api.onecompiler.com/v1/challenges/stats?access_token=&challengeIds= ``` ```http https://api.onecompiler.com/v1/challenges/stats?access_token=xyz123456&challengeIds=3w7dby3mt ``` -------------------------------- ### Create workspace Source: https://onecompiler.com/apis/embed-studio Create a new Studio workspace programmatically. You can specify a template, name, and other configurations. ```APIDOC ## Create workspace ### Description Create a new Studio workspace programmatically. ### Method POST ### Endpoint https://api.onecompiler.com/v1/studio/workspaces ### Parameters #### Request Body - **templateId** (string) - Required - Template ID (e.g., nodejs, python, react) - **name** (string) - Optional - Workspace name - **externalId** (string) - Optional - External ID from your application - **dataset** (string) - Optional - Dataset to use, for database templates only - **properties** (object) - Optional - Custom key/value data attached to the workspace. Stored as-is and returned untouched. - **settings** (object) - Optional - Workspace configuration that OneCompiler acts on. - **inactivityTimeoutMinutes** (number) - Optional - Minutes a workspace can stay idle before it's automatically stopped. Defaults to 5. Maximum 30 (higher values are capped). ### Request Example ```json { "templateId": "nodejs", "name": "My Project" } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the status of the operation. - **workspace** (object) - Details of the created workspace. - **_id** (string) - Unique identifier for the workspace. - **externalId** (string) - External ID associated with the workspace. - **properties** (object) - Custom properties attached to the workspace. - **created** (string) - Timestamp when the workspace was created. - **template** (object) - Information about the workspace template. - **_id** (string) - The ID of the template. - **status** (string) - The current status of the workspace (e.g., 'running'). - **name** (string) - The name of the workspace. #### Response Example ```json { "status": "success", "workspace": { "_id": "42964xyz1", "externalId": "proj-123", "properties": { "foo": "bar" }, "created": "2024-04-15T10:30:00.000Z", "template": { "_id": "nodejs" }, "status": "running", "name": "My Project" } } ``` ``` -------------------------------- ### Create workspace Source: https://onecompiler.com/apis/embed-studio Create a new Studio workspace programmatically. You can specify a template, name, and other optional configurations. ```APIDOC ## Create workspace ### Description Create a new Studio workspace programmatically. You can specify a template, name, and other optional configurations. ### Method POST ### Endpoint https://api.onecompiler.com/v1/studio/workspaces ### Parameters #### Request Body - **templateId** (string) - Required - Template ID (e.g., nodejs, python, react) - **name** (string) - Optional - Workspace name - **externalId** (string) - Optional - External ID from your application - **dataset** (string) - Optional - Dataset to use, for database templates only - **properties** (object) - Optional - Custom key/value data attached to the workspace. Stored as-is and returned untouched. - **settings** (object) - Optional - Workspace configuration that OneCompiler acts on. - **inactivityTimeoutMinutes** (number) - Optional - Minutes a workspace can stay idle before it's automatically stopped. Defaults to 5. Maximum 30 (higher values are capped). ### Request Example ```json { "templateId": "nodejs", "name": "My Project" } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the status of the operation. - **workspace** (object) - Details of the created workspace. - **_id** (string) - Unique identifier for the workspace. - **externalId** (string) - External ID associated with the workspace. - **properties** (object) - Custom properties attached to the workspace. - **created** (string) - Timestamp when the workspace was created. - **template** (object) - Information about the workspace template. - **_id** (string) - The ID of the template. - **status** (string) - The current status of the workspace (e.g., 'running'). - **name** (string) - The name of the workspace. #### Response Example ```json { "status": "success", "workspace": { "_id": "42964xyz1", "externalId": "proj-123", "properties": { "foo": "bar" }, "created": "2024-04-15T10:30:00.000Z", "template": { "_id": "nodejs" }, "status": "running", "name": "My Project" } } ``` ``` -------------------------------- ### Get Workspace by ID Source: https://onecompiler.com/apis/embed-studio Retrieves detailed information about a specific workspace using its unique ID. ```APIDOC ## Get workspace by ID Retrieve details of a specific workspace by its ID. ### Method GET ### Endpoint https://api.onecompiler.com/v1/studio/workspaces/{workspaceId} ### Parameters #### Path Parameters - **workspaceId** (string) - Required - The ID of the workspace to retrieve. ### Headers - **X-User-Token** (string) - Required - User API token for authentication. #### Sample Response ```json { "status": "success", "workspace": { "_id": "42964snje", "externalId": "74528374", "properties": { "foo": "bar", "baz": "qux" }, "created": "2024-03-20T02:56:05.838Z", "template": { "_id": "python" }, "status": "stopped", "lastSeen": "2024-03-21T10:15:30.000Z", "usageTotal": 24, "backup": "https://studio.datashortener.com/workspaces/abc/xyz.zip", "url": "https://onecompiler.com/studio/python/42964snje", "name": "My Python Project" } } ``` ``` -------------------------------- ### List Studio Templates Source: https://onecompiler.com/apis/embed-studio Retrieve a list of all available Studio templates that can be used to create new workspaces. ```APIDOC ## List templates Get all available Studio templates. ```bash curl --location --request GET 'https://api.onecompiler.com/v1/studio/templates' ``` #### Sample Response ```json { "status": "success", "templates": [ { "_id": "react", "title": "React", "description": "React is a popular frontend library for building web applications.", "logo": "/images/logos/react.png", "categories": ["Frontend"], "freeTier": true, "vm": "2 vCPU, 4 GB", "launchTime": "~ 1 minute" }, { "_id": "nodejs", "title": "NodeJS", "description": "NodeJS is a popular stack for building web applications.", "logo": "/images/logos/node-js.png", "categories": ["Backend"], "freeTier": true, "vm": "1 vCPU, 2 GB", "launchTime": "~ 30 seconds" } ] } ``` ``` -------------------------------- ### Create a new Studio workspace Source: https://onecompiler.com/apis/embed-studio Use this endpoint to programmatically create a new OneCompiler Studio workspace. Specify the template ID and an optional name for your project. ```bash curl --location 'https://api.onecompiler.com/v1/studio/workspaces' \ --header 'Content-Type: application/json' \ --header 'X-User-Token: user_api_token' \ --data '{ \ "templateId": "nodejs", \ "name": "My Project" \ }' ``` -------------------------------- ### Missing API Token Response Source: https://onecompiler.com/apis/code-execution Example response for a missing API token, with an error code E004. ```json { "status": "failed", "error": "E004: access_token missing" } ``` -------------------------------- ### Invalid API Token Response Source: https://onecompiler.com/apis/code-execution Example response for an invalid API token, with an error code E003. ```json { "status": "failed", "error": "E003: invalid access_token" } ``` -------------------------------- ### Read Interview Catalogue Source: https://onecompiler.com/apis/embed-ai-interviewer Use this cURL command to fetch the list of available AI interview tracks, interviews, and interviewer personas. Replace 'your_api_key' with your actual API key. ```bash curl 'https://onecompiler.com/v1/ai-interviewer/catalogue' \ --header 'X-API-Key: your_api_key' ``` -------------------------------- ### Fork workspace Source: https://onecompiler.com/apis/embed-studio Creates a copy of an existing workspace, including its files and configurations. ```APIDOC ## POST /v1/studio/workspaces/fork ### Description Creates a copy of an existing workspace. This creates a new workspace based on the source workspace's backup (if available) with all files and configurations. ### Method POST ### Endpoint https://api.onecompiler.com/v1/studio/workspaces/fork ### Parameters #### Request Body - **workspaceId** (string) - Required - ID of the workspace to fork - **name** (string) - Optional - Name for the forked workspace - **externalId** (string) - Optional - External ID from your application - **properties** (object) - Optional - Custom properties for the forked workspace - **metadata** (object) - Optional - Custom metadata for the forked workspace - **settings** (object) - Optional - Workspace configuration for the fork (not inherited from the source) ### Request Example ```json { "workspaceId": "42964snje" } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the status of the operation (e.g., "success") - **workspace** (object) - Details about the newly created workspace - **_id** (string) - The unique identifier for the new workspace - **created** (string) - The timestamp when the workspace was created - **template** (object) - Information about the workspace template - **_id** (string) - The ID of the template used - **status** (string) - The initial status of the workspace (e.g., "creating_environment") #### Response Example ```json { "status": "success", "workspace": { "_id": "42964abc2", "created": "2024-04-16T14:20:00.000Z", "template": { "_id": "nodejs" }, "status": "creating_environment" } } ``` ``` -------------------------------- ### STDIN Too Long Error Response Source: https://onecompiler.com/apis/code-execution Example response indicating that the provided STDIN is too long, with an error code E005. ```json { "status": "failed", "error": "E005: stdin too long" } ``` -------------------------------- ### API Quota Exceeded Response Source: https://onecompiler.com/apis/code-execution Example response indicating that the API quota has been exceeded, with an error code E002. ```json { "status": "failed", "error": "E002: API quota exceeded" } ``` -------------------------------- ### Fork workspace Source: https://onecompiler.com/apis/embed-studio Creates a copy of an existing workspace, including its files and configurations. ```APIDOC ## POST /v1/studio/workspaces/fork ### Description Creates a copy of an existing workspace. ### Method POST ### Endpoint https://api.onecompiler.com/v1/studio/workspaces/fork ### Parameters #### Request Body - **workspaceId** (string) - Required - ID of the workspace to fork. - **name** (string) - Optional - Name for the forked workspace. - **externalId** (string) - Optional - External ID from your application. - **properties** (object) - Optional - Custom properties for the forked workspace. - **metadata** (object) - Optional - Custom metadata for the forked workspace. - **settings** (object) - Optional - Workspace configuration for the fork. ### Request Example ```json { "workspaceId": "42964snje" } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the status of the operation. - **workspace** (object) - Details of the newly created forked workspace. - **_id** (string) - The unique identifier for the forked workspace. - **created** (string) - The timestamp when the workspace was created. - **template** (object) - Information about the workspace template. - **_id** (string) - The ID of the template used. - **status** (string) - The current status of the workspace (e.g., "creating_environment"). #### Response Example ```json { "status": "success", "workspace": { "_id": "42964abc2", "created": "2024-04-16T14:20:00.000Z", "template": { "_id": "nodejs" }, "status": "creating_environment" } } ``` ``` -------------------------------- ### API Operation Timed Out Response Source: https://onecompiler.com/apis/code-execution Example response indicating that the API operation timed out, with an error code E001. ```json { "status": "success", "error": "E001: operation timed out" } ``` -------------------------------- ### Successful Code Execution Response Source: https://onecompiler.com/apis/code-execution This is a sample successful response from the /run API, detailing stdout, stderr, execution time, memory usage, and remaining API limits. ```json { "stdout": "Hello Peter\n", "stderr": null, "exception": null, "status": "success", "compilationTime": 0, "executionTime": 9, "memoryUsed": 9384, "limitRemaining": 340368 } ``` -------------------------------- ### Update Custom Interview Source: https://onecompiler.com/apis/embed-ai-interviewer Updates an existing custom interview. Any field can be modified, for example, to change the status to 'draft' to unpublish it. ```APIDOC ## PUT /v1/ai-interviewer/interviews/:id ### Description Updates any field of an existing custom interview. For example, changing the `status` to `"draft"` can unpublish the interview. ### Method PUT ### Endpoint /v1/ai-interviewer/interviews/:id ### Parameters #### Path Parameters - **id** (string) - Required - The ID of the interview to update. #### Request Body - **(Any field)** (type) - Required/Optional - Fields to update in the interview object (e.g., `{"status": "draft"}`). ### Response (Response details are not explicitly provided in the source, but typically would confirm the update or return the updated interview object.) ``` -------------------------------- ### List Templates Source: https://onecompiler.com/apis/embed-studio Retrieves a list of all available Studio templates, including their IDs, titles, descriptions, and resource information. ```APIDOC ## List templates Get all available Studio templates. ### Method GET ### Endpoint https://api.onecompiler.com/v1/studio/templates ### Sample Response ```json { "status": "success", "templates": [ { "_id": "react", "title": "React", "description": "React is a popular frontend library for building web applications.", "logo": "/images/logos/react.png", "categories": ["Frontend"], "freeTier": true, "vm": "2 vCPU, 4 GB", "launchTime": "~ 1 minute" }, { "_id": "nodejs", "title": "NodeJS", "description": "NodeJS is a popular stack for building web applications.", "logo": "/images/logos/node-js.png", "categories": ["Backend"], "freeTier": true, "vm": "1 vCPU, 2 GB", "launchTime": "~ 30 seconds" } ] } ``` ``` -------------------------------- ### Read Custom Interview Source: https://onecompiler.com/apis/embed-ai-interviewer Retrieves a specific custom interview, including its private brief, which is used to guide the AI interviewer. ```APIDOC ## GET /v1/ai-interviewer/interviews/:id ### Description Retrieves a specific custom interview by its ID. This includes the private brief that steers the AI interviewer and is not shown to candidates. ### Method GET ### Endpoint /v1/ai-interviewer/interviews/:id ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the interview. ### Response #### Success Response (200) - **interview** (object) - The details of the custom interview, including the private brief. ``` -------------------------------- ### Create New User Programmatically Source: https://onecompiler.com/apis/enterprise Use this cURL request to create a new user in the OneCompiler system. Ensure you replace 'your_api_key' with your actual API key. ```bash curl --location --request POST 'https://api.onecompiler.com/v1/users' \ --header 'Content-Type: application/json' \ --header 'X-API-Key: your_api_key' \ --data-raw '{ "name": "Peter Griffin", "email": "peter@gmail.com" }' ``` -------------------------------- ### Deploy Workspace Source: https://onecompiler.com/apis/embed-studio Deploys a workspace to make it accessible via a public URL. Requires workspace ID and a unique slug for the deployment. ```bash curl --location 'https://api.onecompiler.com/v1/studio/workspaces/deploy' \ --header 'Content-Type: application/json' \ --header 'X-User-Token: user_api_token' \ --data '{ "workspaceId": "42964snje", "slug": "my-app-123" }' ``` -------------------------------- ### Query Parameters for Embedding Source: https://onecompiler.com/apis/embed-studio Customize the embedded Studio experience using various query parameters. ```APIDOC ## More options via query parameters Query Parameter| Description| Required? ---|---|--- `userApiToken`| Token you get when sync your application users| Required `theme=dark`| Load Studio in Dark Theme| Optional `hideWorkspaces=true`| Hide workspaces list, Only applicable in Embed Template Home Page| Optional `externalId`| External Id from 3rd party application. Shown in `/api/v1/studio/workspaces` API| Optional `properties.`| Custom properties to be passed to the Studio. ex. `properties.foo=bar`| Optional > Please check the Enterprise APIs section for more advanced options like syncing user data and obtaining userApiToken. ``` -------------------------------- ### Get Custom Interview Results Source: https://onecompiler.com/apis/embed-ai-interviewer Retrieves all sessions conducted against a specific custom interview, including taker information, status, and score. ```APIDOC ## GET /v1/ai-interviewer/interviews/:id/results ### Description Retrieves all sessions that were taken against a specific custom interview. Includes taker name, status, and score for each session. ### Method GET ### Endpoint /v1/ai-interviewer/interviews/:id/results ### Parameters #### Path Parameters - **id** (string) - Required - The ID of the interview whose results are to be retrieved. ### Response (Response details are not explicitly provided in the source, but would typically be a list of session result objects.) ``` -------------------------------- ### Create a Custom AI Interview Source: https://onecompiler.com/apis/embed-ai-interviewer Use this endpoint to define and publish a new custom AI interview. Provide details such as title, kind, level, skills, and a private brief for the AI interviewer. ```bash curl --request POST 'https://onecompiler.com/v1/ai-interviewer/interviews' \ --header 'X-API-Key: your_api_key' \ --header 'X-User-Token: users_api_token' \ --header 'Content-Type: application/json' \ --data '{ \ "title": "Backend engineer screen — payments team", \ "kind": "talk", \ "level": "Medium", \ "mins": 30, \ "skills": ["APIs", "SQL", "Debugging"], \ "blurb": "A screening round for backend candidates.", \ "brief": "Interview for a mid-level backend role on a payments team. Cover REST API design, one SQL question on joins, and a debugging scenario with a failing webhook. Probe for reasoning, not memorized answers.", \ "status": "published" \ }' ``` -------------------------------- ### Deploy workspace Source: https://onecompiler.com/apis/embed-studio Deploys a workspace to make it accessible via a public URL. The deployment process is asynchronous. ```APIDOC ## POST /v1/studio/workspaces/deploy ### Description Deploys a workspace to make it accessible via a public URL. The deployment process is asynchronous. ### Method POST ### Endpoint https://api.onecompiler.com/v1/studio/workspaces/deploy ### Parameters #### Request Body - **workspaceId** (string) - Required - Workspace ID to deploy - **slug** (string) - Required - Deployment subdomain identifier (letters, numbers, hyphens only, min 6 chars) ### Request Example ```json { "workspaceId": "42964snje", "slug": "my-app-123" } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the status of the operation (e.g., "success") - **deployment** (object) - Details about the deployment - **_id** (string) - The unique identifier for the deployment - **sourceId** (string) - The ID of the workspace that was deployed - **slug** (string) - The subdomain identifier for the deployment - **domain** (string) - The domain where the workspace is deployed - **status** (string) - The current status of the deployment (e.g., "queued", "completed", "failed") - **created** (string) - The timestamp when the deployment was created #### Response Example ```json { "status": "success", "deployment": { "_id": "dep-xyz123", "sourceId": "42964snje", "slug": "my-app-123", "domain": "onecompiler.app", "status": "queued", "created": "2024-04-15T12:00:00.000Z" } } ``` ``` -------------------------------- ### Get User Submission Details Source: https://onecompiler.com/apis/enterprise Retrieve submission details for a specific challenge and user. Requires challenge ID, user ID, and an access token. ```url https://api.onecompiler.com/v1/challenges/submission//?access_token= ``` -------------------------------- ### Deploy workspace Source: https://onecompiler.com/apis/embed-studio Deploys a workspace to make it accessible via a public URL. The deployment process is asynchronous. ```APIDOC ## POST /v1/studio/workspaces/deploy ### Description Deploys a workspace to make it accessible via a public URL. ### Method POST ### Endpoint https://api.onecompiler.com/v1/studio/workspaces/deploy ### Parameters #### Request Body - **workspaceId** (string) - Required - Workspace ID to deploy - **slug** (string) - Required - Deployment subdomain identifier (letters, numbers, hyphens only, min 6 chars) ### Request Example ```json { "workspaceId": "42964snje", "slug": "my-app-123" } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the status of the operation. - **deployment** (object) - Details of the deployment. - **_id** (string) - The unique identifier for the deployment. - **sourceId** (string) - The ID of the workspace that was deployed. - **slug** (string) - The subdomain identifier for the deployment. - **domain** (string) - The domain where the workspace is deployed. - **status** (string) - The current status of the deployment (e.g., "queued", "completed", "failed"). - **created** (string) - The timestamp when the deployment was created. #### Response Example ```json { "status": "success", "deployment": { "_id": "dep-xyz123", "sourceId": "42964snje", "slug": "my-app-123", "domain": "onecompiler.app", "status": "queued", "created": "2024-04-15T12:00:00.000Z" } } ``` ``` -------------------------------- ### Sign In a User Programmatically Source: https://onecompiler.com/apis/enterprise Allows for programmatic user sign-in by adding specific query parameters to eligible URLs, enabling automatic session creation. ```APIDOC ## Signing In a User Programmatically To make a user login automatically for a session. Add the following query parameters to the eligible URL (ex. Embedded challenges) 1. apiKey 2. userApiToken Example URL: https://onecompiler.com/embed/challenges/3w7dby3mt/beginners-coding-challenge?apiKey=your_api_id&userApiToken=user_specific_token ```