g2bAPI Reference
Messages

Queue the next message

Queues a message behind the current run and may admit the next run immediately.

POST
/v1/tasks/{id}/queue

Queues a message behind the current run and may admit the next run immediately.

Authorization

bearerAuth
AuthorizationBearer <token>

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

In: header

Path Parameters

id*string
Length1 <= length <= 256

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/string/queue" \  -H "Content-Type: application/json" \  -d '{    "prompt": "string",    "client_request_id": "string",    "message_id": "string"  }'
{  "control": {    "id": "string",    "task_id": "string",    "kind": "queue",    "status": "pending",    "prompt": "string",    "target_run_id": "string",    "created_run_id": "string",    "created_at": "2019-08-24T14:15:22Z",    "applied_at": "2019-08-24T14:15:22Z"  },  "run": {    "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"  }}