Openi DeveloperDeveloper

Add field(s) to dataset

Accepts either a single field input or an array of inputs. Returns the same shape (single object or array) as inserted. Fails 409 (`IDENTITY_EXISTS`) if any input has `isIdentity=true` and the dataset already has an identity field, and 400 (`INVALID_TRANSFORM_EXPR`) when `transform_expr` does not compile.

POST
/v1/datasets/{id}/fields

Authorization

ApiKeyAuth
x-api-key<token>

Tenant API key

In: header

Path Parameters

id*string
Formatuuid

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

name*string
Length1 <= length
type*string
Length1 <= length
key*string
Match^[A-Za-z][A-Za-z0-9_.-]{0,63}$
Length1 <= length <= 64
sourcePath?string

Dot-path inside the record body to extract.

transform_expr?string

Optional JSONata transform applied to the source value before storage.

Lengthlength <= 65536
isIdentity?boolean

Marks the field as the dataset's identity (only one allowed per dataset).

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/v1/datasets/497f6eca-6276-4993-bfeb-53cbbbba6f08/fields" \  -H "Content-Type: application/json" \  -d '{    "name": "string",    "type": "string",    "key": "string"  }'
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "dataset_id": "8c4c51f1-f6f3-43bc-b65d-7415e8ef22c0",  "name": "string",  "type": "string",  "key": "string",  "source_path": "string",  "transform_expr": "string",  "is_identity": true,  "created_at": "2019-08-24T14:15:22Z"}