Website Cards

Note: To associate a card with a Tweet, use the card_uri parameter with either the POST accounts/:account_id/tweet, POST statuses/update, or POST accounts/:account_id/scheduled_tweets endpoints.

GET accounts/:account_id/cards/website

Retrieve details for some or all website cards associated with the current account.

Resource URL

https://ads-api.twitter.com/8/accounts/:account_id/cards/website

Parameters

Name Description
account_id
required

The identifier for the leveraged account. Appears within the resource's path and is generally a required parameter for all Advertiser API requests excluding GET accounts. The specified account must be associated with the authenticated user.

Type: string

Example: 18ce54d4x5t

card_ids
optional

Scope the response to just the desired website cards by specifying a comma-separated list of identifiers. Up to 200 IDs may be provided.

Type: string

Example: 59wh0

count
optional

Specifies the number of records to try and retrieve per distinct request.

Type: int

Default: 200
Min, Max: 1, 1000
cursor
optional

Specifies a cursor to get the next page of results. See Pagination for more information.

Type: string

Example: 8x7v00oow

q
optional

An optional query to scope cards by name. Omit this parameter to retrieve all. Maximum length: 80 characters.

Type: string

Example: shuttle

sort_by
optional

Sorts by supported attribute in ascending or descending order. See Sorting for more information.

Type: string

Example: created_at-asc

with_deleted
optional

Include deleted results in your request.

Type: boolean

Default: false
Possible values: true, false
with_total_count
optional

Include the total_count response attribute.

Note: This parameter and cursor are exclusive.

Note: Requests which include total_count will have lower rate limits, currently set at 200 per 15 minutes.

Type: boolean

Default: false
Possible values: true, false

Example Request

GET https://ads-api.twitter.com/8/accounts/18ce54d4x5t/cards/website?card_ids=59wh0

Example Response

{
  "request": {
    "params": {
      "card_type": "website",
      "card_ids": [
        "59wh0"
      ],
      "account_id": "18ce54d4x5t"
    }
  },
  "next_cursor": null,
  "data": [
    {
      "name": "website card",
      "website_shortened_url": "https://t.co/zadeUSVD18",
      "image_display_height": "418",
      "media_url": "https://pbs.twimg.com/media/DUKjmp8V4AAhrrB.jpg",
      "website_display_url": "developer.twitter.com",
      "id": "59wh0",
      "website_dest_url": "https://developer.twitter.com",
      "created_at": "2018-01-27T00:15:19Z",
      "media_key": "3_955505955445268480",
      "image_display_width": "800",
      "website_title": "Twitter Developers",
      "card_uri": "card://957044309437526017",
      "website_url": "https://developer.twitter.com",
      "updated_at": "2018-01-27T00:15:19Z",
      "deleted": false,
      "card_type": "WEBSITE"
    }
  ]
}

GET accounts/:account_id/cards/website/:card_id

Retrieve a specific website card associated with the current account.

Resource URL

https://ads-api.twitter.com/8/accounts/:account_id/cards/website/:card_id

Parameters

Name Description
account_id
required

The identifier for the leveraged account. Appears within the resource's path and is generally a required parameter for all Advertiser API requests excluding GET accounts. The specified account must be associated with the authenticated user.

Type: string

Example: 18ce54d4x5t

card_id
required

A reference to the website card you are operating with in the request.

Type: string

Example: 59wh0

with_deleted
optional

Include deleted results in your request.

Type: boolean

Default: false
Possible values: true, false

Example Request

GET https://ads-api.twitter.com/8/accounts/18ce54d4x5t/cards/website/59wh0

Example Response

{
  "request": {
    "params": {
      "card_type": "website",
      "card_id": "59wh0",
      "account_id": "18ce54d4x5t"
    }
  },
  "data": {
    "name": "website card",
    "website_shortened_url": "https://t.co/zadeUSVD18",
    "image_display_height": "418",
    "media_url": "https://pbs.twimg.com/media/DUKjmp8V4AAhrrB.jpg",
    "website_display_url": "developer.twitter.com",
    "id": "59wh0",
    "website_dest_url": "https://developer.twitter.com",
    "created_at": "2018-01-27T00:15:19Z",
    "media_key": "3_955505955445268480",
    "image_display_width": "800",
    "website_title": "Twitter Developers",
    "card_uri": "card://957044309437526017",
    "website_url": "https://developer.twitter.com",
    "updated_at": "2018-01-27T00:15:19Z",
    "deleted": false,
    "card_type": "WEBSITE"
  }
}

POST accounts/:account_id/cards/website

Create a new website card associated with the current account.

Resource URL

https://ads-api.twitter.com/8/accounts/:account_id/cards/website

Parameters

Name Description
account_id
required

The identifier for the leveraged account. Appears within the resource's path and is generally a required parameter for all Advertiser API requests excluding GET accounts. The specified account must be associated with the authenticated user.

Type: string

Example: 18ce54d4x5t

media_key
required

The media key for an image to be used in this card.

Note: The image must be in the account's Media Library.

Note: A minimum image width of 800px and a width:height aspect ratio of either 1:1 or 1.91:1 is required.

Type: string

Example: 3_1151345051104991073

name
required

The name for the card.

Type: string

Example: website card

website_title
required

The title for the card.

Type: string

Example: Twitter Developers

