NAV Navbar
shell javascript

Introduction

Welcome to the Tribe API!

We have language bindings in Shell and JavaScript! You can view code examples in the dark area to the right, and you can switch the programming language of the examples with the tabs in the top right.

Authentication

To authorize, use this code:

# With shell, you can just pass the correct header with each request
curl "api_endpoint_here"
  -H "Authorization: <YourAccessToken>"
const tribe = require('tribe');

let api = tribe.authorize('<YourAccessToken>');

Make sure to replace <YourAccessToken> with your API key.

Tribe uses API keys to allow access to the API. You can request a new Tribe API key by contacting us.

Tribe expects for the API key to be included in all API requests to the server in a header that looks like the following:

Authorization: <YourAccessToken>

Answers

Get All Answers

curl "https://community.tribe.so/api/v1/answers"
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let answers = api.answers.get();

The above command returns JSON structured like this:

[
  {
    "_id": "5bf0e89ada3be54c190b78ba",
    "updatedAt": "2018-12-03T22:20:11.069Z",
    "createdAt": "2018-11-18T04:20:42.892Z",
    "draftContent": "",
    "portal": "5a73b1fcc48071e4c4dc1cae",
    "question": {
      "_id": "5bf0e860da3be54c190b78b8",
      "shortId": "5okGL",
      "updatedAt": "2018-12-03T23:26:53.588Z",
      "createdAt": "2018-11-18T04:19:44.936Z",
      "title": "Can I embed external services (YouTube, Vimeo, etc.) in my answers or posts?",
      "user": {
        "_id": "5bacc9ff630b876a1e9785f7",
        "profile": {
          "counts": {
            "requests": 0,
            "edits": 0,
            "questionsFollowers": 0,
            "questions": 8,
            "comments": 0,
            "answersWords": 615,
            "answersVotes": 0,
            "answersViews": 0,
            "answers": 3,
            "views": 0,
            "followings": 0,
            "followers": 0
          },
          "score": 13,
          "externalId": null,
          "verified": false,
          "description": "",
          "title": "",
          "picture": "/files/users/5f7/5bacc9ff630b876a1e9785f7_15302.png",
          "website": "",
          "location": "",
          "gender": "",
          "name": "Robert D",
          "username": "robertd"
        },
        "id": "5bacc9ff630b876a1e9785f7"
      },
      "publishedAt": "2018-11-18T04:19:44.933Z",
      "portal": "5a73b1fcc48071e4c4dc1cae",
      "lastAskedAt": "2018-11-18T04:19:44.933Z",
      "actor": "5b1f99a7478dd3768d84b646",
      "__v": 1,
      "lastAnsweredAt": "2018-11-18T04:25:42.040Z",
      "referrers": [],
      "rewards": [],
      "hasReward": false,
      "downvotes": [],
      "upvotes": [],
      "followers": [],
      "askers": [],
      "comments": [],
      "topics": [
        {
          "_id": "5b88264d3d9228aa7c41f692",
          "name": "Tribe",
          "user": {
            "_id": "5b881b2a90ecbe6751123d7e",
            "profile": {
              "counts": {
                "requests": 2,
                "edits": 148,
                "questionsFollowers": 0,
                "questions": 32,
                "comments": 0,
                "answersWords": 5753,
                "answersVotes": 0,
                "answersViews": 0,
                "answers": 31,
                "views": 0,
                "followings": 1,
                "followers": 2
              },
              "score": 115,
              "externalId": null,
              "verified": false,
              "description": "<p>&nbsp;</p>",
              "title": "Biomedical Engineer ",
              "picture": "/files/users/d7e/5b881b2a90ecbe6751123d7e_57697.png",
              "website": "",
              "location": "",
              "gender": "",
              "name": "Elnaz Najafi",
              "username": "elnajafi89"
            },
            "id": "5b881b2a90ecbe6751123d7e"
          },
          "picture": "/files/topics/692/5b88264d3d9228aa7c41f692_72807.png",
          "id": "5b88264d3d9228aa7c41f692"
        }
      ],
      "score": 0,
      "status": "published",
      "counts": {
        "asks": 1,
        "downvotes": 0,
        "upvotes": 0,
        "edits": 2,
        "comments": 0,
        "hiddenAnswers": 0,
        "answers": 1,
        "views": 33,
        "followers": 0
      },
      "type": "general",
      "privacy": "public",
      "anonymous": false,
      "verified": false,
      "locked": false,
      "id": "5bf0e860da3be54c190b78b8"
    },
    "user": {
      "_id": "5b1f99a7478dd3768d84b646",
      "profile": {
        "counts": {
          "requests": 2,
          "edits": 46,
          "questionsFollowers": 0,
          "questions": 2,
          "comments": 2,
          "answersWords": 1586,
          "answersVotes": 0,
          "answersViews": 0,
          "answers": 12,
          "views": 0,
          "followings": 3,
          "followers": 3
        },
        "score": 52,
        "externalId": null,
        "verified": true,
        "description": "<p>&nbsp;</p>",
        "title": "Tribe Moderator",
        "picture": "/files/users/646/5b1f99a7478dd3768d84b646_66172.png",
        "website": "",
        "location": "",
        "gender": "male",
        "name": "Siavash Mahmoudian",
        "username": "siavash"
      },
      "id": "5b1f99a7478dd3768d84b646",
      "followed": false
    },
    "__v": 1,
    "publishedAt": "2018-11-18T04:25:42.037Z",
    "shortId": "PEVpN",
    "downvotes": [],
    "upvotes": [
      "5bc64d97a8c76d6d771ae914"
    ],
    "comments": [],
    "rewards": [],
    "images": [],
    "links": [],
    "score": 0,
    "global": true,
    "status": "published",
    "media": [],
    "counts": {
      "reasks": 0,
      "edits": 2,
      "downvotes": 0,
      "upvotes": 1,
      "comments": 0,
      "views": 34
    },
    "privacy": "public",
    "anonymous": false,
    "verified": false,
    "summary": "...",
    "id": "5bf0e89ada3be54c190b78ba",
    "upvoted": false,
    "downvoted": false,
    "intro": "..."
  }
]

This endpoint retrieves all answers.

HTTP Request

GET /api/v1/answers

Query Parameters

Parameter Type Default Description
page Number 1 Intended page
limit Number 20 Number of items per page
sort String createdAt.desc The field to sort on

Get a Specific Answer

curl "https://community.tribe.so/api/v1/answers/5bf0e89ada3be54c190b78ba"
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let answers = api.answers.get('5bf0e89ada3be54c190b78ba');

The above command returns JSON structured like this:

{
  "_id": "5bf0e89ada3be54c190b78ba",
  "updatedAt": "2018-12-03T22:20:11.069Z",
  "createdAt": "2018-11-18T04:20:42.892Z",
  "draftContent": "",
  "portal": "5a73b1fcc48071e4c4dc1cae",
  "question": {
    "_id": "5bf0e860da3be54c190b78b8",
    "shortId": "5okGL",
    "updatedAt": "2018-12-03T23:26:53.588Z",
    "createdAt": "2018-11-18T04:19:44.936Z",
    "title": "Can I embed external services (YouTube, Vimeo, etc.) in my answers or posts?",
    "user": {
      "_id": "5bacc9ff630b876a1e9785f7",
      "profile": {
        "counts": {
          "requests": 0,
          "edits": 0,
          "questionsFollowers": 0,
          "questions": 8,
          "comments": 0,
          "answersWords": 615,
          "answersVotes": 0,
          "answersViews": 0,
          "answers": 3,
          "views": 0,
          "followings": 0,
          "followers": 0
        },
        "score": 13,
        "externalId": null,
        "verified": false,
        "description": "",
        "title": "",
        "picture": "/files/users/5f7/5bacc9ff630b876a1e9785f7_15302.png",
        "website": "",
        "location": "",
        "gender": "",
        "name": "Robert D",
        "username": "robertd"
      },
      "id": "5bacc9ff630b876a1e9785f7"
    },
    "publishedAt": "2018-11-18T04:19:44.933Z",
    "portal": "5a73b1fcc48071e4c4dc1cae",
    "lastAskedAt": "2018-11-18T04:19:44.933Z",
    "actor": "5b1f99a7478dd3768d84b646",
    "__v": 1,
    "lastAnsweredAt": "2018-11-18T04:25:42.040Z",
    "referrers": [],
    "rewards": [],
    "hasReward": false,
    "downvotes": [],
    "upvotes": [],
    "followers": [],
    "askers": [],
    "comments": [],
    "topics": [
      {
        "_id": "5b88264d3d9228aa7c41f692",
        "name": "Tribe",
        "user": {
          "_id": "5b881b2a90ecbe6751123d7e",
          "profile": {
            "counts": {
              "requests": 2,
              "edits": 148,
              "questionsFollowers": 0,
              "questions": 32,
              "comments": 0,
              "answersWords": 5753,
              "answersVotes": 0,
              "answersViews": 0,
              "answers": 31,
              "views": 0,
              "followings": 1,
              "followers": 2
            },
            "score": 115,
            "externalId": null,
            "verified": false,
            "description": "<p>&nbsp;</p>",
            "title": "Biomedical Engineer ",
            "picture": "/files/users/d7e/5b881b2a90ecbe6751123d7e_57697.png",
            "website": "",
            "location": "",
            "gender": "",
            "name": "Elnaz Najafi",
            "username": "elnajafi89"
          },
          "id": "5b881b2a90ecbe6751123d7e"
        },
        "picture": "/files/topics/692/5b88264d3d9228aa7c41f692_72807.png",
        "id": "5b88264d3d9228aa7c41f692"
      }
    ],
    "score": 0,
    "status": "published",
    "counts": {
      "asks": 1,
      "downvotes": 0,
      "upvotes": 0,
      "edits": 2,
      "comments": 0,
      "hiddenAnswers": 0,
      "answers": 1,
      "views": 33,
      "followers": 0
    },
    "type": "general",
    "privacy": "public",
    "anonymous": false,
    "verified": false,
    "locked": false,
    "id": "5bf0e860da3be54c190b78b8"
  },
  "user": {
    "_id": "5b1f99a7478dd3768d84b646",
    "profile": {
      "counts": {
        "requests": 2,
        "edits": 46,
        "questionsFollowers": 0,
        "questions": 2,
        "comments": 2,
        "answersWords": 1586,
        "answersVotes": 0,
        "answersViews": 0,
        "answers": 12,
        "views": 0,
        "followings": 3,
        "followers": 3
      },
      "score": 52,
      "externalId": null,
      "verified": true,
      "description": "<p>&nbsp;</p>",
      "title": "Tribe Moderator",
      "picture": "/files/users/646/5b1f99a7478dd3768d84b646_66172.png",
      "website": "",
      "location": "",
      "gender": "male",
      "name": "Siavash Mahmoudian",
      "username": "siavash"
    },
    "id": "5b1f99a7478dd3768d84b646",
    "followed": false
  },
  "__v": 1,
  "publishedAt": "2018-11-18T04:25:42.037Z",
  "shortId": "PEVpN",
  "downvotes": [],
  "upvotes": [
    "5bc64d97a8c76d6d771ae914"
  ],
  "comments": [],
  "rewards": [],
  "images": [],
  "links": [],
  "score": 0,
  "global": true,
  "status": "published",
  "media": [],
  "counts": {
    "reasks": 0,
    "edits": 2,
    "downvotes": 0,
    "upvotes": 1,
    "comments": 0,
    "views": 34
  },
  "privacy": "public",
  "anonymous": false,
  "verified": false,
  "summary": "...",
  "id": "5bf0e89ada3be54c190b78ba",
  "upvoted": false,
  "downvoted": false,
  "intro": "..."
}

This endpoint retrieves a specific answer using ID.

HTTP Request

GET /api/v1/answers/{id}

URL Parameters

Parameter Type Description
id String The ID of the item

Create an Answer

curl "https://community.tribe.so/api/v1/questions/5c7bfc7a157c2c34f735a53e/answers"
  -X POST
  -H "Authorization: Bearer {access_token}"
  -H 'Content-Type: application/json; charset=utf-8'
  --DATA '{"content":""<p>Very good answer!</p>","anonymous": false,"status":"published"}'
  const tribe = require('tribe');

  let api = tribe.authorize('{access_token}');
  let result = api.questions.answer("5c7bfc7a157c2c34f735a53e",{conent: "Very good answer", anonymous: false, status: "published"})

