HTTP API

Human-in-the-Loop

GET/api/v1/hitl/approvals
GET
/api/v1/hitl/approvals

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Response Body

application/json

curl -X GET "https://example.com/api/v1/hitl/approvals"
{  "requests": [    {      "acknowledged_at": "2019-08-24T14:15:22Z",      "approvers": [        "string"      ],      "created_at": "2019-08-24T14:15:22Z",      "created_by": "string",      "decision": null,      "decision_deadline": "2019-08-24T14:15:22Z",      "description": "string",      "expires_at": "2019-08-24T14:15:22Z",      "kind": "approve_reject",      "metadata": null,      "options": [        {          "label": "string",          "metadata": null,          "option_id": "string"        }      ],      "request_id": "string",      "required_approvers": 0,      "status": "pending",      "tally": {        "approvals_received": 0,        "rejections_received": 0,        "remaining_approvers": [          "string"        ],        "required_approvers": 0      },      "title": "string",      "updated_at": "2019-08-24T14:15:22Z",      "votes": [        {          "approver_id": "string",          "decided_at": "2019-08-24T14:15:22Z",          "outcome": "approved",          "reason": "string",          "submitted_input": null        }      ]    }  ]}
POST/api/v1/hitl/approvals/{request_id}/respond
POST
/api/v1/hitl/approvals/{request_id}/respond

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

request_id*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Route payload for recording a decision.

Response Body

application/json

curl -X POST "https://example.com/api/v1/hitl/approvals/string/respond" \  -H "Content-Type: application/json" \  -d '{    "decision": {      "approve": {}    }  }'
{  "acknowledged_at": "2019-08-24T14:15:22Z",  "approvers": [    "string"  ],  "created_at": "2019-08-24T14:15:22Z",  "created_by": "string",  "decision": null,  "decision_deadline": "2019-08-24T14:15:22Z",  "description": "string",  "expires_at": "2019-08-24T14:15:22Z",  "kind": "approve_reject",  "metadata": null,  "options": [    {      "label": "string",      "metadata": null,      "option_id": "string"    }  ],  "request_id": "string",  "required_approvers": 0,  "status": "pending",  "tally": {    "approvals_received": 0,    "rejections_received": 0,    "remaining_approvers": [      "string"    ],    "required_approvers": 0  },  "title": "string",  "updated_at": "2019-08-24T14:15:22Z",  "votes": [    {      "approver_id": "string",      "decided_at": "2019-08-24T14:15:22Z",      "outcome": "approved",      "reason": "string",      "submitted_input": null    }  ]}
GET/api/v1/hitl/requests
GET
/api/v1/hitl/requests

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Query Parameters

q?string

Full-text search query

page?integer

1-indexed page number

Formatint64
Range0 <= value
page_size?integer

Page size

Formatint64
Range0 <= value
sort_by?string

Sort field (created_at, status, title)

sort_order?string

Sort order (asc or desc)

Value in

  • "asc"
  • "desc"
filter?array<string>

Additional filter expressions in the form field:operator:value

status?string

Filter by request status

Value in

  • "pending"
  • "approved"
  • "rejected"
  • "acknowledged"
  • "expired"

Response Body

application/json

curl -X GET "https://example.com/api/v1/hitl/requests"
{  "pagination": {    "has_more": true,    "page": 0,    "page_size": 0,    "total": 0  },  "requests": [    {      "acknowledged_at": "2019-08-24T14:15:22Z",      "approvers": [        "string"      ],      "created_at": "2019-08-24T14:15:22Z",      "created_by": "string",      "decision": null,      "decision_deadline": "2019-08-24T14:15:22Z",      "description": "string",      "expires_at": "2019-08-24T14:15:22Z",      "kind": "approve_reject",      "metadata": null,      "options": [        {          "label": "string",          "metadata": null,          "option_id": "string"        }      ],      "request_id": "string",      "required_approvers": 0,      "status": "pending",      "tally": {        "approvals_received": 0,        "rejections_received": 0,        "remaining_approvers": [          "string"        ],        "required_approvers": 0      },      "title": "string",      "updated_at": "2019-08-24T14:15:22Z",      "votes": [        {          "approver_id": "string",          "decided_at": "2019-08-24T14:15:22Z",          "outcome": "approved",          "reason": "string",          "submitted_input": null        }      ]    }  ]}
POST/api/v1/hitl/requests
POST
/api/v1/hitl/requests

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Request payload for creating a new Human-in-the-Loop request.

Response Body

application/json