website_url
required

The URL of the website to redirect a user to.

Type: string

Example: https://developer.twitter.com

Example Request

POST https://ads-api.twitter.com/8/accounts/18ce54d4x5t/cards/website?media_key=3_955505955445268480&name=website card&website_title=Twitter Developers&website_url=https://developer.twitter.com

Example Response

{
  "data": {
    "name": "website card",
    "website_shortened_url": "https://t.co/zadeUSVD18",
    "image_display_height": "418",
    "media_url": "https://pbs.twimg.com/media/DUKjmp8V4AAhrrB.jpg",
    "website_display_url": "developer.twitter.com",
    "id": "59wh0",
    "website_dest_url": "https://developer.twitter.com",
    "created_at": "2018-01-27T00:15:19Z",
    "media_key": "3_955505955445268480",
    "image_display_width": "800",
    "website_title": "Twitter Developers",
    "card_uri": "card://957044309437526017",
    "website_url": "https://developer.twitter.com",
    "updated_at": "2018-01-27T00:15:19Z",
    "deleted": false,
    "card_type": "WEBSITE"
  },
  "request": {
    "params": {
      "name": "website card",
      "website_shortened_url": "https://t.co/zadeUSVD18",
      "image_display_height": "418",
      "media_url": "https://pbs.twimg.com/media/DUKjmp8V4AAhrrB.jpg",
      "media_key": "3_955505955445268480",
      "website_display_url": "developer.twitter.com",
      "account_id": "18ce54d4x5t",
      "website_dest_url": "https://developer.twitter.com",
      "image_display_width": "800",
      "website_title": "Twitter Developers",
      "website_url": "https://developer.twitter.com",
      "card_type": "WEBSITE"
    }
  }
}

PUT accounts/:account_id/cards/website/:card_id

Update the specified website card belonging to the current account.

Resource URL

https://ads-api.twitter.com/8/accounts/:account_id/cards/website/:card_id

Parameters

Name Description
account_id
required

The identifier for the leveraged account. Appears within the resource's path and is generally a required parameter for all Advertiser API requests excluding GET accounts. The specified account must be associated with the authenticated user.

Type: string

Example: 18ce54d4x5t

card_id
required

A reference to the website card you are operating with in the request.

Type: string

Example: 4i91t

media_key
optional

The media key for an image to be used in this card.

Note: The image must be in the account's Media Library.

Note: A minimum image width of 800px and a width:height aspect ratio of either 1:1 or 1.91:1 is required.

Type: string

Example: 3_1151345051104991073

name
optional

The name for the card.

Type: string

Example: coffee card

website_title
optional

The title for the card.

Type: string

Example: Twitter Developers

website_url
optional

The URL of the website to redirect a user to.

Type: string

Example: https://twittercommunity.com/c/advertiser-api

Example Request

PUT https://ads-api.twitter.com/8/accounts/18ce54d4x5t/cards/website/59w2c?name=coffee card

Example Response

{
  "data": {
    "name": "coffee card",
    "website_shortened_url": "https://t.co/TvmIOd0wXq",
    "image_display_height": "418",
    "media_url": "https://pbs.twimg.com/media/DUKjmp8V4AAhrrB.jpg",
    "website_display_url": "developer.twitter.com",
    "id": "59w2c",
    "website_dest_url": "https://developer.twitter.com/",
    "created_at": "2018-01-26T21:11:48Z",
    "media_key": "3_955505955445268480",
    "image_display_width": "800",
    "website_title": "Twitter Developers",
    "card_uri": "card://956998127856177153",
    "website_url": "https://developer.twitter.com/",
    "updated_at": "2018-01-27T00:20:18Z",
    "deleted": false,
    "card_type": "WEBSITE"
  },
  "request": {
    "params": {
      "account_id": "18ce54d4x5t",
      "card_type": "WEBSITE",
      "card_id": "59w2c",
      "name": "coffee card"
    }
  }
}

DELETE accounts/:account_id/cards/website/:card_id

Permanently delete the specified website card belonging to the current account.

Note: This is a hard delete. As a result, it is not possible to retrieve deleted cards.

Resource URL

https://ads-api.twitter.com/8/accounts/:account_id/cards/website/:card_id

Parameters

Name Description
account_id
required

The identifier for the leveraged account. Appears within the resource's path and is generally a required parameter for all Advertiser API requests excluding GET accounts. The specified account must be associated with the authenticated user.

Type: string

Example: 18ce54d4x5t

card_id
required

A reference to the website card you are operating with in the request.

Type: string

Example: 4i91t

Example Request

DELETE https://ads-api.twitter.com/8/accounts/18ce54d4x5t/cards/website/4i91t

Example Response

{
  "data": {
    "name": "website card",
    "id": "4i91t",
    "created_at": "2017-07-08T06:05:17Z",
    "updated_at": "2017-08-23T13:33:50Z",
    "deleted": true,
    "card_type": "WEBSITE"
  },
  "request": {
    "params": {
      "card_id": "4i91t",
      "card_type": "website",
      "account_id": "18ce54d4x5t"
    }
  }
}

Was this document helpful?

Thank you

Thank you for the feedback. We’re really glad we could help!

Thank you for the feedback. How could we improve this document?

Thank you for the feedback. Your comments will help us improve our documents in the future.