The above command returns JSON structured like this:

  {
  "_id": "5c7c04de68b07737dec0b39e",
  "updatedAt": "2019-03-03T16:49:29.077Z",
  "createdAt": "2019-03-03T16:46:22.281Z",
  "portal": "5c7bf24f157c2c34f735a539",
  "question": {
    "_id": "5c7bfc7a157c2c34f735a53e",
    "shortId": "5ogL5",
    "lang": "en",
    "updatedAt": "2019-03-03T16:47:35.149Z",
    "createdAt": "2019-03-03T16:10:34.005Z",
    "title": "My anonymous question",
    "publishedAt": "2019-03-03T16:10:34.003Z",
    "portal": "5c7bf24f157c2c34f735a539",
    "lastAskedAt": "2019-03-03T16:10:34.003Z",
    "user": {
      "_id": "5c7bf251157c2c34f735a53a",
      "profile": {
        "counts": {
          "requests": 0,
          "edits": 1,
          "questionsFollowers": 0,
          "questions": 2,
          "comments": 0,
          "answersWords": 3,
          "answersVotes": 0,
          "answersViews": 0,
          "answers": 1,
          "views": 0,
          "followings": 0,
          "followers": 0
        },
        "score": 10,
        "verified": false,
        "description": "",
        "title": "",
        "picture": "https://gravatar.com/avatar/b7711ecd91aebb5dd1b7c153dbfd92d0?s=200&d=retro",
        "website": "",
        "location": "",
        "gender": "",
        "name": "Admin",
        "username": "admin"
      },
      "id": "5c7bf251157c2c34f735a53a"
    },
    "__v": 1,
    "lastAnsweredAt": "2019-03-03T16:47:35.149Z",
    "referrers": [],
    "rewards": [],
    "hasReward": false,
    "downvotes": [],
    "upvotes": [],
    "followers": [],
    "askers": [],
    "comments": [],
    "topics": [
      {
        "_id": "5c7bff4bc389b77bdf1f2726",
        "name": "test",
        "user": {
          "_id": "5c7bf251157c2c34f735a53a",
          "profile": {
            "counts": {
              "requests": 0,
              "edits": 1,
              "questionsFollowers": 0,
              "questions": 2,
              "comments": 0,
              "answersWords": 3,
              "answersVotes": 0,
              "answersViews": 0,
              "answers": 1,
              "views": 0,
              "followings": 0,
              "followers": 0
            },
            "score": 10,
            "verified": false,
            "description": "",
            "title": "",
            "picture": "https://gravatar.com/avatar/b7711ecd91aebb5dd1b7c153dbfd92d0?s=200&d=retro",
            "website": "",
            "location": "",
            "gender": "",
            "name": "Admin",
            "username": "admin"
          },
          "id": "5c7bf251157c2c34f735a53a"
        },
        "id": "5c7bff4bc389b77bdf1f2726"
      }
    ],
    "score": 0,
    "status": "published",
    "counts": {
      "asks": 1,
      "downvotes": 0,
      "upvotes": 0,
      "edits": 2,
      "comments": 0,
      "hiddenAnswers": 0,
      "answers": 2,
      "views": 1,
      "followers": 0
    },
    "type": "general",
    "privacy": "public",
    "anonymous": false,
    "verified": false,
    "locked": false,
    "id": "5c7bfc7a157c2c34f735a53e"
  },
  "user": {
    "_id": "5c7c00dd68b07737dec0b39a",
    "profile": {
      "counts": {
        "requests": 0,
        "edits": 2,
        "questionsFollowers": 0,
        "questions": 0,
        "comments": 0,
        "answersWords": 3,
        "answersVotes": 0,
        "answersViews": 0,
        "answers": 1,
        "views": 0,
        "followings": 0,
        "followers": 0
      },
      "score": 10,
      "verified": false,
      "description": "",
      "title": "",
      "picture": "https://gravatar.com/avatar/a6ac5b09b633aafba41b4a0cda22976e?s=200&d=retro",
      "website": "",
      "location": "",
      "gender": "",
      "name": "Amir",
      "username": "triplea1373"
    },
    "id": "5c7c00dd68b07737dec0b39a"
  },
  "__v": 0,
  "content": "<p>Very good answer!A</p>",
  "draftContent": "",
  "publishedAt": "2019-03-03T16:47:35.147Z",
  "shortId": "yJ1pQ",
  "downvotes": [],
  "upvotes": [],
  "comments": [],
  "rewards": [],
  "images": [],
  "links": [],
  "score": 0,
  "global": true,
  "status": "published",
  "media": [],
  "counts": {
    "reasks": 0,
    "edits": 3,
    "downvotes": 0,
    "upvotes": 0,
    "comments": 0,
    "views": 1
  },
  "privacy": "public",
  "anonymous": false,
  "verified": false,
  "summary": "Very good answer!A",
  "id": "5c7c04de68b07737dec0b39e",
  "upvoted": false,
  "downvoted": false
}

The endpoint creates an answer for a specific question.

HTTP Request

POST /api/v1/questions/:questionId/answers

URL Parameters

Parameter Type Description
questionId String The ID of the question

Request Parameters

Parameter Type Description
content String The content of the answer
anonymous Boolean Is it an anonymous answer or not
status String Status of the answer. Can be: archived collapsed draft published unapproved unlisted scheduled new

Extra Request Parameters for Moderators

Parameter Type Description
verified Boolean Is this answer verified or not
user String The ID of the user to create an answer on behalf

Update a Specific Answer

curl "https://community.tribe.so/api/v1/answers/5bf0e89ada3be54c190b78ba"
  -X PUT
  -H "Authorization: Bearer {access_token}"
  -H 'Content-Type: application/json; charset=utf-8'
  --DATA '{"content":"Test answer","anonymous": false,"status":"published"}'
  const tribe = require('tribe');

  let api = tribe.authorize('{access_token}');
  let result = api.answers.update("5c7bfc7a157c2c34f735a53e",{conent: "Very good answer", anonymous: false)

This endpoint update a specific answer.

HTTP Request

PUT /api/v1/answers/{id}

URL Parameters

Parameter Type Description
id String The ID of the answer to update

Request Parameters

Parameter Type Description
content String The content of the answer
anonymous String Is it an anonymous answer or not

Extra Request Parameters for Moderators

Parameter Type Description
verified String Is this a verified answer or not
status String Status of the answer. Can be: archived collapsed draft published unapproved unlisted scheduled new

Delete a Specific Answer

curl "https://community.tribe.so/api/v1/answers/5bf0e89ada3be54c190b78ba"
  -X DELETE
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let result = api.answers.delete('5bf0e89ada3be54c190b78ba');

The above command returns JSON structured like this:

{
  "success": true
}

This endpoint deletes a specific answer.

HTTP Request

DELETE /api/v1/answers/{id}

URL Parameters

Parameter Type Description
id String The ID of the answer to delete

Delete a Specific Draft Answer

curl "https://community.tribe.so/api/v1/answers/5bf0e89ada3be54c190b78ba/draft"
  -X DELETE
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let result = api.answers.drafts.delete('5bf0e89ada3be54c190b78ba');

The above command returns JSON structured like this:

{
  "success": true
}

This endpoint deletes a specific draft answer.

HTTP Request

DELETE /api/v1/answers/{id}/draft

URL Parameters

Parameter Type Description
id String The ID of the answer to delete

Upvote a Specific Answer

curl "https://community.tribe.so/api/v1/answers/5bf0e89ada3be54c190b78ba/votes"
  -X POST
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let result = api.answers.upvote('5bf0e89ada3be54c190b78ba');

This endpoint upvotes for a specific answer.

HTTP Request

POST /api/v1/answers/:id/votes

URL Parameters

Parameter Type Description
id String The ID of the answer to add a vote

Remove Upvote for a Specific Answer

curl "https://community.tribe.so/api/v1/answers/5bf0e89ada3be54c190b78ba/votes"
  -X DELETE
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let result = api.answers.downvote('5bf0e89ada3be54c190b78ba');

The above command returns JSON structured like this:

{
  "success": true
}

This endpoint removes an upvote for a specific answer.

HTTP Request

DELETE /api/v1/answers/:id/votes

URL Parameters

Parameter Type Description
id String The ID of the answer to remove a vote

Get List of Votes for a Specific Answer

  curl "https://community.tribe.so/api/v1/answers/5bf0e89ada3be54c190b78ba/votes"
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let result = api.answers.votes.get('5bf0e89ada3be54c190b78ba');

The above command returns JSON structured like this:

  {
  "upvotes": [
    {
      "_id": "5bc64d97a8c76d6d771ae914",
      "profile": {
        "title": "Customer Success @Tribe",
        "picture": "https://gravatar.com/avatar/1ec94547651bb4e27ce2bdd0113f7487?s=200&d=retro",
        "name": "Mo Malayeri",
        "username": "mo11832"
      },
      "id": "5bc64d97a8c76d6d771ae914"
    },
    {
      "_id": "5b881b2a90ecbe6751123d7e",
      "profile": {
        "title": "Community Manager at Tribe",
        "picture": "/files/users/d7e/5b881b2a90ecbe6751123d7e_88402.png",
        "name": "Eli Najafi",
        "username": "elnaz"
      },
      "id": "5b881b2a90ecbe6751123d7e"
    },
    {
      "_id": "5b912f01f19a473232026862",
      "profile": {
        "title": "Marketing Manager",
        "picture": "/files/users/862/5b912f01f19a473232026862_29979.png",
        "name": "Melanie Jones",
        "username": "mike2"
      },
      "id": "5b912f01f19a473232026862"
    },
    {
      "_id": "5bacc9ff630b876a1e9785f7",
      "profile": {
        "title": "",
        "picture": "/files/users/5f7/5bacc9ff630b876a1e9785f7_15302.png",
        "name": "Robert D",
        "username": "robertd"
      },
      "id": "5bacc9ff630b876a1e9785f7"
    },
    {
      "_id": "5ba95b5c630b876a1e9785a5",
      "profile": {
        "title": "Community Manager at BHD",
        "picture": "/files/users/5a5/5ba95b5c630b876a1e9785a5_41926.png",
        "name": "Eddie Reid",
        "username": "ereid"
      },
      "id": "5ba95b5c630b876a1e9785a5"
    },
    {
      "_id": "5b8ff4190607d4174e2eb73b",
      "profile": {
        "title": "Community Moderator at Acondo",
        "picture": "/files/users/73b/5b8ff4190607d4174e2eb73b_29849.png",
        "name": "Kenneth Jensen",
        "username": "mike1"
      },
      "id": "5b8ff4190607d4174e2eb73b"
    }
  ],
  "downvotes": []
}

This endpoint retrieves all answers for a specific answer.

HTTP Request

GET /api/v1/answers/:id/votes

URL Parameters

Parameter Type Description
id String The ID of the answer to receive the votes

Add a Comment for a Specific Answer

  curl "https://community.tribe.so/api/v1/answers/5bf0e89ada3be54c190b78ba/comments"
  -X POST
  -H "Authorization: Bearer {access_token}"
  --DATA "{'body':'New comment'}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let result = api.answers.comment('5bf0e89ada3be54c190b78ba',{ 
  body: "New comment" 
});

This endpoint adds a comment for a specific answer.

HTTP Request

POST /api/v1/answers/:id/comments

URL Parameters

Parameter Type Description
id String The ID of the answer to add a comment

Request Parameters

Parameter Type Description
body String The content of the comment

Extra Request Parameters for Moderators

Parameter Type Description
user String The ID of the user to comment on behalf

Update a Specific Comment for a Specific Answer

  curl "https://community.tribe.so/api/v1/answers/5bf0e89ada3be54c190b78ba/comments/4sf0e89ada3be54c190b78b2"
  -X PUT
  -H "Authorization: Bearer {access_token}"
  --DATA "{'body':'Updated comment'}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let result = api.answers.comments.update('5bf0e89ada3be54c190b78ba',"4sf0e89ada3be54c190b78b2",{ 
  body: "Updated comment" 
});

This endpoint updates a specific comment.

HTTP Request

PUT /api/v1/answers/:answerId/comments/:id

URL Parameters

Parameter Type Description
id String The ID of the comment to update
answerId String The ID of the answer to add a comment

Request Parameters

Parameter Type Description
body String The content of the comment

Remove a Specific Comment from a Specific Answer

  curl "https://community.tribe.so/api/v1/answers/5bf0e89ada3be54c190b78ba/comments/4sf0e89ada3be54c190b78b2"
  -X DELETE
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let result = api.answers.comments.delete('5bf0e89ada3be54c190b78ba',"4sf0e89ada3be54c190b78b2");

The above command returns JSON structured like this:

{
  "success": true
}

This endpoint removes a specific comment.

HTTP Request

DELETE /api/v1/answers/:answerId/comments/:id

URL Parameters

Parameter Type Description
id String The ID of the comment to remove
answerId String The ID of the answer to remove a comment

Add Log for Specific Answers

  curl "https://community.tribe.so/api/v1/answers/logs"
  -X POST
  -H "Authorization: Bearer {access_token}"
  --DATA '{ ids: ["5bf0e89ada3be54c190b78ba"] }'
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let result = api.answers.log(['5bf0e89ada3be54c190b78ba'])

The above command returns JSON structured like this:

{
  "success": true
}

This endpoint adds a log for a specific answer.

HTTP Request

POST /api/v1/answers/logs

Request Parameters

Parameter Type Description
logs Array<String> The ID of answers to add log

Get Stats of Specific User for Answers

  curl "https://community.tribe.so/api/v1/user/stats/answers/views"
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let result = api.user.stats('answer','views')

The above command returns JSON structured like this:

{
  "values": {
    "2019-02-10": 0,
    "2019-02-11": 0,
    "2019-02-12": 0,
    "2019-02-13": 0,
    "2019-02-14": 0,
    "2019-02-15": 0,
    "2019-02-16": 0,
    "2019-02-17": 0,
    "2019-02-18": 0,
    "2019-02-19": 0,
    "2019-02-20": 0,
    "2019-02-21": 0,
    "2019-02-22": 0,
    "2019-02-23": 0,
    "2019-02-24": 0,
    "2019-02-25": 0,
    "2019-02-26": 0,
    "2019-02-27": 0,
    "2019-02-28": 0,
    "2019-03-01": 0,
    "2019-03-02": 0,
    "2019-03-03": 0,
    "2019-03-04": 0,
    "2019-03-05": 0,
    "2019-03-06": 0,
    "2019-03-07": 0,
    "2019-03-08": 0,
    "2019-03-09": 0,
    "2019-03-10": 0,
    "2019-03-11": 0,
    "2019-03-12": 0,
    "2019-03-13": 0
  },
  "type": "user_answer_viewed",
  "timestamp": "2019-03-01"
}

This endpoint returns statistics of a specific user for answers.

HTTP Request

GET /api/v1/user/stats/answers/:metric

Request Parameters

Parameter Type Description
metric String Metric for the statistics. Can be views,votes,follows

Feed

Get User Feed

curl "https://community.tribe.so/api/v1/feed"
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let questions = api.user.feed();

The above command returns JSON structured like this:

