API

Version 0.4.5 - Last Updated 2017-03-03

Welcome to the documentation for the pnut API.

Submit feature requests and bugs to our GitHub repository.

You are welcome to talk over the API in the Developer Channel (18).

The API root is https://api.pnut.io/v0.

User objects are included in returned JSON frequently enough that they are simply included as {...} in the documentation, except in the user sections specifically requesting user objects.

General Post Parameters

Any endpoint that returns post objects can be subject to these parameters.

General Parameters
Name Type Description
include_client integer (0 or 1) Include the client object with the post. Defaults to true.
include_counts integer (0 or 1) Include the post's counts. Also affects any included user object. Defaults to true.
include_html integer (0 or 1) Should the post and user html field be included alongside the text field in the response objects? Defaults to true.
include_post_html integer (0 or 1) Should the post html field be included alongside the text field in the response objects? Defaults to true. Note that include_html takes priority if present.
include_bookmarked_by integer (0 or 1) Include bookmarked_by: a sampled list of users who bookmarked the post. Defaults to false.
include_reposted_by integer (0 or 1) Include reposted_by: a sampled list of users who reposted the post. Defaults to false.
include_directed_posts integer (0 or 1) Include posts with "leading mentions" of users you do not follow. Not applicable to all post streams. Defaults to true.
include_copy_mentions integer (0 or 1) Include "copy mentions" in the /users/{user_id}/mentions endpoint. Defaults to true.

General User Identifiers

Unless otherwise specified, user identifiers can be any of the following:

  • User ID (1)
  • @username (@33mhz)
  • GUID (113BA773-F1F2-42CF-99F8-02EC778942C9)
  • "me", when authenticated

General User Parameters

Any endpoint that returns user objects (including any that return post objects, message objects, etc.) can be subject to these parameters.

General Parameters
Name Type Description
include_html integer (0 or 1) Should the post and user html field be included alongside the text field in the response objects? Defaults to true.
include_user_html integer (0 or 1) Should the user html field be included alongside the text field in the response objects? Defaults to true. Note that include_html takes priority if present.
include_counts integer (0 or 1) Include the user's counts. Also affects any included user object. Defaults to true.
include_user_as_id integer (0 or 1) Return the user as their (string) ID only. Defaults to false.
include_user_as_guid integer (0 or 1) Return the user as their GUID only. Defaults to false.
include_presence integer (0 or 1) Include the user's current presence. Defaults to false.