Grava Docs

Create a dataset

POST/v1/datasets

Atomically creates a draft dataset, its single Bot, and recipe version 1. Source fields are declarative selectors; arbitrary code is not accepted or executed.

AuthorizationBearer <token>

API key shown once at creation and stored as a SHA-256 hash.

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/datasets" \  -H "Content-Type: application/json" \  -d '{    "name": "string",    "columns": [      {        "name": "string",        "type": "string"      }    ],    "source": {      "version": 1,      "url": "http://example.com",      "itemSelector": "string",      "fields": [        {          "name": "string",          "read": {}        }      ],      "identity": {        "kind": "source-key",        "field": "string"      },      "pagination": {        "kind": "none"      }    }  }'
{  "dataset": {    "schemaVersion": 1,    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "name": "string",    "question": "string",    "columns": [      {        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",        "label": "string",        "ownership": "collected",        "name": "string",        "type": "string",        "key": false,        "description": "string"      }    ],    "status": "draft",    "schedule": "string",    "rowCount": 0,    "lastRun": {      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "status": "queued",      "completedAt": "2019-08-24T14:15:22Z"    },    "createdAt": "2019-08-24T14:15:22Z",    "updatedAt": "2019-08-24T14:15:22Z"  }}