Insert Data
Try it
POST
/v0/pipelines/{pipeline_name}/ingress/{table_name}Push data to a SQL table.
The client sends data encoded using the format specified in the ?format=
parameter as a body of the request. The contents of the data must match
the SQL table schema specified in table_name
The pipeline ingests data as it arrives without waiting for the end of the request. Successful HTTP response indicates that all data has been ingested successfully.
On success, returns a completion token that can be passed to the ‘/completion_status’ endpoint to check whether the pipeline has fully processed the data.
Authentication
JSON web token (JWT) or API keyBearer token
Parameters
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
pipeline_name | string | Yes | Unique pipeline name |
table_name | string | Yes | SQL table name. Unquoted SQL names have to be capitalized. Quoted SQL names have to exactly match the case from the SQL program. |
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
force | boolean | Yes | When `true`, push data to the pipeline even if the pipeline is paused. The default value is `false` |
format | string | Yes | Input data format, either `csv' or 'json'. |
array | boolean | No | Set to `true` if updates in this stream are packaged into JSON arrays (used in conjunction with `format=json`). The default values is `false`. |
update_format | object | No | JSON data change event format (used in conjunction with `format=json`). The default value is 'insert_delete'. |
Request body
Content type: text/plain
- string
Response
200Data successfully delivered to the pipeline. The body of the response contains a completion token that can be passed to the '/completion_status' endpoint to check whether the pipeline has fully processed the data.
application/json- objectResponse to a completion token creation request.
tokenstringrequiredCompletion token. An opaque string associated with the current position in the input stream generated by an input connector. Pass this string to the `/completion_status` endpoint to check whether all inputs associated with the token have been fully processed by the pipeline.
400
application/json- objectInformation returned by REST API endpoints on error.
detailsobjectrequiredDetailed error metadata. The contents of this field is determined by `error_code`.error_codestringrequiredError code is a string that specifies this error type.messagestringrequiredHuman-readable error message.
404Pipeline and/or table with that name does not exist
application/json- objectInformation returned by REST API endpoints on error.
detailsobjectrequiredDetailed error metadata. The contents of this field is determined by `error_code`.error_codestringrequiredError code is a string that specifies this error type.messagestringrequiredHuman-readable error message.
500
application/json- objectInformation returned by REST API endpoints on error.
detailsobjectrequiredDetailed error metadata. The contents of this field is determined by `error_code`.error_codestringrequiredError code is a string that specifies this error type.messagestringrequiredHuman-readable error message.
503
application/json- objectInformation returned by REST API endpoints on error.
detailsobjectrequiredDetailed error metadata. The contents of this field is determined by `error_code`.error_codestringrequiredError code is a string that specifies this error type.messagestringrequiredHuman-readable error message.
curl -X POST 'https://api.example.com/v0/pipelines/{pipeline_name}/ingress/{table_name}?force=<force>&format=<format>&array=<array>&update_format=<update_format>' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: text/plain' \
-d '"string"'const response = await fetch('https://api.example.com/v0/pipelines/{pipeline_name}/ingress/{table_name}?force=<force>&format=<format>&array=<array>&update_format=<update_format>', {
method: 'POST',
headers: {
'Content-Type': 'text/plain',
'Authorization': 'Bearer YOUR_TOKEN'
},
body: JSON.stringify("string")
});
const data = await response.json();
console.log(data);interface ApiResponse {
// shape your response here
}
const response: Response = await fetch('https://api.example.com/v0/pipelines/{pipeline_name}/ingress/{table_name}?force=<force>&format=<format>&array=<array>&update_format=<update_format>', {
method: 'POST',
headers: {
'Content-Type': 'text/plain',
'Authorization': 'Bearer YOUR_TOKEN'
},
body: JSON.stringify("string")
});
const data = (await response.json()) as ApiResponse;
console.log(data);import requests
url = "https://api.example.com/v0/pipelines/{pipeline_name}/ingress/{table_name}"
params = {
"force": "<force>",
"format": "<format>",
"array": "<array>",
"update_format": "<update_format>"
}
headers = {
"Content-Type": "text/plain",
"Authorization": "Bearer YOUR_TOKEN"
}
payload = "string"
response = requests.request("post", url, params=params, headers=headers, json=payload)
print(response.json())package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
body := strings.NewReader(`"string"`)
req, err := http.NewRequest("POST", "https://api.example.com/v0/pipelines/{pipeline_name}/ingress/{table_name}?force=<force>&format=<format>&array=<array>&update_format=<update_format>", body)
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "text/plain")
req.Header.Set("Authorization", "Bearer YOUR_TOKEN")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
out, _ := io.ReadAll(resp.Body)
fmt.Println(string(out))
}