[
  {
    "_id": "topics-1",
    "type": "Topics",
    "topics": [
      ...
    ],
    "description": "You have not picked any topics yet. Please pick some to improve this page."
  },
  {
    "_id": "5c0621864cb2b119dc174a63",
    "type": "Discussion",
    "publishedAt": "2018-12-04T06:41:10.031Z",
    "post": {
      ...
    }
  },
  {
    "_id": "5bf0e89ada3be54c190b78ba",
    "type": "Answer",
    "publishedAt": "2018-11-18T04:25:42.037Z",
    "answer": {
      ...
    }
  }
]

This endpoint retrieves user feed.

HTTP Request

GET /api/v1/feed

Query Parameters

Parameter Type Default Description
page Number 1 Intended page
limit Number 20 Number of items per page
sort String createdAt.desc The field to sort on

Notification

Get User Notification

curl "https://community.tribe.so/api/v1/notifications"
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let notifications = api.notifications.list();

The above command returns JSON structured like this:

[
  {
    "_id": "5bf2ac9b86eb922c246e77ca",
    "emailAt": "2018-11-19T12:29:15.723Z",
    "updatedAt": "2018-11-19T12:29:15.722Z",
    "createdAt": "2018-11-19T12:29:15.722Z",
    "verb": "follow_user",
    "to": "5b1f99a7478dd3768d84b646",
    "__v": 0,
    "emailSent": false,
    "read": false,
    "objects": [],
    "from": [
      {
        "_id": "5bd164051f117e0440efb07c",
        "profile": {
          "picture": "https://gravatar.com/avatar/533db9190e9912306ed3334e3dba2a56?s=200&d=retro",
          "name": "Sayle",
          "username": "sayele"
        },
        "id": "5bd164051f117e0440efb07c"
      }
    ]
  },
  {
    "_id": "5bf210a61c546252b2d79030",
    "updatedAt": "2018-11-19T01:23:50.998Z",
    "createdAt": "2018-11-19T01:23:50.998Z",
    "verb": "upvote",
    "to": "5b1f99a7478dd3768d84b646",
    "__v": 0,
    "emailSent": false,
    "read": false,
    "objects": [
      {
        ...
      }
    ],
    "from": [
      {
        "_id": "5bd9d35ad242f810e3d84ab6",
        "profile": {
          "picture": "/files/users/ab6/5bd9d35ad242f810e3d84ab6_77365.png",
          "name": "Soheil Alavi",
          "username": "soheil"
        },
        "id": "5bd9d35ad242f810e3d84ab6"
      }
    ]
  },
  {
    "_id": "5be36b573fb95035bf9085a5",
    "emailAt": "2018-11-07T22:46:47.681Z",
    "updatedAt": "2018-11-07T22:46:47.679Z",
    "createdAt": "2018-11-07T22:46:47.679Z",
    "verb": "ask",
    "to": "5b1f99a7478dd3768d84b646",
    "__v": 0,
    "emailSent": false,
    "read": false,
    "objects": [
      {
        "_id": "5be36b573fb95035bf9085a3",
        "shortId": "QrmZ6",
        "updatedAt": "2018-11-22T22:09:56.432Z",
        "createdAt": "2018-11-07T22:46:47.522Z",
        "title": "What is Tribe's Privacy Policy?",
        "publishedAt": "2018-11-07T22:46:47.519Z",
        "portal": "5a73b1fcc48071e4c4dc1cae",
        "lastAskedAt": "2018-11-07T22:46:47.519Z",
        "actor": "5b3f7fe0d5a11b6297259cab",
        "__v": 2,
        "lastAnsweredAt": "2018-11-07T22:47:16.105Z",
        "referrers": [
          {
            "type": "social",
            "source": "facebook",
            "count": 1,
            "_id": "5be36fa23fb95035bf9085a8",
            "urls": []
          }
        ],
        "rewards": [],
        "hasReward": false,
        "askers": [],
        "score": 0,
        "status": "published",
        "type": "general",
        "privacy": "public",
        "anonymous": false,
        "verified": false,
        "locked": false,
        "id": "5be36b573fb95035bf9085a3"
      }
    ],
    "from": [
      {
        "_id": "5b913111f19a473232026877",
        "profile": {
          "picture": "/files/users/877/5b913111f19a473232026877_65884.png",
          "name": "Adrian Garcia",
          "username": "adriang"
        },
        "id": "5b913111f19a473232026877"
      }
    ]
  }
]

This endpoint retrieves user notifications.

HTTP Request

GET /api/v1/notifications

Query Parameters

Parameter Type Default Description
page Number 1 Intended page
limit Number 20 Number of items per page

Get User Notification Summary

curl "https://community.tribe.so/api/v1/notifications/summary"
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let summaries = api.notifications.summary();

The above command returns JSON structured like this:

{
  "count": "19"
}

This endpoint retrieves user notifications count.

HTTP Request

GET /api/v1/notifications/summary

Mark All Notifications as Read

curl "https://community.tribe.so/api/v1/notifications/summary"
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
api.notifications.read();

The above command returns JSON structured like this:

{
  "success": true
}

This endpoint marks all user notifications as read.

HTTP Request

POST /api/v1/notifications/read

Mark a Specific Notification as Read

  curl "https://community.tribe.so/api/v1/notifications/5b913111f19a473232026877/read"
  -X POST
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
api.notifications.read("5b913111f19a473232026877");

The above command returns JSON structured like this:

{
  "success": true
}

This endpoint marks a specific notification as read.

HTTP Request

POST /api/v1/notifications/:id/read

URL Parameters

Parameter Type Description
id String The ID of the notification to mark as read

Portal

Get Portal Information

curl "https://community.tribe.so/api/v1/portal"
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let portals = api.portal.get();

The above command returns JSON structured like this:

{
  "_id": "5a73b1fcc48071e4c4dc1cae",
  "updatedAt": "2018-11-30T00:46:42.809Z",
  "createdAt": "2018-02-02T02:13:32.692Z",
  "name": "Tribe",
  "domain": "community.tribe.so",
  "baseUrl": "https://community.tribe.so",
  "moderators": [],
  "admins": [],
  "__v": 9,
  "englishName": "Tribe",
  "description": "Tribe is a cloud-based community platform that plugs into your marketing stack. Integrated with your social media, it helps you amplify the vibe around your business by allowing you and your customers to create content.",
  "keywords": "",
  "longName": "Tribe, a cloud based community platform",
  "favicon": "/files/portals/cae/favicon_19357.png",
  "logo": "/files/portals/cae/logo_59518.png",
  "banner": "/files/portals/cae/banner_96419.png",
  "apps": [],
  "announcement": {
    "title": "Forums are dead. Build your tribe.",
    "picture": "/files/portals/cae/announcement_79671.png",
    "link": "https://tribe.so/#request-form",
    "enabled": true,
    "content": "<p>Tribe is a cloud-based community platform that plugs into your marketing stack. Integrated with your social media, it helps you amplify the vibe around your business by allowing you and your customers to create content.&nbsp;</p>",
    "action": "Request Demo",
    "layout": "imageSidePadded"
  },
  "template": {
    "sidebar": "",
    "head": "",
    "css": "",
    "body": "",
    "menu": {
      "height": 65
    },
    "navbar": {
      "links": [
        {
          "_id": "5bf2400486eb922c246e77c5",
          "url": "https://tribe.so/features",
          "text": "Features",
          "position": "start"
        },
        {
          "_id": "5bf2400486eb922c246e77c4",
          "url": "https://tribe.so/services",
          "text": "Services",
          "position": "start"
        },
        {
          "_id": "5bf2400486eb922c246e77c3",
          "url": "https://tribe.so/#pricing",
          "text": "Pricing",
          "position": "start"
        },
        {
          "_id": "5bf2400486eb922c246e77c2",
          "url": "https://tribe.so/app-store",
          "text": "App Store",
          "position": "start"
        }
      ],
      "enabled": true,
      "linksString": "Features | https://tribe.so/features | start\nServices | https://tribe.so/services | start\nPricing | https://tribe.so/#pricing | start\nApp Store | https://tribe.so/app-store | start"
    },
    "colors": {
      "primary": "#26c964"
    },
    "theme": "default"
  },
  "messages": {
    "motto": "Join the community of community managers!"
  },
  "featured": {
    "posts": [],
    "events": [],
    "answers": [
      "5babcf33630b876a1e9785cd"
    ],
    "topics": [
      "5b912fcb3d9228aa7c4220dc",
      "5b9002da3d9228aa7c421ec4",
      "5b912f963d9228aa7c4220db",
      "5b8ffc353d9228aa7c421eb1",
      "5b9ad5883d9228aa7c422f0c",
      "5b88264d3d9228aa7c41f692"
    ],
    "users": [],
    "questions": []
  },
  "links": {
    "twitter": "",
    "telegram": "",
    "privacy": "/question/5be36b573fb95035bf9085a3",
    "linkedin": "",
    "instagram": "",
    "faq": "",
    "facebook": ""
  },
  "currency": {
    "external": {
      "name": "CAD"
    },
    "conversionRate": 1,
    "internal": {
      "name": "Coin"
    },
    "enabled": true
  },
  "counts": {
    "unapprovedAnswers": 0,
    "unapprovedQuestions": 0,
    "comments": 0,
    "unanswered": 25,
    "topics": 30,
    "answers": 72,
    "questions": 91,
    "users": 28
  },
  "sections": [],
  "policies": {
    "cookieConsent": "enabled",
    "registration": "public",
    "content": "shareable",
    "access": "public"
  },
  "stage": "inception",
  "status": "live",
  "type": "root",
  "plan": "basic",
  "topics": [
    {
      "_id": "5b9ad5883d9228aa7c422f0c",
      "name": "Online Community",
      "user": {
        "_id": "5b881b2a90ecbe6751123d7e",
        "profile": {
          "counts": {
            "requests": 2,
            "edits": 148,
            "questionsFollowers": 0,
            "questions": 32,
            "comments": 0,
            "answersWords": 5753,
            "answersVotes": 0,
            "answersViews": 0,
            "answers": 31,
            "views": 0,
            "followings": 1,
            "followers": 2
          },
          "score": 115,
          "externalId": null,
          "verified": false,
          "description": "<p>&nbsp;</p>",
          "title": "Biomedical Engineer ",
          "picture": "/files/users/d7e/5b881b2a90ecbe6751123d7e_57697.png",
          "website": "",
          "location": "",
          "gender": "",
          "name": "Elnaz Najafi",
          "username": "elnajafi89"
        },
        "id": "5b881b2a90ecbe6751123d7e"
      },
      "picture": "/files/topics/f0c/5b9ad5883d9228aa7c422f0c_586.png",
      "id": "5b9ad5883d9228aa7c422f0c"
    },
    {
      "_id": "5babb4603d9228aa7c423c23",
      "name": "Tribe Services",
      "user": {
        "_id": "5b881b2a90ecbe6751123d7e",
        "profile": {
          "counts": {
            "requests": 2,
            "edits": 148,
            "questionsFollowers": 0,
            "questions": 32,
            "comments": 0,
            "answersWords": 5753,
            "answersVotes": 0,
            "answersViews": 0,
            "answers": 31,
            "views": 0,
            "followings": 1,
            "followers": 2
          },
          "score": 115,
          "externalId": null,
          "verified": false,
          "description": "<p>&nbsp;</p>",
          "title": "Biomedical Engineer ",
          "picture": "/files/users/d7e/5b881b2a90ecbe6751123d7e_57697.png",
          "website": "",
          "location": "",
          "gender": "",
          "name": "Elnaz Najafi",
          "username": "elnajafi89"
        },
        "id": "5b881b2a90ecbe6751123d7e"
      },
      "picture": "/files/topics/c23/5babb4603d9228aa7c423c23_22837.png",
      "id": "5babb4603d9228aa7c423c23"
    },
    {
      "_id": "5bb1abe13d9228aa7c4242ba",
      "name": "Tribe Features",
      "user": {
        "_id": "5b1f99a7478dd3768d84b646",
        "profile": {
          "counts": {
            "requests": 2,
            "edits": 46,
            "questionsFollowers": 0,
            "questions": 2,
            "comments": 2,
            "answersWords": 1586,
            "answersVotes": 0,
            "answersViews": 0,
            "answers": 12,
            "views": 0,
            "followings": 3,
            "followers": 3
          },
          "score": 52,
          "externalId": null,
          "verified": true,
          "description": "<p>&nbsp;</p>",
          "title": "Tribe Moderator",
          "picture": "/files/users/646/5b1f99a7478dd3768d84b646_66172.png",
          "website": "",
          "location": "",
          "gender": "male",
          "name": "Siavash Mahmoudian",
          "username": "siavash"
        },
        "id": "5b1f99a7478dd3768d84b646"
      },
      "picture": "/files/topics/2ba/5bb1abe13d9228aa7c4242ba_65172.png",
      "id": "5bb1abe13d9228aa7c4242ba"
    },
    {
      "_id": "5babe5eb3d9228aa7c423c66",
      "name": "Tribe Apps",
      "user": {
        "_id": "5b881b2a90ecbe6751123d7e",
        "profile": {
          "counts": {
            "requests": 2,
            "edits": 148,
            "questionsFollowers": 0,
            "questions": 32,
            "comments": 0,
            "answersWords": 5753,
            "answersVotes": 0,
            "answersViews": 0,
            "answers": 31,
            "views": 0,
            "followings": 1,
            "followers": 2
          },
          "score": 115,
          "externalId": null,
          "verified": false,
          "description": "<p>&nbsp;</p>",
          "title": "Biomedical Engineer ",
          "picture": "/files/users/d7e/5b881b2a90ecbe6751123d7e_57697.png",
          "website": "",
          "location": "",
          "gender": "",
          "name": "Elnaz Najafi",
          "username": "elnajafi89"
        },
        "id": "5b881b2a90ecbe6751123d7e"
      },
      "picture": "/files/topics/c66/5babe5eb3d9228aa7c423c66_66024.png",
      "id": "5babe5eb3d9228aa7c423c66"
    }
  ],
  "aliases": [],
  "id": "5a73b1fcc48071e4c4dc1cae",
  "updateHash": "c7bc3e38df948c7342f9e6b41d817136"
}