curl -X POST "https://example.com/api/v1/hitl/requests" \  -H "Content-Type: application/json" \  -d '{    "approvers": [      "string"    ],    "kind": "approve_reject",    "title": "string"  }'
{  "acknowledged_at": "2019-08-24T14:15:22Z",  "approvers": [    "string"  ],  "created_at": "2019-08-24T14:15:22Z",  "created_by": "string",  "decision": null,  "decision_deadline": "2019-08-24T14:15:22Z",  "description": "string",  "expires_at": "2019-08-24T14:15:22Z",  "kind": "approve_reject",  "metadata": null,  "options": [    {      "label": "string",      "metadata": null,      "option_id": "string"    }  ],  "request_id": "string",  "required_approvers": 0,  "status": "pending",  "tally": {    "approvals_received": 0,    "rejections_received": 0,    "remaining_approvers": [      "string"    ],    "required_approvers": 0  },  "title": "string",  "updated_at": "2019-08-24T14:15:22Z",  "votes": [    {      "approver_id": "string",      "decided_at": "2019-08-24T14:15:22Z",      "outcome": "approved",      "reason": "string",      "submitted_input": null    }  ]}
GET/api/v1/hitl/requests/{request_id}
GET
/api/v1/hitl/requests/{request_id}

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

request_id*string

Response Body

application/json

curl -X GET "https://example.com/api/v1/hitl/requests/string"
{  "acknowledged_at": "2019-08-24T14:15:22Z",  "approvers": [    "string"  ],  "created_at": "2019-08-24T14:15:22Z",  "created_by": "string",  "decision": null,  "decision_deadline": "2019-08-24T14:15:22Z",  "description": "string",  "expires_at": "2019-08-24T14:15:22Z",  "kind": "approve_reject",  "metadata": null,  "options": [    {      "label": "string",      "metadata": null,      "option_id": "string"    }  ],  "request_id": "string",  "required_approvers": 0,  "status": "pending",  "tally": {    "approvals_received": 0,    "rejections_received": 0,    "remaining_approvers": [      "string"    ],    "required_approvers": 0  },  "title": "string",  "updated_at": "2019-08-24T14:15:22Z",  "votes": [    {      "approver_id": "string",      "decided_at": "2019-08-24T14:15:22Z",      "outcome": "approved",      "reason": "string",      "submitted_input": null    }  ]}
POST/api/v1/hitl/requests/{request_id}/acknowledge
POST
/api/v1/hitl/requests/{request_id}/acknowledge

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

request_id*string

Response Body

application/json

curl -X POST "https://example.com/api/v1/hitl/requests/string/acknowledge"
{  "acknowledged_at": "2019-08-24T14:15:22Z",  "approvers": [    "string"  ],  "created_at": "2019-08-24T14:15:22Z",  "created_by": "string",  "decision": null,  "decision_deadline": "2019-08-24T14:15:22Z",  "description": "string",  "expires_at": "2019-08-24T14:15:22Z",  "kind": "approve_reject",  "metadata": null,  "options": [    {      "label": "string",      "metadata": null,      "option_id": "string"    }  ],  "request_id": "string",  "required_approvers": 0,  "status": "pending",  "tally": {    "approvals_received": 0,    "rejections_received": 0,    "remaining_approvers": [      "string"    ],    "required_approvers": 0  },  "title": "string",  "updated_at": "2019-08-24T14:15:22Z",  "votes": [    {      "approver_id": "string",      "decided_at": "2019-08-24T14:15:22Z",      "outcome": "approved",      "reason": "string",      "submitted_input": null    }  ]}
POST/api/v1/hitl/requests/{request_id}/decision
POST
/api/v1/hitl/requests/{request_id}/decision

Authorization

bearer_token
AuthorizationBearer <token>

In: header

Path Parameters

request_id*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Route payload for recording a decision.

Response Body

application/json

curl -X POST "https://example.com/api/v1/hitl/requests/string/decision" \  -H "Content-Type: application/json" \  -d '{    "decision": {      "approve": {}    }  }'
{  "acknowledged_at": "2019-08-24T14:15:22Z",  "approvers": [    "string"  ],  "created_at": "2019-08-24T14:15:22Z",  "created_by": "string",  "decision": null,  "decision_deadline": "2019-08-24T14:15:22Z",  "description": "string",  "expires_at": "2019-08-24T14:15:22Z",  "kind": "approve_reject",  "metadata": null,  "options": [    {      "label": "string",      "metadata": null,      "option_id": "string"    }  ],  "request_id": "string",  "required_approvers": 0,  "status": "pending",  "tally": {    "approvals_received": 0,    "rejections_received": 0,    "remaining_approvers": [      "string"    ],    "required_approvers": 0  },  "title": "string",  "updated_at": "2019-08-24T14:15:22Z",  "votes": [    {      "approver_id": "string",      "decided_at": "2019-08-24T14:15:22Z",      "outcome": "approved",      "reason": "string",      "submitted_input": null    }  ]}

On this page