Product docs
- Getting started
- Platform and account
- Products
- Product Overview
- Tengence Search
- Product Overview
- Use cases: which businesses Tengence Search fits
- Getting started
- Search Setup: App, Dataset, Index, First Query
- OpenSearch Spring Boot Starter Integration
- Elasticsearch Spring Boot Starter Integration
- Guides
- Index Concepts and Configuration Guide
- Index Schema Reference
- Search Ranking and Weighting Configuration
- Ranking Factors and Functions Reference
- Search Suggestions and Intervention Rules
- Developer reference
- Search API Reference
- Search API Integration and Examples
- Search Widget Integration
- Operations and support
- Search Operations and Monitoring
- Search Troubleshooting
- Query Rules and Query Intervention
- Search Log Collection Policy
- Query Understanding Configuration
- Tengence GEO
- Tengence Recommendation
- Tengence Insight
- Data Integration
- Integration and API
- Solutions
- Concepts and metrics
Push data by API
Push records to a Tengence dataset over HTTPS. Set the unique ID, authenticate with API key or token, and upsert or delete records.
API push writes business records to a Tengence dataset over HTTPS. Use it when an application already has a server and needs to create, update or delete records by a stable unique ID, without waiting for a file import or a MySQL schedule.
The integration app owns the endpoint, API key, ID field and field mapping. Your application sends JSON records; Tengence stores them in the bound dataset and makes them available to Search, GEO, Recommendation and Insight.
When to use API push
- Product, order, inventory or content records change during the day.
- Another system must write a record and have it searchable without a scheduled batch.
- You need to delete a record by ID, not rebuild the whole dataset.
- You want one record-level API instead of a file or database connector.
Create an API push app
- Open Data Integration → Apps and select + New App. Choose Free and select Create.
- On the app detail page, select Configure Data Source.
- Select API push.
- Enter the unique ID field, for example
product_id. Every record you push must contain this field. - Select Save. The app status becomes Running and a dataset is created with the ID field.
- Copy the Data push URL and API Key from Connection Configuration. Treat the API key as a server-side secret.

Endpoints and headers
| Item | Value |
|---|---|
| Data push URL | https://api.tengence.com/v1/push/data |
| Method | POST |
| Content-Type | application/json |
| Authorization | Bearer <API_KEY> or Bearer <ACCESS_TOKEN> |
| Delete header | X-Tengence-Operation: DELETE |
The app must be Running. If the app is stopped, the API returns APP_NOT_RUNNING. You do not send a dataset ID; the API key resolves the app and its dataset.
Authentication: API key or access token
Two credential models are supported. Use the API key for server-to-server jobs where the secret can be stored in a vault. Use the access token flow when a short-lived credential is required.
Option A: API key directly
curl -X POST "https://api.tengence.com/v1/push/data" \
-H "Authorization: Bearer sk-your-api-key" \
-H "Content-Type: application/json" \
-d '{"product_id":"P1001","title":"Aurora Lounge Chair","price":1299}'
The API key is shown on the app detail page. Never put it in browser code, mobile packages or public repositories.
Option B: exchange API key for an access token
Issue a short-lived access token from a server you control:
POST https://api.tengence.com/v1/app/auth/token/issue
Content-Type: application/json
{"apiKey":"sk-your-api-key"}
The response returns accessToken, accessExpAt, refreshToken and refreshExpAt. The access token is valid for 15 minutes. Refresh it before expiry:
POST https://api.tengence.com/v1/app/auth/token/refresh
Content-Type: application/json
{"refreshToken":"rt-your-refresh-token"}
Use the returned accessToken as the Bearer credential on push requests. Revoke a refresh token when a client is decommissioned:
POST https://api.tengence.com/v1/app/auth/token/revoke
Content-Type: application/json
{"refreshToken":"rt-your-refresh-token"}
Never issue tokens from a public web page. The API key and refresh token are server-side secrets; the access token is short-lived but still sensitive.
Write one record
curl -X POST "https://api.tengence.com/v1/push/data" \
-H "Authorization: Bearer sk-your-api-key" \
-H "Content-Type: application/json" \
-d '{
"product_id": "P1001",
"title": "Aurora Lounge Chair",
"category": "Seating",
"price": 1299,
"currency": "CNY",
"stock_status": "in_stock"
}'
A single record is a JSON object, not an array. The response reports how many records were accepted, inserted, deleted, and failed:
{
"code": "SUCCESS",
"message": "Operation successful",
"data": {
"total": 1,
"upsert_count": 1,
"delete_count": 0,
"fail_count": 0
}
}
Write a batch
Send up to 1,000 records in a data array. The whole request must stay under 5 MB and each record under 512 KB.
curl -X POST "https://api.tengence.com/v1/push/data" \
-H "Authorization: Bearer sk-your-api-key" \
-H "Content-Type: application/json" \
-d '{
"data": [
{"product_id":"P1001","title":"Aurora Lounge Chair","price":1299},
{"product_id":"P1002","title":"Aurora Dining Table","price":3299},
{"product_id":"P1003","title":"Aurora Floor Lamp","price":699}
]
}'
How create, update and delete work
Tengence uses the configured ID field as the record key. The write mode is full-record replacement by ID, not a partial merge. The following rules are the contract you should design against.
| You send | Result | What happens to other fields |
|---|---|---|
| A new ID with fields | Insert | All provided fields are stored. |
| An existing ID with fields | Update | The stored record is replaced by the new record. Fields you omit are removed. |
An existing ID with a field set to null |
Update | That field is removed. Other fields you provide remain. |
| An existing ID with an empty string | Update | The field is stored as empty; it is not treated as a delete. |
| An existing ID with no other non-empty field | Delete | The record is removed. |
An existing ID with X-Tengence-Operation: DELETE |
Delete | The record is removed even if other fields are present. |
| A field that did not exist before | Schema extension | The new field is added to the dataset automatically. |
Omission is deletion. If you update a product with only product_id and price, the previous title, category and stock status are removed. Send the full record you want to keep, or use a partial-update strategy in your own source of truth.
A record with only the ID and no other non-empty field is treated as a delete request. This is why sending {"product_id":"P1001"} removes P1001, and why sending {"product_id":"P1001","title":null} also removes it when no other field is present.
Duplicates, retries and concurrency
- There is no separate idempotency key. Repeating the same full record produces the same final state.
- Repeating a delete is a no-op once the record is gone.
- If two requests update the same ID at nearly the same time, the last processed request wins. Avoid concurrent writers for one ID.
- Within one batch, keep one record per ID. Split conflicting updates into separate requests and order them in your application.
- New fields extend the dataset schema, but existing downstream field mappings do not update automatically. Re-check the product mapping after a schema change.