This endpoint retrieves portal information.

HTTP Request

GET /api/v1/portal

Create a new Portal

curl "https://community.tribe.so/api/v1/portal"
  -X POST
  -H "Authorization: Bearer {access_token}"
  --DATA '{"name": "Test Portal","domain":"test.com"}'
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let portal = api.portal.create({ 
  name: "Test Portal",
  domain: "test.com"
});

This endpoint creates a new portal.

HTTP Request

POST /api/v1/portal

Request Parameters

Parameter Type Description
name String The name of the portal
domain String The domain of the portal
subdomain String The subdomain of the portal
curl "https://community.tribe.so/api/v1/trends"
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let portals = api.portal.trends();

The above command returns JSON structured like this:

{
  "questions": [ ... ],
  "users": [ ... ],
  "topics": [ ... ],
  "answers": [ ... ],
  "events": [ ... ],
  "posts": [ ... ]
}

This endpoint retrieves portal information.

HTTP Request

GET /api/v1/stats/portal

Get Portal Health Stats

curl "https://community.tribe.so/api/v1/stats/portal"
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let stats = api.portal.stats();

The above command returns JSON structured like this:

{
  "usersActions": 220,
  "usersPosts": 132,
  "usersSeen": 359,
  "user": {
    "lastSeenAt": "a few seconds ago",
    "lastActionAt": "7 minutes ago",
    "lastPostAt": "7 minutes ago"
  }
}

This endpoint retrieves portal health stats.

HTTP Request

GET /api/v1/stats/portal

Get Portal Leaderboard

curl "https://community.tribe.so/api/v1/stats/users/leaderboard"
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let leaderboard = api.portal.leaderboard();

The above command returns JSON structured like this:

[
  {
    "target": {
      "_id": "5b881b2a90ecbe6751123d7e",
      "profile": {
        "counts": {
          "requests": 2,
          "edits": 148,
          "questionsFollowers": 0,
          "questions": 32,
          "comments": 0,
          "answersWords": 5753,
          "answersVotes": 0,
          "answersViews": 0,
          "answers": 31,
          "views": 0,
          "followings": 1,
          "followers": 2
        },
        "score": 115,
        "externalId": null,
        "verified": false,
        "description": "",
        "title": "Biomedical Engineer ",
        "picture": "/files/users/d7e/5b881b2a90ecbe6751123d7e_57697.png",
        "website": "",
        "location": "",
        "gender": "",
        "name": "Elnaz Najafi",
        "username": "elnajafi89"
      },
      "id": "5b881b2a90ecbe6751123d7e",
      "followed": true
    },
    "total": 115
  },
  {
    "target": {
      "_id": "5b7625c6307b5967d06481fb",
      "profile": {
        ...
      }
    },
    "total": 10
  },
  {
    "target": {
      "_id": "5b7de7d02234e67f52e900cf",
      "profile": {
        ...
      }
    },
    "total": 10
  }
]

This endpoint retrieves users leaderboard in portal.

HTTP Request

GET /api/v1/stats/users/leaderboard

Update the Portal

curl "https://community.tribe.so/api/v1/portal"
  -X PUT
  -H "Authorization: Bearer {access_token}"
  --DATA '{"name": "Test Portal","domain":"test.com"}'
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let portal = api.portal.update({ 
  name: "Test Portal",
  domain: "test.com"
});

This endpoint updates the portal.

HTTP Request

PUT /api/v1/portal

Request Parameters

Parameter Type Description Required
name String The name of the portal Yes
domain String The domain of the portal Yes
subdomain String The subdomain of the portal No
announcement Object The announcement visible to all users on the homepage. No
banner String The path to the banner image. This image is used as the default og:image. No
description String Description of the portal No
email String Email of the portal No
englishName String Name of the portal in English No
favicon String Icon of the portal No
keywords Array<String> Keywords related to the portal No
links Object Community links used in the sidebar and emails. No
logo String Logo of the portal No
longName String The full name of the community. This is being used as the title of community home. No
messages String Custom messages for the community. No
policies Object Policies of community. No
stage String Define the stage of the community. Can be: inceptionestablishmentmaturitymitosis. No
template Object Template of the portal No

Announcement Parameters

Parameter Type Description
action String The action button text
content String Content of the announcement
enabled String Is announcement enabled?
layout String The layout of the announcement. Can be: imageTopimageSideimageSidePaddedimageBackgroundimageTopBackgrounddarkImageBackground
link String Link related to the announcement
picture String Url to the picture of the announcement
title String Title of the announcement
Parameter Type Description
bug String Name of the holder
facebook String Facebook handle of the portal
faq String FAQ url of the portal
feature String Request for feature url.
homepage String Homepage of the portal
instagram String Instagram handle of the portal
linkedin String Linkedin handle of the portal
privacy String Url to portal's privacy policy
telegram String Telegram handle of the portal
terms String Url to portal's terms and condition
twitter String Twitter handle of the portal

Messages Parameters

Parameter Type Description
askRules String Rules of asking questions
motto String Motto of the portal
questionIntro String Introduction for questions
signupRules String Rules of signing up
topicIntro String Introduction for topics
userIntro String Introduction for users

Template Parameters

Parameter Type Description
body String Body tag of the template
colors.default String Default Color
colors.defaultLink String Default link
colors.link String Color of links
colors.menuLink String Color of menu
colors.primary String Primary Color
colors.secondary String Secondary Color
css String Custom CSS appended to the end of the code as style tag.
menu.background String Background Color of menu
menu.border Number Border size of the menu
menu.height Number Border height of the menu
navbar.background String Background Color of the navigation bar
navbar.border Number Border size of the navigation bar
navbar.color String Color of the navigation bar
navbar.enabled Boolean Is navigation bar enabled?
navbar.height Number Height the navigation bar
navbar.links Array<String> Links of the navigation bar
navbar.linksString String Links of the navigation bar in String format.
sidebar String The HTML code used inside the sidebar box.

Policies Parameters

Parameter Type Description
access String Access privacy of the community. Can be: public, private.
cookieConsent String Display cookie consent? Can be: enabled, disabled.
email String Defines the types of emails to be sent from the community. Can be: important, disabled, enabled.
registration String The registration policy of the community. Can be: public, approval, invitation.

Install an App

curl "https://community.tribe.so/api/v1/apps/5c7ff860c389b77bdf1f272b/settings"
  -X POST
  -H "Authorization: Bearer {access_token}"
  -H 'Content-Type: application/json; charset=utf-8'
  const tribe = require('tribe');

  let api = tribe.authorize('{access_token}');
  let result = api.admin.apps.install('5c7ff860c389b77bdf1f272b')

The above command returns JSON structured like this:

{
  "_id": "5c7bf24f157c2c34f735a539",
  "updatedAt": "2019-03-13T14:11:32.761Z",
  "createdAt": "2019-03-03T15:27:11.190Z",
  "name": "Tribe",
  "baseUrl": "https://community.tribe.so",
  "description": "",
  "domain": "tribe.so",
  "__v": 7,
  "apps": [
    {
      "app": {
        "_id": "5c8635bac389b77bdf1f2732",
        "slug": "moderation",
        "updatedAt": "2019-03-13T14:10:03.311Z",
        "name": "Moderation",
        "shortDescription": "Let admins create a minimum reptation.",
        "picture": "https://tribe.so/assets/images/appstore/jwt-sso.png",
        "__v": 0,
        "createdAt": "2019-03-11T10:17:25.732Z",
        "settings": {
          "user": [],
          "portal": [
            {
              "type": "checkbox",
              "name": "enabled",
              "_id": "5c890f3b1ff360189a3d038e",
              "private": false,
              "values": []
            },
            {
              "type": "number",
              "name": "minimumReputation",
              "_id": "5c890f3b1ff360189a3d038d",
              "private": true,
              "values": []
            }
          ]
        },
        "components": {
          "settings": "Moderation"
        },
        "permissions": [],
        "active": true,
        "premium": false,
        "followers": [],
        "counts": {
          "followers": 0,
          "installs": 0
        },
        "screenshots": [],
        "categories": [
          "Functionality"
        ],
        "author": {
          "link": "https://tribe.so",
          "name": "Tribe Technologies, Inc"
        },
        "type": "native",
        "id": "5c8635bac389b77bdf1f2732"
      },
      "slug": "moderation",
      "settings": {
        "minimumReputation": "8",
        "_id": "5c8635bac389b77bdf1f2732",
        "enabled": true
      },
      "_id": "5c864854f6e41f201083bf60",
      "enabled": false
    },
    {
      "app": {
        "_id": "5c7bf24fc389b77bdf1f271f",
        "name": "Welcome Email",
        "updatedAt": "2019-03-13T14:10:03.304Z",
        "shortDescription": "Send an automatic customized welcome email to new users.",
        "slug": "welcome-email",
        "picture": "https://tribe.so/assets/images/appstore/welcome-email.png",
        "__v": 0,
        "createdAt": "2019-03-03T15:27:07.020Z",
        "settings": {
          "user": [],
          "portal": [
            {
              "type": "checkbox",
              "name": "enabled",
              "_id": "5c890f3b1ff360189a3d0378",
              "private": false,
              "values": []
            },
            {
              "type": "text",
              "name": "fromEmail",
              "_id": "5c890f3b1ff360189a3d0377",
              "private": true,
              "values": []
            },
            {
              "type": "text",
              "name": "fromName",
              "_id": "5c890f3b1ff360189a3d0376",
              "private": true,
              "values": []
            },
            {
              "type": "text",
              "name": "subject",
              "_id": "5c890f3b1ff360189a3d0375",
              "private": true,
              "values": []
            },
            {
              "type": "text",
              "name": "message",
              "_id": "5c890f3b1ff360189a3d0374",
              "private": true,
              "values": []
            }
          ]
        },
        "components": {
          "settings": "WelcomeEmail"
        },
        "permissions": [],
        "active": true,
        "premium": false,
        "followers": [],
        "counts": {
          "followers": 0,
          "installs": 0
        },
        "screenshots": [],
        "categories": [
          "Functionality"
        ],
        "author": {
          "link": "https://tribe.so",
          "name": "Tribe Technologies, Inc"
        },
        "type": "native",
        "id": "5c7bf24fc389b77bdf1f271f"
      },
      "slug": "welcome-email",
      "settings": {
        "_id": "5c7bf24fc389b77bdf1f271f"
      },
      "_id": "5c864865f6e41f201083bf61",
      "enabled": false
    },
    {
      "app": {
        "_id": "5c7ff860c389b77bdf1f272b",
        "name": "SendGrid",
        "updatedAt": "2019-03-13T14:10:03.305Z",
        "shortDescription": "Send emails from your SendGrid account resulting in better email delivery.",
        "slug": "sendgrid",
        "picture": "https://tribe.so/assets/images/appstore/sendgrid.png",
        "__v": 0,
        "createdAt": "2019-03-06T16:42:05.969Z",
        "settings": {
          "user": [],
          "portal": [
            {
              "type": "checkbox",
              "name": "enabled",
              "_id": "5c890f3b1ff360189a3d037b",
              "private": false,
              "values": []
            },
            {
              "type": "text",
              "name": "username",
              "_id": "5c890f3b1ff360189a3d037a",
              "private": true,
              "values": []
            },
            {
              "type": "text",
              "name": "password",
              "_id": "5c890f3b1ff360189a3d0379",
              "private": true,
              "values": []
            }
          ]
        },
        "components": {
          "settings": "SendGrid"
        },
        "permissions": [],
        "active": true,
        "premium": false,
        "followers": [],
        "counts": {
          "followers": 0,
          "installs": 0
        },
        "screenshots": [],
        "categories": [
          "Functionality"
        ],
        "author": {
          "link": "https://tribe.so",
          "name": "Tribe Technologies, Inc"
        },
        "type": "native",
        "id": "5c7ff860c389b77bdf1f272b"
      },
      "slug": "sendgrid",
      "settings": {
        "_id": "5c7ff860c389b77bdf1f272b"
      },
      "_id": "5c890f941ff360189a3d038f",
      "enabled": false
    }
  ],
  "secrets": {
    "ssoKey": "1f4f219a4b525ddfaba64a54f997e226353726720b477c7c"
  },
  "announcement": {
    "layout": "imageSide"
  },
  "template": {
    "navbar": {
      "links": [],
      "enabled": false,
      "linksString": ""
    },
    "theme": "default"
  },
  "featured": {
    "posts": [],
    "events": [],
    "answers": [],
    "topics": [],
    "users": [],
    "questions": []
  },
  "currency": {
    "conversionRate": 100,
    "enabled": false
  },
  "counts": {
    "unapprovedAnswers": 0,
    "unapprovedQuestions": 0,
    "comments": 0,
    "unanswered": 0,
    "topics": 0,
    "answers": 0,
    "questions": 0,
    "users": 0
  },
  "sections": [],
  "policies": {
    "email": "enabled",
    "cookieConsent": "disabled",
    "registration": "public",
    "content": "shareable",
    "access": "public"
  },
  "stage": "inception",
  "status": "live",
  "type": "general",
  "plan": "basic",
  "topics": [],
  "aliases": [],
  "corsWhitelist": [],
  "id": "5c7bf24f157c2c34f735a539",
  "updateHash": "1473a306957af1b78b580c0d4cf896ff"
}

The endpoint installs an app in the portal.

HTTP Request

POST /api/v1/apps/:id/settings

URL Parameters

Parameter Type Description
id String The ID of app to install

Uninstall an App

