Opengram

Create a request in a chat

POST
/api/v1/chats/{chatId}/requests

Authorization

bearerAuth
AuthorizationBearer <token>

Instance secret token

In: header

Path Parameters

chatId*string

Header Parameters

Idempotency-Key?string

Optional idempotency key. If provided, duplicate requests with the same key and payload return the cached response instead of creating a new resource.

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

application/json

application/json

curl -X POST "https://loading/api/v1/chats/abc123/requests" \  -H "Content-Type: application/json" \  -d '{    "type": "choice",    "title": "string",    "config": {      "property1": null,      "property2": null    }  }'
{
  "id": "string",
  "chat_id": "string",
  "type": "choice",
  "status": "pending",
  "title": "string",
  "body": "string",
  "config": {
    "property1": null,
    "property2": null
  },
  "created_at": "2019-08-24T14:15:22Z",
  "resolved_at": "2019-08-24T14:15:22Z",
  "resolved_by": "string",
  "resolution_payload": {
    "property1": null,
    "property2": null
  },
  "trace": {
    "property1": null,
    "property2": null
  }
}
{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Invalid request.",
    "details": null
  }
}
{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Invalid request.",
    "details": null
  }
}
{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Invalid request.",
    "details": null
  }
}
{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Invalid request.",
    "details": null
  }
}
{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Invalid request.",
    "details": null
  }
}
{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Invalid request.",
    "details": null
  }
}