g2bAPI Reference
Tasks

Create a task

Creates a task for a repository and admits its first durable agent run.

POST
/v1/tasks

Creates a task for a repository and admits its first durable agent run.

Authorization

bearerAuth
AuthorizationBearer <token>

Create an API key in g2b Settings, then send it as a Bearer token.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/tasks" \  -H "Content-Type: application/json" \  -d '{    "repository_id": 1,    "prompt": "string"  }'
{  "id": "string",  "project_id": "string",  "name": "string",  "status": "setup",  "sandbox_status": "initializing",  "github_url": "string",  "branch": "string",  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z",  "run_id": "string",  "run_status": "queued",  "message_id": "string",  "run_url": "string",  "events_url": "string"}
{  "error": {    "code": "string",    "message": "string"  }}
{  "error": "Unauthorized"}
{  "error": {    "code": "string",    "message": "string"  }}
{  "error": {    "code": "string",    "message": "string"  }}