1. Create the dataset
The dataset must carry at least one identifier column that TikTok can match on. Required columns lists them.id in the response.
Required columns
The dataset needs at least one of these identifier columns:
Each identifier column is named after its Rosetta Stone attribute, and the connector matches on that column name. A column holds either a plain string or an object. In the dataset schema, declare a string column with
"type": "string", and declare an object column with "type": "object" and its properties:
2. Activate the dataset
201 with the dataset. Activation locks the schema, so activate only once the shape is settled.
3. Upload and ingest your file
Each line of the file is one row that matches the schema you declared in step 1. For the columns TikTok accepts and their shapes, see Supported identifiers and Required columns. You can load a file into a dataset over the API in two ways:- Signed-URL upload. Your integration uploads one file of up to 3 GB, then asks Narrative to ingest it.
- Managed S3 bucket. You write files to an S3 bucket that Narrative manages, and Narrative ingests each batch on its own. Use a managed bucket for files larger than 3 GB, or for files that another system delivers on a schedule.
Choose a file format
The dataset’sfile_config.type sets the format of every file you load into it. Parquet and JSON Lines both hold object columns, which nest properties inside one column:
- Parquet (
parquet) is the most compatible format for connector datasets. It stores nested struct columns and their types natively, and Narrative matches columns to the schema by name at every level. - JSON Lines (
json) holds one JSON object per line. Narrative matches each nested object to the schema by name.
flat) hold only scalar columns, so they can’t carry object columns.
Upload a file with a signed URL
Request an upload URL, then send the file straight to storage:PUT.
Then ingest the file into the dataset, passing that path as source_file:
Write files to a managed S3 bucket
A managed bucket is an S3 bucket that Narrative creates for your company. You write each batch of files into its own folder under the dataset’s path in the bucket, then write an empty_NIO_COMMIT file into that batch folder. Narrative ingests every file in the batch folder when the commit file appears, so you make no upload or ingest request. A file can be as large as S3 accepts.
See Ingesting Files from a Managed S3 Bucket to create the bucket, grant your AWS account access, and lay out the folders.
4. Confirm TikTok accepts the dataset
Before you create a connection, ask Narrative which connector interfaces the dataset satisfies:acceptedlists each interface you can connect the dataset to, by the connector’sapp_idand theinterface_id.errorslists each interface the schema does not satisfy. Itsdetailshold the reason, such as"required property '<column>' not found".
?tags=<tag> to check only the interfaces that carry that tag.
When the interface you want is under errors, the dataset’s schema doesn’t meet what the interface needs, for example a missing column or property. Activation locks the schema, so create a new dataset that fixes what the error names.
For TikTok, look for the TikTok Connector ("app_id": 19) with the audience_first_party interface in accepted. Add ?tags=tiktok to check only the TikTok interfaces. Step 5 then checks the delivery settings with TikTok itself.
5. Check your settings with TikTok
Before you create the connection, ask the connector to check the delivery settings against TikTok. This request uses the installation token. To create a new audience, name the advertiser increate_new_for and give the audience a name:
existing_audiences instead. It maps each advertiser ID to the audience IDs in that advertiser. Find an audience ID in the advertiser’s audience list:
details list has one entry for each existing audience, confirming that the audience is in its advertiser. When valid is false, validation_errors and details say why.
6. Deliver to a TikTok audience
Create a connection with the samequick_settings you checked in step 5. Both type fields are required. The outer one identifies what you are connecting, and the one inside quick_settings selects the delivery interface.
Into a new audience
audience_name in each advertiser listed in create_new_for, then fills it with the dataset’s members.
Into an existing audience
existing_audiences.
What the connection does describes every field, its allowed values, and its default.
One connection can carry both create_new_for and existing_audiences, as long as no advertiser appears in both. Record the connection id. You need it to stop the delivery.
7. Find the new audience in TikTok
List the audiences in the advertiser, as in List the audiences in an advertiser:audience_name within a few minutes of the connection’s first delivery. Its id is the audience ID in TikTok Ads Manager. Give each new audience a distinct name so you can pick it out of the list. To deliver another dataset into the same audience later, use this ID in existing_audiences.
8. Confirm the connection
"status": "active" and the quick_settings you sent.
To hear when each delivery finishes, subscribe to delivery notifications. The connector sends audience.delivery.completed when a delivery to a TikTok audience finishes.
Keeping the audience current
Write new data to the dataset with the same three calls as in step 3. The connection keeps running, so new rows reach the same TikTok audience without further calls.Stopping delivery
DELETE /datasets/{dataset_id}.
To deliver to different advertisers or audiences, delete the connection and create a new one. To keep filling an audience the old connection created, name its ID in existing_audiences.
Troubleshooting
Getting help
Contact your Narrative relationship manager with your company ID, the dataset ID, the connection ID, and the failing request and response.Related content
Sending conversion events via the API
Send offline conversions to a TikTok Offline Event Set
TikTok Connector
Supported identifiers and connector setup
Connector Interfaces
Why a dataset connects to an interface rather than a connector
API Keys
Create and rotate keys for programmatic access