curl "https://community.tribe.so/api/v1/apps/5c7ff860c389b77bdf1f272b/settings"
  -X DELETE
  -H "Authorization: Bearer {access_token}"
  -H 'Content-Type: application/json; charset=utf-8'
  const tribe = require('tribe');

  let api = tribe.authorize('{access_token}');
  let result = api.admin.apps.uninstall('5c7ff860c389b77bdf1f272b')

The above command returns JSON structured like this:

{
  "_id": "5c7bf24f157c2c34f735a539",
  "updatedAt": "2019-03-13T14:15:04.709Z",
  "createdAt": "2019-03-03T15:27:11.190Z",
  "name": "Tribe",
  "baseUrl": "https://community.tribe.so",
  "description": "",
  "domain": "tribe.so",
  "__v": 8,
  "apps": [
    {
      "app": {
        "_id": "5c8635bac389b77bdf1f2732",
        "slug": "moderation",
        "updatedAt": "2019-03-13T14:10:03.311Z",
        "name": "Moderation",
        "shortDescription": "Let admins create a minimum reptation.",
        "picture": "https://tribe.so/assets/images/appstore/jwt-sso.png",
        "__v": 0,
        "createdAt": "2019-03-11T10:17:25.732Z",
        "settings": {
          "user": [],
          "portal": [
            {
              "type": "checkbox",
              "name": "enabled",
              "_id": "5c890f3b1ff360189a3d038e",
              "private": false,
              "values": []
            },
            {
              "type": "number",
              "name": "minimumReputation",
              "_id": "5c890f3b1ff360189a3d038d",
              "private": true,
              "values": []
            }
          ]
        },
        "components": {
          "settings": "Moderation"
        },
        "permissions": [],
        "active": true,
        "premium": false,
        "followers": [],
        "counts": {
          "followers": 0,
          "installs": 0
        },
        "screenshots": [],
        "categories": [
          "Functionality"
        ],
        "author": {
          "link": "https://tribe.so",
          "name": "Tribe Technologies, Inc"
        },
        "type": "native",
        "id": "5c8635bac389b77bdf1f2732"
      },
      "slug": "moderation",
      "settings": {
        "enabled": true,
        "_id": "5c8635bac389b77bdf1f2732",
        "minimumReputation": "8"
      },
      "_id": "5c864854f6e41f201083bf60",
      "enabled": false
    },
    {
      "app": {
        "_id": "5c7bf24fc389b77bdf1f271f",
        "name": "Welcome Email",
        "updatedAt": "2019-03-13T14:10:03.304Z",
        "shortDescription": "Send an automatic customized welcome email to new users.",
        "slug": "welcome-email",
        "picture": "https://tribe.so/assets/images/appstore/welcome-email.png",
        "__v": 0,
        "createdAt": "2019-03-03T15:27:07.020Z",
        "settings": {
          "user": [],
          "portal": [
            {
              "type": "checkbox",
              "name": "enabled",
              "_id": "5c890f3b1ff360189a3d0378",
              "private": false,
              "values": []
            },
            {
              "type": "text",
              "name": "fromEmail",
              "_id": "5c890f3b1ff360189a3d0377",
              "private": true,
              "values": []
            },
            {
              "type": "text",
              "name": "fromName",
              "_id": "5c890f3b1ff360189a3d0376",
              "private": true,
              "values": []
            },
            {
              "type": "text",
              "name": "subject",
              "_id": "5c890f3b1ff360189a3d0375",
              "private": true,
              "values": []
            },
            {
              "type": "text",
              "name": "message",
              "_id": "5c890f3b1ff360189a3d0374",
              "private": true,
              "values": []
            }
          ]
        },
        "components": {
          "settings": "WelcomeEmail"
        },
        "permissions": [],
        "active": true,
        "premium": false,
        "followers": [],
        "counts": {
          "followers": 0,
          "installs": 0
        },
        "screenshots": [],
        "categories": [
          "Functionality"
        ],
        "author": {
          "link": "https://tribe.so",
          "name": "Tribe Technologies, Inc"
        },
        "type": "native",
        "id": "5c7bf24fc389b77bdf1f271f"
      },
      "slug": "welcome-email",
      "settings": {
        "_id": "5c7bf24fc389b77bdf1f271f"
      },
      "_id": "5c864865f6e41f201083bf61",
      "enabled": false
    }
  ],
  "secrets": {
    "ssoKey": "1f4f219a4b525ddfaba64a54f997e226353726720b477c7c"
  },
  "announcement": {
    "layout": "imageSide"
  },
  "template": {
    "navbar": {
      "links": [],
      "enabled": false,
      "linksString": ""
    },
    "theme": "default"
  },
  "featured": {
    "posts": [],
    "events": [],
    "answers": [],
    "topics": [],
    "users": [],
    "questions": []
  },
  "currency": {
    "conversionRate": 100,
    "enabled": false
  },
  "counts": {
    "unapprovedAnswers": 0,
    "unapprovedQuestions": 0,
    "comments": 0,
    "unanswered": 0,
    "topics": 0,
    "answers": 0,
    "questions": 0,
    "users": 0
  },
  "sections": [],
  "policies": {
    "email": "enabled",
    "cookieConsent": "disabled",
    "registration": "public",
    "content": "shareable",
    "access": "public"
  },
  "stage": "inception",
  "status": "live",
  "type": "general",
  "plan": "basic",
  "topics": [],
  "aliases": [],
  "corsWhitelist": [],
  "id": "5c7bf24f157c2c34f735a539",
  "updateHash": "3fa36c8343b45caeb47b31c8c59a082b"
}

The endpoint uninstalls an app in the portal.

HTTP Request

DELETE /api/v1/apps/:id/settings

URL Parameters

Parameter Type Description
id String The ID of app to uninstall

Post

Get All Post

curl "https://community.tribe.so/api/v1/posts"
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let posts = api.posts.get();

The above command returns JSON structured like this:

[
  {
    "_id": "5c0621864cb2b119dc174a63",
    "shortId": "Px10b",
    "lang": "en",
    "updatedAt": "2018-12-04T06:41:25.370Z",
    "createdAt": "2018-12-04T06:41:10.046Z",
    "title": "This is a test discussion.",
    "content": "<p>Here is the content of the discussion.</p>",
    "portal": "5a73b1fcc48071e4c4dc1cae",
    "publishedAt": "2018-12-04T06:41:10.031Z",
    "user": {
      "_id": "5b1f99a7478dd3768d84b646",
      "profile": {
        "counts": {
          "requests": 2,
          "edits": 46,
          "questionsFollowers": 0,
          "questions": 2,
          "comments": 2,
          "answersWords": 1586,
          "answersVotes": 0,
          "answersViews": 0,
          "answers": 12,
          "views": 0,
          "followings": 3,
          "followers": 3
        },
        "score": 52,
        "externalId": null,
        "verified": true,
        "description": "<p>&nbsp;</p>",
        "title": "Tribe Moderator",
        "picture": "/files/users/646/5b1f99a7478dd3768d84b646_66172.png",
        "website": "",
        "location": "",
        "gender": "male",
        "name": "Siavash Mahmoudian",
        "username": "siavash"
      },
      "id": "5b1f99a7478dd3768d84b646"
    },
    "__v": 2,
    "referrers": [],
    "global": true,
    "downvotes": [],
    "upvotes": [],
    "comments": [],
    "rewards": [],
    "images": [],
    "links": [],
    "media": [],
    "topics": [
      {
        "_id": "5b88264d3d9228aa7c41f692",
        "name": "Tribe",
        "user": {
          "_id": "5b881b2a90ecbe6751123d7e",
          "profile": {
            "counts": {
              "requests": 2,
              "edits": 148,
              "questionsFollowers": 0,
              "questions": 32,
              "comments": 0,
              "answersWords": 5753,
              "answersVotes": 0,
              "answersViews": 0,
              "answers": 31,
              "views": 0,
              "followings": 1,
              "followers": 2
            },
            "score": 115,
            "externalId": null,
            "verified": false,
            "description": "<p>&nbsp;</p>",
            "title": "Biomedical Engineer ",
            "picture": "/files/users/d7e/5b881b2a90ecbe6751123d7e_57697.png",
            "website": "",
            "location": "",
            "gender": "",
            "name": "Elnaz Najafi",
            "username": "elnajafi89"
          },
          "id": "5b881b2a90ecbe6751123d7e"
        },
        "picture": "/files/topics/692/5b88264d3d9228aa7c41f692_72807.png",
        "id": "5b88264d3d9228aa7c41f692"
      }
    ],
    "posters": [
      {
        "user": "5b1f99a7478dd3768d84b646",
        "score": 1,
        "_id": "5c062192f3d2d61a37864a5c"
      }
    ],
    "followers": [],
    "score": 0,
    "counts": {
      "downvotes": 0,
      "links": 0,
      "totalUpvotes": 0,
      "upvotes": 0,
      "followers": 1,
      "users": 1,
      "edits": 0,
      "responses": 1,
      "comments": 0,
      "views": 0
    },
    "status": "published",
    "privacy": "public",
    "type": "discussion",
    "anonymous": false,
    "verified": false,
    "responses": [
      "5c062192f3d2d61a37864a5b"
    ],
    "summary": "Here is the content of the discussion.",
    "id": "5c0621864cb2b119dc174a63",
    "upvoted": false,
    "downvoted": false,
    "followed": false
  }
]

This endpoint retrieves all posts.

HTTP Request

GET /api/v1/posts

Query Parameters

Parameter Type Default Description
page Number 1 Intended page
limit Number 20 Number of items per page
sort String createdAt.desc The field to sort on

Get a Specific Post

curl "https://community.tribe.so/api/v1/posts/5c0621864cb2b119dc174a63"
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let posts = api.posts.get('5c0621864cb2b119dc174a63');

The above command returns JSON structured like this:

  {
    "_id": "5c0621864cb2b119dc174a63",
    "shortId": "Px10b",
    "lang": "en",
    "updatedAt": "2018-12-04T06:41:25.370Z",
    "createdAt": "2018-12-04T06:41:10.046Z",
    "title": "This is a test discussion.",
    "content": "<p>Here is the content of the discussion.</p>",
    "portal": "5a73b1fcc48071e4c4dc1cae",
    "publishedAt": "2018-12-04T06:41:10.031Z",
    "user": {
      "_id": "5b1f99a7478dd3768d84b646",
      "profile": {
        "counts": {
          "requests": 2,
          "edits": 46,
          "questionsFollowers": 0,
          "questions": 2,
          "comments": 2,
          "answersWords": 1586,
          "answersVotes": 0,
          "answersViews": 0,
          "answers": 12,
          "views": 0,
          "followings": 3,
          "followers": 3
        },
        "score": 52,
        "externalId": null,
        "verified": true,
        "description": "<p>&nbsp;</p>",
        "title": "Tribe Moderator",
        "picture": "/files/users/646/5b1f99a7478dd3768d84b646_66172.png",
        "website": "",
        "location": "",
        "gender": "male",
        "name": "Siavash Mahmoudian",
        "username": "siavash"
      },
      "id": "5b1f99a7478dd3768d84b646"
    },
    "__v": 2,
    "referrers": [],
    "global": true,
    "downvotes": [],
    "upvotes": [],
    "comments": [],
    "rewards": [],
    "images": [],
    "links": [],
    "media": [],
    "topics": [
      {
        "_id": "5b88264d3d9228aa7c41f692",
        "name": "Tribe",
        "user": {
          "_id": "5b881b2a90ecbe6751123d7e",
          "profile": {
            "counts": {
              "requests": 2,
              "edits": 148,
              "questionsFollowers": 0,
              "questions": 32,
              "comments": 0,
              "answersWords": 5753,
              "answersVotes": 0,
              "answersViews": 0,
              "answers": 31,
              "views": 0,
              "followings": 1,
              "followers": 2
            },
            "score": 115,
            "externalId": null,
            "verified": false,
            "description": "<p>&nbsp;</p>",
            "title": "Biomedical Engineer ",
            "picture": "/files/users/d7e/5b881b2a90ecbe6751123d7e_57697.png",
            "website": "",
            "location": "",
            "gender": "",
            "name": "Elnaz Najafi",
            "username": "elnajafi89"
          },
          "id": "5b881b2a90ecbe6751123d7e"
        },
        "picture": "/files/topics/692/5b88264d3d9228aa7c41f692_72807.png",
        "id": "5b88264d3d9228aa7c41f692"
      }
    ],
    "posters": [
      {
        "user": "5b1f99a7478dd3768d84b646",
        "score": 1,
        "_id": "5c062192f3d2d61a37864a5c"
      }
    ],
    "followers": [],
    "score": 0,
    "counts": {
      "downvotes": 0,
      "links": 0,
      "totalUpvotes": 0,
      "upvotes": 0,
      "followers": 1,
      "users": 1,
      "edits": 0,
      "responses": 1,
      "comments": 0,
      "views": 0
    },
    "status": "published",
    "privacy": "public",
    "type": "discussion",
    "anonymous": false,
    "verified": false,
    "responses": [
      "5c062192f3d2d61a37864a5b"
    ],
    "summary": "Here is the content of the discussion.",
    "id": "5c0621864cb2b119dc174a63",
    "upvoted": false,
    "downvoted": false,
    "followed": false
  }

This endpoint retrieves a specific post using ID.

HTTP Request

GET /api/v1/posts/{id}

URL Parameters

Parameter Type Description
id String The ID of the item

Create a new Post

curl "https://community.tribe.so/api/v1/posts"
  -X POST
  -H "Authorization: Bearer {access_token}"
  --DATA "{data}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let post = api.posts.create({ 
  title: "New Post",
  content: "New Post's content",
});

This endpoint creates a new post.

HTTP Request

POST /api/v1/posts

Request Parameters

