API V1 is deprecated, Check out new API V2 here

Posts

posts#collect - Add a post to a collection

Parameters

Name Description
collection_id required The numeric ID of the collection

Request

Route

POST /v1/posts/1469/collect

Headers

Accept: application/json
Content-Type: application/json
Authorization: Bearer your_access_token
Host: api.producthunt.com

Body

{
  "collection_id": 1162
}

Response

Status

201 Created

Headers

X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
X-Rate-Limit-Limit: 900
X-Rate-Limit-Remaining: 900
X-Rate-Limit-Reset: 900
Content-Type: application/json; charset=utf-8
ETag: W/"2765cf635f3d0ebdddbe9373ff7afcea"
Cache-Control: max-age=0, private, must-revalidate
Content-Length: 7294

Body

{
  "collected_post": {
    "id": 131,
    "post_id": 1469,
    "collection_id": 1162,
    "collection": {
      "id": 1162,
      "name": "Awesome Collection #1",
      "title": "Best new collection ever",
      "created_at": "2021-05-05T04:39:10.924-07:00",
      "updated_at": "2021-05-05T04:39:11.013-07:00",
      "featured_at": null,
      "subscriber_count": 0,
      "background_image_url": null,
      "category_id": null,
      "collection_url": "http://www.producthunt.com/@producthunter328/collections/awesome-collection-1?utm_campaign=producthunt-api\u0026utm_medium=api\u0026utm_source=Application%3A+Awesome+Oauth+App+%2334+%28ID%3A+1224%29",
      "color": "blue",
      "posts_count": 1,
      "user": {
        "id": 9804,
        "created_at": "2021-05-05T04:39:10.914-07:00",
        "name": "Karl User the 328th",
        "username": "producthunter328",
        "headline": "Product Hunter",
        "twitter_username": "hunter328",
        "website_url": "http://awesome.io",
        "profile_url": "http://www.producthunt.com/@producthunter328",
        "image_url": {
          "30px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "32px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "40px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "44px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "48px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "50px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "60px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "64px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "73px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "80px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "88px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "96px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "100px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "110px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "120px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "132px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "146px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "160px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "176px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "220px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "264px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "32px@2X": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "40px@2X": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "44px@2X": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "88px@2X": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "32px@3X": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "40px@3X": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "44px@3X": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "88px@3X": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
          "original": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress"
        }
      },
      "posts": [
        {
          "comments_count": 0,
          "id": 1469,
          "name": "Awesome Idea #60",
          "product_state": "default",
          "tagline": "Great new search engine",
          "slug": "awesome-idea-60",
          "votes_count": 0,
          "day": "2021-05-05",
          "category_id": null,
          "created_at": "2021-05-05T04:39:10.962-07:00",
          "current_user": {
            "voted_for_post": false,
            "commented_on_post": false
          },
          "discussion_url": "http://www.producthunt.com/posts/awesome-idea-60?utm_campaign=producthunt-api\u0026utm_medium=api\u0026utm_source=Application%3A+Awesome+Oauth+App+%2334+%28ID%3A+1224%29",
          "exclusive": null,
          "featured": true,
          "ios_featured_at": false,
          "maker_inside": false,
          "makers": [],
          "platforms": [],
          "redirect_url": "http://www.producthunt.com/r/02161edf8b61cd/1469?app_id=1224",
          "screenshot_url": {
            "300px": "http://placehold.it/850x850.png",
            "850px": "http://placehold.it/850x850.png"
          },
          "thumbnail": {
            "id": 1525,
            "media_type": "image",
            "image_url": "https://ph-files.imgix.net/cf1acb6e-6fa1-4098-a66b-41634a5b16e3?auto=format\u0026fit=crop\u0026h=570\u0026w=430",
            "metadata": {}
          },
          "topics": [],
          "user": {
            "id": 9806,
            "created_at": "2021-05-05T04:39:10.941-07:00",
            "name": "Karl User the 330th",
            "username": "producthunter330",
            "headline": "Product Hunter",
            "twitter_username": "hunter330",
            "website_url": "http://awesome.io",
            "profile_url": "http://www.producthunt.com/@producthunter330",
            "image_url": {
              "30px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
              "32px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
              "40px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
              "44px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
              "48px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
              "50px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
              "60px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
              "64px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
              "73px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
              "80px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
              "88px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
              "96px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
              "100px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
              "110px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
              "120px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
              "132px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
              "146px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
              "160px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
              "176px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
              "220px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
              "264px": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
              "32px@2X": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
              "40px@2X": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
              "44px@2X": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
              "88px@2X": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
              "32px@3X": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
              "40px@3X": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
              "44px@3X": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
              "88px@3X": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress",
              "original": "https://ph-static.imgix.net/guest-user-avatar.png?auto=format\u0026auto=compress"
            }
          }
        }
      ]
    }
  }
}