Limits
| Limit | Value | Behavior when exceeded |
|---|---|---|
| Records per request | 1,000 | Whole request rejected with BATCH_SIZE_EXCEEDED. |
| Single record size | 512 KB | Whole request rejected with SINGLE_DATA_SIZE_EXCEEDED. |
| Request payload | 5 MB | Whole request rejected with BATCH_PAYLOAD_SIZE_EXCEEDED. |
| ID length | 64 characters | Record rejected with ID_FIELD_TOO_LONG. |
| App status | Running | Request rejected with APP_NOT_RUNNING. |
Response and error codes
| Code | When it appears | What to do |
|---|---|---|
APP_NOT_RUNNING |
The integration app is stopped or not started | Start the app and retry. |
DATA_ITEM_EMPTY |
A batch contains an empty object | Remove empty objects. |
DATA_FORMAT_INVALID |
Body is not a JSON object or the data array is invalid | Send an object or {"data":[...]}. |
ID_FIELD_MISSING |
A record does not contain the configured ID field | Add the ID field to every record. |
ID_FIELD_EMPTY |
The ID value is empty | Use a non-empty unique value. |
ID_FIELD_TOO_LONG |
The ID is longer than 64 characters | Shorten the ID or hash it. |
BATCH_SIZE_EXCEEDED |
More than 1,000 records | Split the batch. |
SINGLE_DATA_SIZE_EXCEEDED |
One record is over 512 KB | Reduce the record or split large text fields. |
BATCH_PAYLOAD_SIZE_EXCEEDED |
The whole request is over 5 MB | Split the batch. |
Verify the write
- Open Data Center → Datasets and select the dataset linked to the app.
- Check Record count. It should change by the number of new IDs, not by the number of requests.
- Open Preview and confirm that updated fields contain the new values and omitted fields are gone.
- If the dataset is bound to Search, rebuild or refresh the index according to the Search guide before expecting new records in search results.
Billing
API push consumes dataset storage in your package. The request itself is not a separate line item. Deleted records no longer count toward the dataset record count. See Plans and usage for the package quota.
FAQ
Is API push an upsert or a partial update?
It is a full-record replacement by ID. A new ID inserts; an existing ID is replaced. Fields you omit are removed.
How do I update only one field?
Read the current record from your source of truth, change the field, and send the complete record. Tengence does not merge partial objects.
How do I delete a record?
Send only the ID, or send the full record with the header X-Tengence-Operation: DELETE.
Can I use the API key in a browser?
No. Use the API key only from a trusted server. For browser-side behavioral events, use the JavaScript SDK with a short-lived token.
Does a new field appear in Search immediately?
The field is added to the dataset, but the Search index mapping may need a refresh. Check the Search index configuration after a schema change.
On this page
- When to use API push
- Create an API push app
- Endpoints and headers
- Authentication: API key or access token
- Option A: API key directly
- Option B: exchange API key for an access token
- Write one record
- Write a batch
- How create, update and delete work
- Duplicates, retries and concurrency
- Limits
- Response and error codes
- Verify the write
- Billing
- FAQ
- Is API push an upsert or a partial update?
- How do I update only one field?
- How do I delete a record?
- Can I use the API key in a browser?
- Does a new field appear in Search immediately?