Parameter Type Description
title String The title of the post
content String The content of the post
type String The type of the post
parent String The ID of the parent post
replyTo String The ID of the post to reply

Extra Request Parameters for Moderators

Parameter Type Description
locked Boolean Is the post locked?
verified Boolean Is the post verified?
status String The status of the post. Can be: new draft published unlisted archived collapsed scheduled unapproved
user String The ID of the user to post on behalf

Update a Specific Post

curl "https://community.tribe.so/api/v1/posts/5c0621864cb2b119dc174a63"
  -X PUT
  -H "Authorization: Bearer {access_token}"
  --DATA "{data}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let post = api.posts.update("5c0621864cb2b119dc174a63",{ 
  title: "New Post",
  content: "New Post's content",
});

This endpoint updates a specific post.

HTTP Request

PUT /api/v1/posts/:id

URL Parameters

Parameter Type Description
id String The ID of the post to update

Request Parameters

Parameter Type Description
title String The title of the post
content String The content of the post

Extra Request Parameters for Moderators

Parameter Type Description
locked Boolean Is the post locked?
verified Boolean Is the post verified?
status String The status of the post. Can be: new draft published unlisted archived collapsed scheduled unapproved

Delete a Specific Post

curl "https://community.tribe.so/api/v1/posts/5c0621864cb2b119dc174a63"
  -X DELETE
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let result = api.posts.delete('5c0621864cb2b119dc174a63');

The above command returns JSON structured like this:

{
  "success": true
}

This endpoint deletes a specific post.

HTTP Request

DELETE /api/v1/posts/{id}

URL Parameters

Parameter Type Description
id String The ID of the post to delete

Get Post's Responses

curl "https://community.tribe.so/api/v1/posts/5c0621864cb2b119dc174a63/responses"
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let users = api.posts.responses('5c0621864cb2b119dc174a63');

The above command returns JSON structured like this:

[
  {
    "_id": "5c062192f3d2d61a37864a5b",
    "shortId": "PKqoR",
    "lang": "en",
    "updatedAt": "2018-12-04T06:41:22.270Z",
    "createdAt": "2018-12-04T06:41:22.270Z",
    "content": "<p>This is a test response to a discussion.</p>",
    "parent": "5c0621864cb2b119dc174a63",
    "portal": "5a73b1fcc48071e4c4dc1cae",
    "publishedAt": "2018-12-04T06:41:22.262Z",
    "user": {
      "_id": "5b1f99a7478dd3768d84b646",
      "profile": {
        "counts": {
          "requests": 2,
          "edits": 46,
          "questionsFollowers": 0,
          "questions": 2,
          "comments": 2,
          "answersWords": 1586,
          "answersVotes": 0,
          "answersViews": 0,
          "answers": 12,
          "views": 0,
          "followings": 3,
          "followers": 3
        },
        "score": 52,
        "externalId": null,
        "verified": true,
        "description": "<p>&nbsp;</p>",
        "title": "Tribe Moderator",
        "picture": "/files/users/646/5b1f99a7478dd3768d84b646_66172.png",
        "website": "",
        "location": "",
        "gender": "male",
        "name": "Siavash Mahmoudian",
        "username": "siavash"
      },
      "id": "5b1f99a7478dd3768d84b646"
    },
    "__v": 0,
    "referrers": [],
    "global": true,
    "downvotes": [],
    "upvotes": [],
    "comments": [],
    "rewards": [],
    "images": [],
    "links": [],
    "media": [],
    "topics": [],
    "posters": [],
    "followers": [],
    "score": 0,
    "counts": {
      "downvotes": 0,
      "links": 0,
      "totalUpvotes": 0,
      "upvotes": 0,
      "followers": 1,
      "users": 1,
      "edits": 0,
      "responses": 0,
      "comments": 0,
      "views": 0
    },
    "status": "published",
    "privacy": "public",
    "type": "response",
    "anonymous": false,
    "verified": false,
    "responses": [],
    "summary": "This is a test response to a discussion.",
    "id": "5c062192f3d2d61a37864a5b",
    "upvoted": false,
    "downvoted": false,
    "followed": false
  }
]

HTTP Request

GET /api/v1/posts/{id}/responses

URL Parameters

Parameter Type Description
id String The ID of the question

Query Parameters

Parameter Type Default Description
page Number 1 Intended page
limit Number 20 Number of items per page
sort String createdAt.desc The field to sort on

Upvote for a Specific Post

curl "https://community.tribe.so/api/v1/posts/5c0621864cb2b119dc174a63/votes"
  -X POST
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let users = api.posts.upvote('5c0621864cb2b119dc174a63');

This endpoint upvotes a specific post.

HTTP Request

POST /api/v1/posts/{id}/votes

URL Parameters

Parameter Type Description
id String The ID of the post to upvote

Remove an Upvote for a Specific Post

curl "https://community.tribe.so/api/v1/posts/5c0621864cb2b119dc174a63/votes"
  -X DELETE
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let users = api.posts.downvote('5c0621864cb2b119dc174a63');

The above command returns JSON structured like this:

{
  "success": true
}

This endpoint removes an upvote a specific post.

HTTP Request

DELETE /api/v1/posts/{id}/votes

URL Parameters

Parameter Type Description
id String The ID of the post to remove an upvote

Add a Comment for a Specific Post

  curl "https://community.tribe.so/api/v1/posts/5bf0e89ada3be54c190b78ba/comments"
  -X POST
  -H "Authorization: Bearer {access_token}"
  --DATA "{'body':'New comment'}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let users = api.posts.comment('5c0621864cb2b119dc174a63',{
  body: "New Comment"
});

This endpoint adds a comment for a specific post.

HTTP Request

POST /api/v1/posts/:id/comments

URL Parameters

Parameter Type Description
id String The ID of the post to add a comment

Request Parameters

Parameter Type Description
body String The content of the comment

Extra Request Parameters for Moderators

Parameter Type Description
user String The ID of the user to comment on behalf

Update a Specific Comment for a Specific Post

  curl "https://community.tribe.so/api/v1/posts/5bf0e89ada3be54c190b78ba/comments/4sf0e89ada3be54c190b78b2"
  -X PUT
  -H "Authorization: Bearer {access_token}"
  --DATA "{'body':'Updated comment'}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let users = api.posts.comments.update('5c0621864cb2b119dc174a63',"4sf0e89ada3be54c190b78b2",{
  body: "New Comment"
});

This endpoint updates a specific comment.

HTTP Request

PUT /api/v1/posts/:postId/comments/:id

URL Parameters

Parameter Type Description
id String The ID of the comment to update
postId String The ID of the post to add a comment

Request Parameters

Parameter Type Description
body String The content of the comment

Remove a Specific Comment from Specific Post

  curl "https://community.tribe.so/api/v1/posts/5bf0e89ada3be54c190b78ba/comments/4sf0e89ada3be54c190b78b2"
  -X DELETE
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let users = api.posts.comments.delete('5c0621864cb2b119dc174a63',"4sf0e89ada3be54c190b78b2");

The above command returns JSON structured like this:

{
  "success": true
}

This endpoint removes a specific comment.

HTTP Request

DELETE /api/v1/posts/:postId/comments/:id

URL Parameters

Parameter Type Description
id String The ID of the comment to remove
postId String The ID of the post to remove a comment

Questions

Get All Questions

curl "https://community.tribe.so/api/v1/questions"
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let questions = api.questions.get();

The above command returns JSON structured like this:

[
  {
    "_id": "5a816275f8030b3bdd655b0d",
    "updatedAt": "2018-02-12T19:07:21.136Z",
    "createdAt": "2018-02-12T09:46:29.646Z",
    "title": "What is a perfect life?",
    "lastAskedAt": "2018-02-12T09:46:29.642Z",
    "__v": 0,
    "lastAnsweredAt": "2018-02-12T19:07:21.135Z",
    "downvotes": [],
    "upvotes": [],
    "followers": [],
    "askers": [],
    "comments": [],
    "topics": [],
    "score": 0,
    "counts": {
      "asks": 1,
      "downvotes": 0,
      "upvotes": 0,
      "edits": 2,
      "comments": 0,
      "hiddenAnswers": 0,
      "answers": 2,
      "views": 8,
      "followers": 0
    },
    "type": "general",
    "anonymous": true,
    "verified": false,
    "locked": false,
    "followed": false
  }
]

This endpoint retrieves all questions.

HTTP Request

GET /api/v1/questions

Query Parameters

Parameter Type Default Description
page Number 1 Intended page
limit Number 20 Number of items per page
sort String createdAt.desc The field to sort on

Get a Specific Question

curl "https://community.tribe.so/api/v1/questions/5a816275f8030b3bdd655b0d"
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let questions = api.questions.get('5a816275f8030b3bdd655b0d');

The above command returns JSON structured like this:

{
  "_id": "5a816275f8030b3bdd655b0d",
  "updatedAt": "2018-02-12T19:07:21.136Z",
  "createdAt": "2018-02-12T09:46:29.646Z",
  "title": "What is a perfect life?",
  "lastAskedAt": "2018-02-12T09:46:29.642Z",
  "__v": 0,
  "lastAnsweredAt": "2018-02-12T19:07:21.135Z",
  "downvotes": [],
  "upvotes": [],
  "followers": [],
  "askers": [],
  "comments": [],
  "topics": [],
  "score": 0,
  "counts": {
    "asks": 1,
    "downvotes": 0,
    "upvotes": 0,
    "edits": 2,
    "comments": 0,
    "hiddenAnswers": 0,
    "answers": 2,
    "views": 8,
    "followers": 0
  },
  "type": "general",
  "anonymous": true,
  "verified": false,
  "locked": false,
  "followed": false
}

This endpoint retrieves a specific question using ID.

HTTP Request

GET /api/v1/questions/{id}

URL Parameters

Parameter Type Description
id String The ID of the item

Delete a Specific Question

curl "https://community.tribe.so/api/v1/questions/5a816275f8030b3bdd655b0d"
  -X DELETE
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let result = api.questions.delete('5a816275f8030b3bdd655b0d');

The above command returns JSON structured like this:

{
  "success": true
}

This endpoint deletes a specific question.

HTTP Request

DELETE /api/v1/questions/{id}

URL Parameters

Parameter Type Description
id String The ID of the question to delete

Get Question's Answers

curl "https://community.tribe.so/api/v1/questions/5a816275f8030b3bdd655b0d/answers"
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let users = api.questions.answers('5a816275f8030b3bdd655b0d');

HTTP Request

GET /api/v1/questions/{id}/answers

URL Parameters

Parameter Type Description
id String The ID of the question

Query Parameters

Parameter Type Default Description
page Number 1 Intended page
limit Number 20 Number of items per page
sort Number createdAt.desc The field to sort on

Get Question's Experts

curl "https://community.tribe.so/api/v1/questions/5a816275f8030b3bdd655b0d/experts"
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let users = api.questions.experts('5a816275f8030b3bdd655b0d');

HTTP Request

GET /api/v1/questions/{id}/experts

URL Parameters

Parameter Type Description
id String The ID of the question

Get a Question's Recommendations

curl "https://community.tribe.so/api/v1/questions/5a816275f8030b3bdd655b0d/recommendations"
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let users = api.questions.recommendations('5a816275f8030b3bdd655b0d');

HTTP Request

GET /api/v1/questions/{id}/recommendations

URL Parameters

Parameter Type Description
id String The ID of the question

Get Similar Questions

curl "https://community.tribe.so/api/v1/questions/similars"
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let users = api.questions.similars('This is a test question title');

This endpoint find related questions to keywords or a question title.

HTTP Request

GET /api/v1/questions/similars

Query Parameters

Parameter Type Default Description
query String "" Keywords or title of a question

Create a Question

curl "https://community.tribe.so/api/v1/questions"
  -X POST
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let question = api.questions.create({ title: 'What is life?'});

This endpoint creates a new question.

HTTP Request

POST /api/v1/questions

Query Parameters

Parameter Type Description
title String The title of the question to create
description String The description of the question to create
anonymous Boolean Is this an anonymous question?
from String The ID of the user who has beend asked from
topics [String] The IDs of the topics related to the question

Extra Query Parameters for Moderators

Parameter Type Description
type String The type of the question to create
locked Boolean Is the question locked?
verified Boolean Is the question verified?
status String Status of the question to create. Can be: archived collapsed published unapproved unlisted featured scheduled
user String The ID of the user to ask a question on behalf

Update a Specific Question

curl "https://community.tribe.so/api/v1/questions/5a816275f8030b3bdd655b0d"
  -X PUT
  -H "Authorization: Bearer {access_token}"

This endpoint updates a specific question.

HTTP Request

PUT /api/v1/questions/:id

URL Parameters

Parameter Type Description
id String The ID of the question to update

Query Parameters

Parameter Type Description
title String The title of the question to create
description String The description of the question to create
anonymous Boolean Is this an anonymous question?

Extra Query Parameters for Moderators

Parameter Type Description
type String The type of the question to create
locked Boolean Is the question locked?
verified Boolean Is the question verified?
status String Status of the question to create. Can be: archived collapsed published unapproved unlisted featured scheduled

Add a Comment for a Specific Question

  curl "https://community.tribe.so/api/v1/questions/5bf0e89ada3be54c190b78ba/comments"
  -X POST
  -H "Authorization: Bearer {access_token}"
  --DATA "{'body':'New comment'}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let users = api.questions.comments.create('5c0621864cb2b119dc174a63',"4sf0e89ada3be54c190b78b2", {
  body: "New Comment"
});

This endpoint adds a comment for a specific question.

HTTP Request

POST /api/v1/questions/:id/comments

URL Parameters

Parameter Type Description
id String The ID of the question to add a comment

Request Parameters

Parameter Type Description
body String The content of the comment

Extra Request Parameters for Moderators

Parameter Type Description
user String The ID of the user to comment on behalf

