How do I associate a website card to a line_item?


I’m not seeing how to associate a website card to a line_item in the advertiser API.

This POST endpoint makes no mention of how to pass the ID of a tweet, or card. I think I’m missing something.

Create a promotional Tweet with Website Card

You can associate a promoted tweet with a line item using the promoted_tweet endpoint. The documentation for that endpoint is here:


How would I associate a website card as the creative for a line_item (ad group)?

I’m not seeing how this is done.

Thanks for your help!


It’s quite simple. Add preview_url to your tweet status :smiley:


Thanks @hector_borras! I will try this out and keep you guys posted.


Hi @sealabcore did you try this? did it work?
It looks like more of a hack than a proper solution to achieve this goal…


Hi @billyyotpo ,

This is not a hack. If you look into Twitter Ads API documentation.

You should create a Tweet and concatenate yout tweet status with card’s preview_url, after that, you should post a promoted ad with this endpoint: with your line_item id and your tweet_id

Hopefully this will help you.



@billyyotpo Yeah it doesn’t feel like a hack and it works totally fine for us.


Thanks both @hector_borras and @sealabcore!

So we are progressing with this solution.


Hi @hector_borras
So how would I associate a lead gen card or app card as the creative for a Tweet ?


Hi @anhtuan215

Process is really simple, but I know first time could be a little difficult to understand. Finally it isn’t different comared to Twitter Ads UI but abstracting some characteristics.

I hope if i divide the process in clear defined steps I can help you and other people that need the same solution.

First of all I should say that for Video Cards it’s a little different and I haven’t worked yet.

For the other ones.

How to associate a Twitter Ads Card to a Line Item

  1. Create your Website/App/Image App/ Lead Gen Card. As you usually do using your own images, titles and other properties that you need. Using the correct POST endpoint
  2. Retrieve from the response thet you get from the first point preview_url You should store this URL locally or in memory in order to use it later.
  3. Create a Tweet using concatenating at the end previe_url we’ve get in previous point. Be carefull with the length of your tweet.
    Note: I know that you can use organic tweets to promote them but I think is not the case we’re trying to solve.
  4. In this step we have a tweet susceptible to be a promoted tweet, and a line item without any tweet ( :cold_sweat: ) with their respective Id’s, we’re going to call it tweet_id and line_item_id
  5. Create a Promoted Tweet using providing both tweet_id and line_item_id (you can also send more than one tweet id.

Hopefully this will help you and more people!


Can't import an image on a Website Card

It is worked, thanks for your help!. so you have the solution for video cards ?


Thanks @anhtuan215

I haven’t got the solution for videocards because i’ve not worked with them yet. But I guess it could be pretty much the same…