Update a Specific Comment for a Specific Question

  curl "https://community.tribe.so/api/v1/questions/5bf0e89ada3be54c190b78ba/comments/4sf0e89ada3be54c190b78b2"
  -X PUT
  -H "Authorization: Bearer {access_token}"
  --DATA "{'body':'Updated comment'}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let users = api.questions.comments.update('5c0621864cb2b119dc174a63',"4sf0e89ada3be54c190b78b2",{
  body: "Updated Comment"
});

This endpoint updates a specific comment.

HTTP Request

PUT /api/v1/questions/:questionId/comments/:id

URL Parameters

Parameter Type Description
id String The ID of the comment to update
questionId String The ID of the question to add a comment

Request Parameters

Parameter Type Description
body String The content of the comment

Remove a Specific Comment from Specific Question

  curl "https://community.tribe.so/api/v1/questions/5bf0e89ada3be54c190b78ba/comments/4sf0e89ada3be54c190b78b2"
  -X DELETE
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let users = api.questions.comments.delete('5c0621864cb2b119dc174a63',"4sf0e89ada3be54c190b78b2");

The above command returns JSON structured like this:

{
  "success": true
}

This endpoint removes a specific comment.

HTTP Request

DELETE /api/v1/questions/:questionId/comments/:id

URL Parameters

Parameter Type Description
id String The ID of the comment to remove
questionId String The ID of the question to remove a comment

Get Stats of Specific User for Questions

  curl "https://community.tribe.so/api/v1/user/stats/questions/views"
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let result = api.user.stats('question','views')

The above command returns JSON structured like this:

{
  "values": {
    "2019-02-10": 0,
    "2019-02-11": 0,
    "2019-02-12": 0,
    "2019-02-13": 0,
    "2019-02-14": 0,
    "2019-02-15": 0,
    "2019-02-16": 0,
    "2019-02-17": 0,
    "2019-02-18": 0,
    "2019-02-19": 0,
    "2019-02-20": 0,
    "2019-02-21": 0,
    "2019-02-22": 0,
    "2019-02-23": 0,
    "2019-02-24": 0,
    "2019-02-25": 0,
    "2019-02-26": 0,
    "2019-02-27": 0,
    "2019-02-28": 0,
    "2019-03-01": 0,
    "2019-03-02": 0,
    "2019-03-03": 0,
    "2019-03-04": 0,
    "2019-03-05": 0,
    "2019-03-06": 0,
    "2019-03-07": 0,
    "2019-03-08": 0,
    "2019-03-09": 0,
    "2019-03-10": 0,
    "2019-03-11": 0,
    "2019-03-12": 0,
    "2019-03-13": 0
  },
  "type": "user_question_viewed",
  "timestamp": "2019-03-01"
}

This endpoint returns statistics of a specific user for questions.

HTTP Request

GET /api/v1/user/stats/questions/:metric

Request Parameters

Parameter Type Description
metric String Metric for the statistics. Can be: views,votes,follows

Topics

Get All Topics

curl "https://community.tribe.so/api/v1/topics"
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let topics = api.topics.get();

The above command returns JSON structured like this:

[
  {
    "_id": "5b88264d3d9228aa7c41f692",
    "name": "Tribe",
    "portal": "5a73b1fcc48071e4c4dc1cae",
    "updatedAt": "2018-11-29T06:16:08.223Z",
    "__v": 8,
    "createdAt": "2018-08-30T17:15:57.884Z",
    "aliases": [],
    "children": [
      "5bb1abe13d9228aa7c4242ba",
      "5babb4603d9228aa7c423c23",
      "5bbf7b083d9228aa7c427450",
      "5babe5eb3d9228aa7c423c66"
    ],
    "counts": {
      "questions": 55,
      "followers": 3,
      "subquestions": 79,
      "children": 4
    },
    "definitions": [],
    "paths": [
      [
        {
          "_id": "5b88264d3d9228aa7c41f692",
          "name": "Tribe",
          "picture": "/files/topics/692/5b88264d3d9228aa7c41f692_72807.png"
        }
      ]
    ],
    "shortId": "5oqoy",
    "user": "5b881b2a90ecbe6751123d7e",
    "picture": "/files/topics/692/5b88264d3d9228aa7c41f692_72807.png",
    "experts": {
      "5b881b2a90ecbe6751123d7e": 24,
      "5b3f7fe0d5a11b6297259cab": 16,
      "5b1f99a7478dd3768d84b646": 12,
      "5b913111f19a473232026877": 3,
      "5ba95b5c630b876a1e9785a5": 1
    },
    "about": "",
    "followed": true
  }
]

This endpoint retrieves all topics.

HTTP Request

GET /api/v1/topics

Query Parameters

Parameter Type Default Description
page Number 1 Intended page
limit Number 20 Number of items per page
sort String createdAt.desc The field to sort on

Get a Specific Topic

curl "https://community.tribe.so/api/v1/topics/5b88264d3d9228aa7c41f692"
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let topics = api.topics.get('5b88264d3d9228aa7c41f692');

The above command returns JSON structured like this:

{
  "_id": "5b88264d3d9228aa7c41f692",
  "name": "Tribe",
  "portal": "5a73b1fcc48071e4c4dc1cae",
  "updatedAt": "2018-11-29T06:16:08.223Z",
  "__v": 8,
  "createdAt": "2018-08-30T17:15:57.884Z",
  "aliases": [],
  "children": [
    "5bb1abe13d9228aa7c4242ba",
    "5babb4603d9228aa7c423c23",
    "5bbf7b083d9228aa7c427450",
    "5babe5eb3d9228aa7c423c66"
  ],
  "counts": {
    "questions": 55,
    "followers": 3,
    "subquestions": 79,
    "children": 4
  },
  "definitions": [],
  "paths": [
    [
      {
        "_id": "5b88264d3d9228aa7c41f692",
        "name": "Tribe",
        "picture": "/files/topics/692/5b88264d3d9228aa7c41f692_72807.png"
      }
    ]
  ],
  "shortId": "5oqoy",
  "user": "5b881b2a90ecbe6751123d7e",
  "picture": "/files/topics/692/5b88264d3d9228aa7c41f692_72807.png",
  "experts": {
    "5b881b2a90ecbe6751123d7e": 24,
    "5b3f7fe0d5a11b6297259cab": 16,
    "5b1f99a7478dd3768d84b646": 12,
    "5b913111f19a473232026877": 3,
    "5ba95b5c630b876a1e9785a5": 1
  },
  "about": "",
  "followed": true
}

This endpoint retrieves a specific topic using ID.

HTTP Request

GET /api/v1/topics/{id}

URL Parameters

Parameter Type Description
id String The ID of the item

Create a Topic

curl "https://community.tribe.so/api/v1/topics"
  -X POST
  -H "Authorization: Bearer {access_token}"
  -H 'Content-Type: application/json; charset=utf-8' \
  --DATA '{"name":"Test Topic"}'
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let result = api.topics.create({name: 'Test Topic'});

The above command returns JSON structured like this:

{
  "_id": "5b88264d3d9228aa7c41f693",
  "name": "Test Topic",
  "portal": "5a73b1fcc48071e4c4dc1cae",
  "updatedAt": "2018-11-29T06:16:08.223Z",
  "__v": 8,
  "createdAt": "2018-08-30T17:15:57.884Z",
  "aliases": [],
  "children": [],
  "counts": {
    "questions": 0,
    "followers": 0,
    "subquestions": 0,
    "children": 0
  },
  "definitions": [],
  "paths": [],
  "shortId": "5oqoy",
  "user": "5b881b2a90ecbe6751123d7e",
  "experts": {},
  "about": "",
  "followed": false
}

This endpoint creates a new topic.

HTTP Request

POST /api/v1/topics

Request Parameters

Parameter Type Default Description
name String null The name of the Topic
about String null The description of the Topic
picture String null Url to a picture for this Topic
definitions [String] [] The different types assigned with the Topic. It can be an array of following: ['Concept', 'Location', 'Localizable','Activity', 'QuestionType', 'Category', 'Event', 'Person', 'AcademicField', 'Job', 'Person', 'Company', 'School', 'Product', 'Adult']
aliases [String] [] An array of Aliases for this Topic. Aliases help users search the Topic with different keywords.
externalId String null The unique ID of the Topic in an external platform. This is useful when creating a Topic for an external entity.

Update a Specific Topic

curl "https://community.tribe.so/api/v1/topics/5b88264d3d9228aa7c41f692"
  -X PUT
  -H "Authorization: Bearer {access_token}"
  -H 'Content-Type: application/json; charset=utf-8' \
  --DATA '{data}'
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let result = api.topics.update({name: 'Test Topic'}, {
  name: "Updated name",
  about: "Updated description",
  definitions: ["Location","School"]
});

This endpoint updates a specific topic.

HTTP Request

PUT /api/v1/topics/:id

URL Parameters

Parameter Type Default
id String The ID of the topic to update

Request Parameters

Parameter Type Default Description
name String null The name of the Topic
about String null The description of the Topic
definitions [String] [] The different types assigned with the Topic. It can be an array of following: ['Concept', 'Location', 'Localizable','Activity', 'QuestionType', 'Category', 'Event', 'Person', 'AcademicField', 'Job', 'Person', 'Company', 'School', 'Product', 'Adult']
aliases [String] [] An array of Aliases for this Topic. Aliases help users search the Topic with different keywords.

Extra Request Parameters

Parameter Type Default Description
picture String null Url to a picture for this Topic
externalId String null The unique ID of the Topic in an external platform. This is useful when creating a Topic for an external entity.

Delete a Specific Topic

curl "https://community.tribe.so/api/v1/topics/5b88264d3d9228aa7c41f692"
  -X DELETE
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let result = api.topics.delete('5b88264d3d9228aa7c41f692');

The above command returns JSON structured like this:

{
  "success": true
}

This endpoint deletes a specific topic.

HTTP Request

DELETE /api/v1/topics/{id}

URL Parameters

Parameter Type Description
id String The ID of the topic to delete

Get Topic's Questions

curl "https://community.tribe.so/api/v1/topics/5b88264d3d9228aa7c41f692/questions"
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let users = api.topics.questions('5b88264d3d9228aa7c41f692');

HTTP Request

GET /api/v1/topics/{id}/questions

URL Parameters

Parameter Type Description
id String The ID of the topic

Get Topic's Experts

curl "https://community.tribe.so/api/v1/topics/5b88264d3d9228aa7c41f692/experts"
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let users = api.topics.experts('5b88264d3d9228aa7c41f692');

HTTP Request

GET /api/v1/topics/{id}/experts

URL Parameters

Parameter Type Description
id String The ID of the topic

Add a Child

curl "https://community.tribe.so/api/v1/topics/5b88264d3d9228aa7c41f692/children"
  -X POST
  -H "Authorization: Bearer {access_token}"
  --DATA '{ name: "Child" }'
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let child = api.topics.addChild('5b88264d3d9228aa7c41f692',{ name: 'Child' });

HTTP Request

POST /api/v1/topics/{id}/children

URL Parameters

Parameter Type Description
id String The ID of the topic

Request Parameters

Parameter Type Description
name String Name of the child to add

Remove a Child

curl "https://community.tribe.so/api/v1/topics/5b88264d3d9228aa7c41f692/children/4c88264d3d9118aa7c41f6ff"
  -X DELETE
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
api.topics.removeChild('5b88264d3d9228aa7c41f692','4c88264d3d9118aa7c41f6ff');

HTTP Request

DELETE /api/v1/topics/:id/children/:childId

URL Parameters

Parameter Type Description
id String The ID of the topic
childId String The ID of the child to delete

Users

Get All Users

curl "https://community.tribe.so/api/v1/users"
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let users = api.users.get();

The above command returns JSON structured like this:

[
  {
    "_id": "5b1f99a7478dd3768d84b646",
    "profile": {
      "counts": {
        "requests": 2,
        "edits": 46,
        "questionsFollowers": 0,
        "questions": 2,
        "comments": 2,
        "answersWords": 1586,
        "answersVotes": 0,
        "answersViews": 0,
        "answers": 12,
        "views": 0,
        "followings": 3,
        "followers": 3
      },
      "score": 52,
      "externalId": null,
      "verified": true,
      "description": "",
      "title": "Tribe Moderator",
      "picture": "",
      "website": "",
      "location": "",
      "gender": "male",
      "name": "John Smith",
      "username": "john"
    },
    "id": "5b1f99a7478dd3768d84b646",
    "followed": false
  }
]

This endpoint retrieves all users.

HTTP Request

GET /api/v1/users

Query Parameters

Parameter Type Default Description
page Number 1 Intended page
limit Number 20 Number of items per page
sort Number createdAt.desc The field to sort on

Create a new User

curl "https://community.tribe.so/api/v1/users"
  -X POST
  -H "Authorization: Bearer {access_token}"
  --DATA '{data}'
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let users = api.users.create({
  username: "info",
  name:"Mr Support",
  email: "info@tribe.so",
  password: ...,
  confirmPassword: ...
});

This endpoint creates a new user.

HTTP Request

POST /api/v1/users/

Request Parameters

Parameter Type Description Required
username String Username of the user Yes
name String Name of the user Yes
email String Email of the user Yes
password String Password of the user Yes
confirmPassword String Confirm password of the user No

Get a Specific User

curl "https://community.tribe.so/api/v1/users/5b1f99a7478dd3768d84b646"
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let users = api.users.get('5b1f99a7478dd3768d84b646');

The above command returns JSON structured like this:

{
  "_id": "5b1f99a7478dd3768d84b646",
  "profile": {
    "counts": {
      "requests": 2,
      "edits": 46,
      "questionsFollowers": 0,
      "questions": 2,
      "comments": 2,
      "answersWords": 1586,
      "answersVotes": 0,
      "answersViews": 0,
      "answers": 12,
      "views": 0,
      "followings": 3,
      "followers": 3
    },
    "score": 52,
    "externalId": null,
    "verified": true,
    "description": "",
    "title": "Tribe Moderator",
    "picture": "",
    "website": "",
    "location": "",
    "gender": "male",
    "name": "John Smith",
    "username": "john"
  },
  "id": "5b1f99a7478dd3768d84b646",
  "followed": false
}

This endpoint retrieves a specific user using ID.

HTTP Request

GET /api/v1/users/{id}

URL Parameters

Parameter Type Description
id String The ID of the user

Update a Specific User

curl "https://community.tribe.so/api/v1/users/5b1f99a7478dd3768d84b646"
  -X PUT
  -H "Authorization: Bearer {access_token}"
  --DATA '{data}'
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let users = api.users.update("5b1f99a7478dd3768d84b646",{
  name:"Ms. Support"
});

This endpoint updates a specific user using ID.

HTTP Request

PUT /api/v1/users/{id}

URL Parameters

Parameter Type Description
id String The ID of the user to update

Request Parameters

Parameter Type Description Required
username String Username of the user Yes
name String Name of the user Yes
email String Email of the user Yes
password String Password of the user Yes
confirmPassword String Confirm password of the user No
links Object List of user's social network accounts No
bankAccount Object User's bank account No
location String Location of the user No
website String Website owned by user No
gender String Gender of the user No
title String Title of the user No
description String A short description of user No

Bank Account Parameters

Parameter Type Description
holderName String Name of the holder
accountNumber String Account number
type String Type of the account. Can be: card, checking, saving
routingNumber String Routing number for the bank account
bankName String Name of the bank related to account
Parameter Type Description
telegram String Telegram account of the user
instagram String Instagram account of the user
twitter String Twitter account of the user
facebook String Facebook account of the user
linkedin String Twitter account of the user
homepage String The url of homepage of user

Extra Request Parameters for Moderators

Parameter Type Description
verified Boolean Is the user verified or not
status String Status of the user

Extra Request Parameters for Admin

Parameter Type Description
role String Role of the user

Delete a Specific User

curl "https://community.tribe.so/api/v1/users/5b1f99a7478dd3768d84b646"
  -X DELETE
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let result = api.users.delete('5b1f99a7478dd3768d84b646');

The above command returns JSON structured like this:

{
  "success": true
}

This endpoint deletes a specific user.

HTTP Request

DELETE /api/v1/users/{id}

URL Parameters

Parameter Type Description
id String The ID of the user to delete

Get User's Followers

curl "https://community.tribe.so/api/v1/users/5b1f99a7478dd3768d84b646/followers"
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let users = api.users.followers('5b1f99a7478dd3768d84b646');

The above command returns JSON structured like this:

[
  {
    "_id": "5b3f7fe0d5a11b6297259cab",
    "profile": {
      "counts": {
        "requests": 2,
        "edits": 46,
        "questionsFollowers": 0,
        "questions": 4,
        "comments": 0,
        "answersWords": 1128,
        "answersVotes": 0,
        "answersViews": 0,
        "answers": 8,
        "views": 0,
        "followings": 1,
        "followers": 2
      },
      "score": 58,
      "externalId": null,
      "verified": true,
      "description": "<p>&nbsp;</p>",
      "title": "Community Moderator at Tribe",
      "picture": "/files/users/cab/5b3f7fe0d5a11b6297259cab_57983.png",
      "website": "",
      "location": "",
      "gender": "",
      "name": "Mike Modiri",
      "username": "mike"
    },
    "id": "5b3f7fe0d5a11b6297259cab",
    "followed": false
  }
]

This endpoint retrieves a specific user's followers using ID.

HTTP Request

GET /api/v1/users/{id}/followers

URL Parameters

Parameter Type Description
id String The ID of the user

Get User's Following

curl "https://community.tribe.so/api/v1/users/5b1f99a7478dd3768d84b646/followings"
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let users = api.users.following('5b1f99a7478dd3768d84b646');

The above command returns JSON structured like this:

[
  {
    "_id": "5b3f7fe0d5a11b6297259cab",
    "profile": {
      "counts": {
        "requests": 2,
        "edits": 46,
        "questionsFollowers": 0,
        "questions": 4,
        "comments": 0,
        "answersWords": 1128,
        "answersVotes": 0,
        "answersViews": 0,
        "answers": 8,
        "views": 0,
        "followings": 1,
        "followers": 2
      },
      "score": 58,
      "externalId": null,
      "verified": true,
      "description": "<p>&nbsp;</p>",
      "title": "Community Moderator at Tribe",
      "picture": "/files/users/cab/5b3f7fe0d5a11b6297259cab_57983.png",
      "website": "",
      "location": "",
      "gender": "",
      "name": "Mike Modiri",
      "username": "mike"
    },
    "id": "5b3f7fe0d5a11b6297259cab",
    "followed": false
  }
]

This endpoint retrieves a specific user's followings using ID.

HTTP Request

GET /api/v1/users/{id}/followings

URL Parameters

Parameter Type Description
id String The ID of the user

Get User's Expertise

curl "https://community.tribe.so/api/v1/users/5b1f99a7478dd3768d84b646/expertise"
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let users = api.users.expertise('5b1f99a7478dd3768d84b646');

The above command returns JSON structured like this:

[
  {
    "topic": {
      "_id": "5b88264d3d9228aa7c41f692",
      "name": "Tribe",
      "portal": "5a73b1fcc48071e4c4dc1cae",
      "updatedAt": "2018-12-04T06:41:25.365Z",
      "__v": 8,
      "createdAt": "2018-08-30T17:15:57.884Z",
      "shortId": "5oqoy",
      "picture": "/files/topics/692/5b88264d3d9228aa7c41f692_72807.png",
      "experts": {
        "5ba95b5c630b876a1e9785a5": 1,
        "5b913111f19a473232026877": 3,
        "5b1f99a7478dd3768d84b646": 12,
        "5b3f7fe0d5a11b6297259cab": 16,
        "5b881b2a90ecbe6751123d7e": 24
      },
      "about": "<p>&nbsp;</p>",
      "counts": {
        "children": 4,
        "edits": 0,
        "posts": 1,
        "subquestions": 79,
        "questions": 55,
        "subanswers": 0,
        "answers": 0,
        "views": 0,
        "followers": 3
      },
      "paths": [
        [
          {
            "picture": "/files/topics/692/5b88264d3d9228aa7c41f692_72807.png",
            "name": "Tribe",
            "_id": "5b88264d3d9228aa7c41f692"
          }
        ]
      ],
      "id": "5b88264d3d9228aa7c41f692",
      "followed": true
    },
    "score": 12
  },
  {
    "topic": {
      ...
    },
    "score": 5
  },
  {
    "topic": {
      ...
    },
    "score": 2
  },
  {
    "topic": {
      ...
    },
    "score": 1
  }
]

This endpoint retrieves a specific user's expertise using ID.

HTTP Request

GET /api/v1/users/{id}/expertise

URL Parameters

Parameter Type Description
id String The ID of the user

Get User's Questions

curl "https://community.tribe.so/api/v1/users/5b1f99a7478dd3768d84b646/questions"
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let users = api.users.questions('5b1f99a7478dd3768d84b646');

HTTP Request

GET /api/v1/users/{id}/questions

URL Parameters

Parameter Type Description
id String The ID of the user

Get User's Answers

curl "https://community.tribe.so/api/v1/users/5b1f99a7478dd3768d84b646/answers"
  -H "Authorization: Bearer {access_token}"
const tribe = require('tribe');

let api = tribe.authorize('{access_token}');
let users = api.users.answers('5b1f99a7478dd3768d84b646');

HTTP Request

GET /api/v1/users/{id}/answers

URL Parameters

Parameter Type Description
id String The ID of the user

Errors

The Tribe API uses the following error codes:

Error Code Meaning
400 Bad Request -- Your request is invalid.
401 Unauthorized -- Your API key is wrong.
403 Forbidden -- The requested item is hidden for administrators only.
404 Not Found -- The requested item could not be found.
405 Method Not Allowed -- You tried to access an endpoint with an invalid method.
410 Gone -- The item requested has been removed from our servers.
429 Too Many Requests -- You're sending too many requests!
500 Internal Server Error -- We had a problem with our server. Try again later.
503 Service Unavailable -- We're temporarily offline for maintenance. Please try again later.

Widgets

Getting Started

Tribe widgets are components from community which you can easily embed in your product, website, or service.

Using Tribe widgets is super simple. Start by pasting following script in your website's <head> tag.

<!-- Tribe Tag -->
<script>
  (function(t,r,i,b,e){
    if(typeof t.Tribe==='function'){t.Tribe('reload',{portal:i});}
    else{b=function(){b.r(arguments);};b.q=[];b.r=function(args){b.q.push(args);};
    t.Tribe=b; e=r.createElement('script');e.type='text/javascript';e.async=true;
    e.src=i+'/widget/v1/main.js?t='+Math.ceil(new Date() / 3e5) * 3e5;
    var x=r.getElementsByTagName('script')[0];x.parentNode.insertBefore(e,x);
    t.Tribe('boot',{portal:i});}
  })(window,document,'{YourCommunityAddress}');
</script>

Make sure to replace {YourCommunityAddress} with the root address to your community, including https://. For instance if your community url is https://community.tribe.so, the script should look like this:

<!-- Tribe Tag -->
<script>
  (function(t,r,i,b,e){
    if(typeof t.Tribe==='function'){t.Tribe('reload',{portal:i});}
    else{b=function(){b.r(arguments);};b.q=[];b.r=function(args){b.q.push(args);};
    t.Tribe=b; e=r.createElement('script');e.type='text/javascript';e.async=true;
    e.src=i+'/widget/v1/main.js?t='+Math.ceil(new Date() / 3e5) * 3e5;
    var x=r.getElementsByTagName('script')[0];x.parentNode.insertBefore(e,x);
    t.Tribe('boot',{portal:i});}
  })(window,document,'https://community.tribe.so');
</script>

After the script is in place you can use window.Tribe function to add widgets to your website.

window.Tribe accepts one or two arguments. The first argument is the widget type or action that you want to perform, and the second argument is an object which defines widget's options.

<script>
  window.Tribe('widgetType', {id: 'test'})
</script>

Form Widget

Using form widgets you can display community signup or login form in your website. Since this widget injects HTML into your page it'll automatically adapts look and feel of your webpage. You can additionaly customize it using your website's CSS.

<div id="signup-form"></div>
<script>
  window.Tribe('form', {
    id: 'signup-form', 
    type: 'signup'
  })
</script>

The script above results in a form like this:

Signup widget

Widget Options

OptionDefaultDescription
id null The ID of the div to append the widget
type signup The type of the form. Can be signup or login.
labels {
email: 'Email',
password: 'Password',
name: 'Name'
}
The form labels for each field.
fields ['name', 'email', 'password'] Defines the order and visibility of fields.
redirect null Where to go after the form is submitted successfully.

Questions Widget

Using questions widget you can embed a feed of questions around certain topic(s) right into your website. Visitors can ask new questions, follow them and find answers to the questions.

Using components option you're able to define which items should be visible inside the widget. For instance you can display or hide the breadcrumb, topic header, sidebar, question input, etc.

<div id="questions-widget"></div>
<script>
  window.Tribe('questions', {
    topicId: '5babe5eb3d9228aa7c423c66', 
    id: 'questions-widget', 
    components: ['input']
  })
</script>

The script above results in the following widget:

Questions widget

Widget Options

OptionDefaultDescription
id null The ID of the div to append the widget.
topicId null The widget will show only questions with the defined topic ID.
components [
'breadcrumb', 'sidebar',
'header', 'input',
'suggestions'
]
Defines which elements should be displayed in the widget.
fields ['name', 'email', 'password'] Defines the order and visibility of fields.
redirect null Where to go after the form is submitted successfully.

Custom Widgets

In many cases, Tribe builds a very custom widget which suites your company's needs. Tribe provides a widget ID to your company and you can insert the widget using following script:

<div id="custom-widget"></div>
<script>
  window.Tribe('widget', {
    id: 'custom-widget', 
    widgetId: '<Custom Widgets ID>',
    optionA: valueA,
    optionB: valueB
  })
</script>

Please note that optionA and optionB are sample names. Each custom widget has different sets of options. Tribe team email you a detailed instruction about your custom widget which includes all available options.

User Authentication

In Tribe, there are three different authentication methods available for widgets.

Session

If you don't have a separate userbase or want Tribe to handle authentication this is the right authentication method.

The widget will check Tribe Community to see if the user is logged in there. If they are not, we'll show a Signup/Login button inside the widgets.

User can click on the button and login in a new window. The platform will return user to the previous page after user is logged in.

JWT (JSON Web Token)

In this method you'll sign a JSON token with User's information using a private key and pass it as an option to the widget.

You should login to your community as an Admin and go to Single Sign-On section under Admin Panel to access your private key. In the Single Sign-On section you can find examples on how to generate the JWT in Node.js, PHP, Java, Python and Ruby programming languages.

You can use JWT to pass widget-specific data as well.

Here is how a Question Widget script looks like with JWT:

<div id="questions-widget"></div>
<script>
  window.Tribe('questions', {
    topicId: '5babe5eb3d9228aa7c423c66', 
    id: 'questions-widget', 
    components: ['input'],
    jwt: '<The JWT generated in backend goes here>'
  })
</script>

OAuth2

To enable OAuth2 on your widgets you need to create an OAuth2 app for Tribe on your side and email us the following information to dev@tribe.so:

We will setup the OAuth2 Single Sign-On for your community on our side. Any time a user accesses a widget which needs authentication, we'll redirect user to the authorization URL. If user is already logged in on your application, they'll get logged in right away. Otherwise, they'll see your login screen and will be redirected to the widget after they're signed in.