openapi-directory
Version:
Building & bundling https://github.com/APIs-guru/openapi-directory for easy use from JS
1 lines • 61.7 kB
JSON
{"openapi":"3.0.0","servers":[{"url":"https://trashnothing.com/api/v1.3"}],"info":{"contact":{"x-twitter":"trashnothing"},"description":"This is the REST API for [trashnothing.com](https://trashnothing.com).\n\nTo learn more about the API or to register your app for use with the API\nvisit the [trash nothing Developer page](https://trashnothing.com/developer).\n\nNOTE: All date-time values are [UTC](https://en.wikipedia.org/wiki/Coordinated_Universal_Time)\nand are in [ISO 8601 format](https://en.wikipedia.org/wiki/ISO_8601) (eg. 2019-02-03T01:23:53).\n","termsOfService":"https://trashnothing.com/tos","title":"trash nothing","version":"1.3","x-apisguru-categories":["social"],"x-logo":{"url":"https://twitter.com/trashnothing/profile_image?size=original"},"x-origin":[{"format":"openapi","url":"http://trashnothing.com/api/trashnothing-openapi.yaml","version":"3.0"}],"x-providerName":"trashnothing.com"},"tags":[{"description":"Retrieve and update user data.","name":"users"},{"description":"Retrieve and update posts.","name":"posts"},{"description":"Search, subscribe and unsubscribe to groups.","name":"groups"}],"paths":{"/groups":{"get":{"operationId":"search_groups","parameters":[{"description":"Find groups that have the given text somewhere in their name (case insensitive).","in":"query","name":"name","required":false,"schema":{"type":"string"}},{"description":"Find groups near the given latitude and longitude.","in":"query","name":"latitude","required":false,"schema":{"type":"number"}},{"description":"Find groups near the given latitude and longitude.","in":"query","name":"longitude","required":false,"schema":{"type":"number"}},{"description":"When latitude and longitude are passed, distance can optionally be passed to only return groups within a certain distance (in kilometers) from the point specified by the latitude and longitude. The distance must be > 0 and <= 150 and will default to 100.\n","in":"query","name":"distance","required":false,"schema":{"default":100,"maximum":150,"minimum":0,"type":"number"}},{"description":"Find groups in the given country where country is a 2 letter country code for the country (see https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 ).\n","in":"query","name":"country","required":false,"schema":{"type":"string"}},{"description":"For countries with regions (AU, CA, GB, US), search groups in a specific region as specified by the region abbreviation. The supported regions and their abbreviations are listed below. <br /><br /> NOTE: The region and postal_code parameters cannot be used at the same time and if both are passed then the postal_code will take priority. <br /><br /> --- <br /><br /> **AU**<br /> - QLD: Queensland<br /> - SA: South Australia<br /> - TAS: Tasmania<br /> - VIC: Victoria<br /> - WA: Western Australia<br /> - NT: Northern Territory<br /> - NSW: New South Wales - ACT<br /> <br /> **CA**<br /> - AB: Alberta<br /> - BC: British Columbia<br /> - MB: Manitoba<br /> - NB: New Brunswick<br /> - NL: Newfoundland and Labrador<br /> - NS: Nova Scotia<br /> - ON: Ontario<br /> - QC: Quebec<br /> - SK: Saskatchewan<br /> - PE: Prince Edward Island<br /> <br /> **GB**<br /> - E: East<br /> - EM: East Midlands<br /> - LDN: London<br /> - NE: North East<br /> - NW: North West<br /> - NI: Northern Ireland<br /> - SC: Scotland<br /> - SE: South East<br /> - SW: South West<br /> - WA: Wales<br /> - WM: West Midlands<br /> - YH: Yorkshire and the Humber<br /> <br /> **US**<br /> All 50 states and the District of Columbia are supported. For the abbreviations, see: https://github.com/jasonong/List-of-US-States/blob/master/states.csv\n","in":"query","name":"region","required":false,"schema":{"type":"string"}},{"description":"Find groups in the given postal code. Only a few countries support postal code searches (US, CA, AU, GB). The country parameter must be passed when the postal_code parameter is set. <br /><br /> NOTE: The region and postal_code parameters cannot be used at the same time and if both are passed then the postal_code will take priority.\n","in":"query","name":"postal_code","required":false,"schema":{"type":"string"}},{"description":"The page of groups to return.","in":"query","name":"page","required":false,"schema":{"default":1,"minimum":1,"type":"integer"}},{"description":"The number of groups to return per page (must be >= 1 and <= 100).","in":"query","name":"per_page","required":false,"schema":{"default":20,"maximum":100,"minimum":1,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"end_index":{"description":"The index of the last group being returned (an integer between start_index and num_groups).","type":"integer"},"groups":{"items":{"$ref":"#/components/schemas/Group"},"type":"array"},"num_groups":{"description":"The total number of groups available.","type":"integer"},"num_pages":{"description":"The total number of pages available.","type":"integer"},"page":{"description":"The page number of the groups being returned.","type":"integer"},"per_page":{"description":"The number of groups being returned per page.","type":"integer"},"start_index":{"description":"The index of the first group being returned (an integer between 1 and num_groups).","type":"integer"}},"type":"object"}}},"description":"The groups and paging data."},"400":{"description":"Missing or invalid parameters."}},"security":[{"api_key":[]}],"summary":"Search groups","tags":["groups"]}},"/groups/multiple":{"get":{"operationId":"get_groups_by_ids","parameters":[{"description":"The IDs of the groups to retrieve. If more than 20 group IDs are passed, only the first 20 groups will be returned.","in":"query","name":"group_ids","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/Group"},"type":"array"}}},"description":"The groups."},"400":{"description":"Missing or invalid parameters."}},"security":[{"api_key":[]}],"summary":"Retrieve multiple groups","tags":["groups"]}},"/groups/{group_id}":{"get":{"operationId":"get_group","parameters":[{"description":"The ID of the group to retrieve.","in":"path","name":"group_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Group"}}},"description":"The group."},"404":{"description":"Group not found."}},"security":[{"api_key":[]}],"summary":"Retrieve a group","tags":["groups"]}},"/posts":{"get":{"description":"NOTE: When paging through the posts returned by this endpoint, there will be at most 1,000 posts that can be returned (eg. 50 pages worth of posts with the default per_page value of 20). In areas where there are more than 1,000 posts, clients can use more specific query parameters to adjust which posts are returned.\nNOTE: Passing the latitude, longitude and radius parameters filters all posts by their location and so these parameters will temporarily override the current users' location preferences. When latitude, longitude and radius are not specified, public posts will be filtered by the current users' location preferences.\n","operationId":"get_posts","parameters":[{"description":"How to sort the posts that are returned. One of: date, active, distance <br /><br />\nDate sorting will sort posts from newest to oldest. Active sorting will sort active posts before satisfied, withdrawn and expired posts and then sort by date. Distance sorting will sort the closest posts first.\n","in":"query","name":"sort_by","required":false,"schema":{"default":"date","type":"string"}},{"description":"A comma separated list of the post types to return. The available post types are: offer, taken, wanted, received, admin\n","in":"query","name":"types","required":true,"schema":{"type":"string"}},{"description":"A comma separated list of the post sources to retrieve posts from. The available sources are: groups, trashnothing, open_archive_groups. The trashnothing source is for public posts that are posted on trash nothing but are not associated with any group. The open_archive_groups source provides a way to easily request posts from groups that have open_archives set to true without having to pass a group_ids parameter. When passed, it will automatically return posts from open archive groups that are within the area specified by the latitude, longitude and radius parameters (or the current users' location if latitude, longitude and radius aren't passed). <br /><br /> NOTE: For requests using an api key instead of oauth, passing the trashnothing source or the open_archive_groups source makes the latitude, longitude and radius parameters required.\n","in":"query","name":"sources","required":true,"schema":{"type":"string"}},{"description":"A comma separated list of the group IDs to retrieve posts from. This parameter is only used if the 'groups' source is passed in the sources parameter and only groups that the current user is a member of or that are open archives groups will be used (the group IDs of other groups will be silently discarded*). <br /><br /> NOTE: For requests using an api key instead of oauth, this field is required if the 'groups' source is passed. In addition, only posts from groups that have open_archives set to true will be used (the group IDS of other groups will be silently discarded*). <br /><br/> *To determine which group IDs were used and which were discarded, use the group_ids field in the response.\n","in":"query","name":"group_ids","required":false,"schema":{"default":"The group IDs of every group the current user is a member of.","type":"string"}},{"description":"The number of posts to return per page (must be >= 1 and <= 100).","in":"query","name":"per_page","required":false,"schema":{"default":20,"maximum":100,"minimum":1,"type":"integer"}},{"description":"The page of posts to return.","in":"query","name":"page","required":false,"schema":{"default":1,"minimum":1,"type":"integer"}},{"description":"Client device pixel ratio used to determine thumbnail size (default 1.0).","in":"query","name":"device_pixel_ratio","required":false,"schema":{"default":1,"type":"number"}},{"description":"The latitude of a point around which to return posts.\n","in":"query","name":"latitude","required":false,"schema":{"type":"number"}},{"description":"The longitude of a point around which to return posts.\n","in":"query","name":"longitude","required":false,"schema":{"type":"number"}},{"description":"The radius in meters of a circle centered at the point defined by the latitude and longitude parameters. When latitude, longitude and radius are passed, only posts within the circle defined by these parameters will be returned.\n","in":"query","name":"radius","required":false,"schema":{"maximum":257500,"minimum":0,"type":"number"}},{"description":"Only posts newer than or equal to this UTC date and time will be returned. If unset, defaults to the current date and time minus 90 days.\n","in":"query","name":"date_min","required":false,"schema":{"format":"date-time","type":"string"}},{"description":"Only posts older than this UTC date and time will be returned. If unset, defaults to the current date and time.","in":"query","name":"date_max","required":false,"schema":{"format":"date-time","type":"string"}},{"description":"A comma separated list of the post outcomes to return. The available post outcomes are: satisfied, withdrawn <br /><br /> There are also a couple special values that can be passed. If set to an empty string (the default), only posts that are not satisfied and not withdrawn and not expired are returned. If set to 'all', all posts will be returned no matter what outcome the posts have. If set to 'not-promised', only posts that are not satisfied ant not withdrawn and not expired and not promised are returned.\n","in":"query","name":"outcomes","required":false,"schema":{"default":"","type":"string"}},{"description":"If user_state is set, only posts matching the state specified will be returned. Only one state may be passed and it must be one of the following: viewed, replied, bookmarked <br><br> NOTE: This option will only work with oauth requests.\n","in":"query","name":"user_state","required":false,"schema":{"default":"","type":"string"}},{"description":"If set to 1 (the default), posts that are reposts will be included. If set to 0, reposts will be excluded. See the repost_count field of post objects for details about how reposts are identified.\n","in":"query","name":"include_reposts","required":false,"schema":{"default":1,"maximum":1,"minimum":0,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"end_index":{"description":"The index of the last post being returned (an integer between start_index and num_posts).","type":"integer"},"group_ids":{"description":"The IDs of the groups that the posts were retrieved from (will be null when no group IDs were used). These IDs may be a subset of the requested group IDs when a request includes group IDs for groups that are not open archives and that the current user is not a member of. If the open_archive_groups source is used, these IDs may include the IDs of open archive groups that weren't present in the group_ids parameter of the request.\n","items":{"type":"string"},"type":"array"},"last_listings_view":{"description":"The UTC date and time when the current user last viewed the newest posts on the All Posts page (may be null). <br /><br /> NOTE: For this to be accurate, clients must update the last_listings_view property of the current user every time the user is shown the newest posts on the All Posts page. <br /><br /> NOTE: For requests using an api key instead of oauth, this field is always null.\n","format":"date-time","type":"string"},"num_pages":{"description":"The total number of pages available.","type":"integer"},"num_posts":{"description":"The total number of posts available.","type":"integer"},"page":{"description":"The page number of the posts being returned.","type":"integer"},"per_page":{"description":"The number of posts being returned per page.","type":"integer"},"posts":{"items":{"$ref":"#/components/schemas/Post"},"type":"array"},"start_index":{"description":"The index of the first post being returned (an integer between 1 and num_posts).","type":"integer"}},"type":"object"}}},"description":"The posts and paging data."},"400":{"description":"Missing or invalid parameters."}},"security":[{"api_key":[]}],"summary":"List posts","tags":["posts"]}},"/posts/all":{"get":{"description":"This endpoint provides an easy way to get a feed of all the publicly published posts on trash nothing. It provides access to all publicly published offer and wanted posts from the last 30 days. The posts are sorted by date (newest first). <br /><br /> There are fewer options for filtering, sorting and searching posts with this endpoint but there is no 1,000 post limit and posts that are crossposted to multiple groups are not merged together in the response. In most cases, crossposted posts are easy to detect because they have the same user_id, title and content.\n","operationId":"get_all_posts","parameters":[{"description":"A comma separated list of the post types to return. The available post types are: offer, wanted\n","in":"query","name":"types","required":true,"schema":{"type":"string"}},{"description":"Only posts newer than or equal to this UTC date and time will be returned. The UTC date and time used must be within a day or less of date_max. And the date and time must be within the last 30 days. And the date and time must be rounded to the nearest second.\n","in":"query","name":"date_min","required":true,"schema":{"format":"date-time","type":"string"}},{"description":"Only posts older than this UTC date and time will be returned. The UTC date and time used must be within a day or less of date_min. And the date and time must be rounded to the nearest second.\n","in":"query","name":"date_max","required":true,"schema":{"format":"date-time","type":"string"}},{"description":"The number of posts to return per page (must be >= 1 and <= 50).","in":"query","name":"per_page","required":false,"schema":{"default":20,"maximum":50,"minimum":1,"type":"integer"}},{"description":"The page of posts to return.","in":"query","name":"page","required":false,"schema":{"default":1,"minimum":1,"type":"integer"}},{"description":"Client device pixel ratio used to determine thumbnail size (default 1.0).","in":"query","name":"device_pixel_ratio","required":false,"schema":{"default":1,"type":"number"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"posts":{"items":{"$ref":"#/components/schemas/Post"},"type":"array"}},"type":"object"}}},"description":"The posts."},"400":{"description":"Missing or invalid parameters."}},"security":[{"api_key":[]}],"summary":"List all posts","tags":["posts"]}},"/posts/all/changes":{"get":{"description":"This endpoint provides an easy way to get a feed of all the changes that have been made to publicly published posts on trash nothing. Similar to the /posts/all endpoint, only data from the last 30 days is available and the changes are sorted by date (newest first). Every change includes the date of the change, the post_id of the post that was changed and the type of change. <br /><br /> The different types of changes that are returned are listed below. <br /><br /> - deleted<br /> - undeleted<br /> - satisfied<br /> - promised<br /> - unpromised<br /> - withdrawn<br /> - edited<br /> <br /> For edited changes, clients can use the retrieve post API endpoint to get the edits that have been made to the post.\n","operationId":"get_all_posts_changes","parameters":[{"description":"Only changes newer than or equal to this UTC date and time will be returned. The UTC date and time used must be within a day or less of date_max. And the date and time must be within the last 30 days. And the date and time must be rounded to the nearest second.\n","in":"query","name":"date_min","required":true,"schema":{"format":"date-time","type":"string"}},{"description":"Only changes older than this UTC date and time will be returned. The UTC date and time used must be within a day or less of date_min. And the date and time must be rounded to the nearest second.\n","in":"query","name":"date_max","required":true,"schema":{"format":"date-time","type":"string"}},{"description":"The number of changes to return per page (must be >= 1 and <= 50).","in":"query","name":"per_page","required":false,"schema":{"default":20,"maximum":50,"minimum":1,"type":"integer"}},{"description":"The page of changes to return.","in":"query","name":"page","required":false,"schema":{"default":1,"minimum":1,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"changes":{"items":{"properties":{"date":{"description":"The UTC date and time when the post was changed.","format":"date-time","type":"string"},"post_id":{"type":"string"},"type":{"description":"The type of change. One of: deleted, undeleted, satisfied, promised, unpromised, withdrawn, edited, expired\n","type":"string"}},"type":"object"},"type":"array"}},"type":"object"}}},"description":"The changes."},"400":{"description":"Missing or invalid parameters."}},"security":[{"api_key":[]}],"summary":"List all post changes","tags":["posts"]}},"/posts/multiple":{"get":{"operationId":"get_posts_by_ids","parameters":[{"description":"A comma separated list of the post IDs. If more than 10 post IDs are passed, only the first 10 posts will be returned.\n","in":"query","name":"post_ids","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"forbidden":{"description":"The IDs of posts that are forbidden for the current user.","items":{"type":"string"},"type":"array"},"not_found":{"description":"The IDs of posts that weren't found (may have been deleted or never existed).","items":{"type":"string"},"type":"array"},"posts":{"items":{"$ref":"#/components/schemas/Post"},"type":"array"}},"type":"object"}}},"description":"The posts."}},"security":[{"api_key":[]}],"summary":"Retrieve multiple posts","tags":["posts"]}},"/posts/search":{"get":{"description":"Searching posts takes the same arguments as listing posts except for the addition of the search and sort_by parameters.\nNOTE: When paging through the posts returned by this endpoint, there will be at most 1,000 posts that can be returned (eg. 50 pages worth of posts with the default per_page value of 20). In areas where there are more than 1,000 posts, clients can use more specific query parameters to adjust which posts are returned.\n","operationId":"search_posts","parameters":[{"description":"The search query used to find posts.","in":"query","name":"search","required":true,"schema":{"type":"string"}},{"description":"How to sort the posts that are returned. One of: relevance, date, active, distance <br /><br /> Relevance sorting will sort the posts that best match the search query first. Date sorting will sort posts from newest to oldest. Active sorting will sort active posts before satisfied, withdrawn and expired posts and then sort by date. Distance sorting will sort the closest posts first.\n","in":"query","name":"sort_by","required":false,"schema":{"default":"relevance","type":"string"}},{"description":"A comma separated list of the post types to return. The available post types are: offer, taken, wanted, received, admin\n","in":"query","name":"types","required":true,"schema":{"type":"string"}},{"description":"A comma separated list of the post sources to retrieve posts from. The available sources are: groups, trashnothing, open_archive_groups. The trashnothing source is for public posts that are posted on trash nothing but are not associated with any group. The open_archive_groups source provides a way to easily request posts from groups that have open_archives set to true without having to pass a group_ids parameter. When passed, it will automatically return posts from open archive groups that are within the area specified by the latitude, longitude and radius parameters (or the current users' location if latitude, longitude and radius aren't passed). <br /><br /> NOTE: For requests using an api key instead of oauth, passing the trashnothing source or the open_archive_groups source makes the latitude, longitude and radius parameters required.\n","in":"query","name":"sources","required":true,"schema":{"type":"string"}},{"description":"A comma separated list of the group IDs to retrieve posts from. This parameter is only used if the 'groups' source is passed in the sources parameter and only groups that the current user is a member of or that are open archives groups will be used (the group IDs of other groups will be silently discarded*). <br /><br /> NOTE: For requests using an api key instead of oauth, this field is required if the 'groups' source is passed. In addition, only posts from groups that have open_archives set to true will be used (the group IDS of other groups will be silently discarded*). <br /><br/> *To determine which group IDs were used and which were discarded, use the group_ids field in the response.\n","in":"query","name":"group_ids","required":false,"schema":{"default":"The group IDs of every group the current user is a member of.","type":"string"}},{"description":"The number of posts to return per page (must be >= 1 and <= 100).","in":"query","name":"per_page","required":false,"schema":{"default":20,"maximum":100,"minimum":1,"type":"integer"}},{"description":"The page of posts to return.","in":"query","name":"page","required":false,"schema":{"default":1,"minimum":1,"type":"integer"}},{"description":"Client device pixel ratio used to determine thumbnail size (default 1.0).","in":"query","name":"device_pixel_ratio","required":false,"schema":{"default":1,"type":"number"}},{"description":"The latitude of a point around which to return posts.\n","in":"query","name":"latitude","required":false,"schema":{"type":"number"}},{"description":"The longitude of a point around which to return posts.\n","in":"query","name":"longitude","required":false,"schema":{"type":"number"}},{"description":"The radius in meters of a circle centered at the point defined by the latitude and longitude parameters. When latitude, longitude and radius are passed, only posts within the circle defined by these parameters will be returned.\n","in":"query","name":"radius","required":false,"schema":{"maximum":257500,"minimum":0,"type":"number"}},{"description":"Only posts newer than or equal to this UTC date and time will be returned. If unset, defaults to the current date and time minus 90 days.\n","in":"query","name":"date_min","required":false,"schema":{"format":"date-time","type":"string"}},{"description":"Only posts older than this UTC date and time will be returned. If unset, defaults to the current date and time.","in":"query","name":"date_max","required":false,"schema":{"format":"date-time","type":"string"}},{"description":"A comma separated list of the post outcomes to return. The available post outcomes are: satisfied, withdrawn <br /><br /> There are also a couple special values that can be passed. If set to an empty string (the default), only posts that are not satisfied and not withdrawn and not expired are returned. If set to 'all', all posts will be returned no matter what outcome the posts have. If set to 'not-promised', only posts that are not satisfied ant not withdrawn and not expired and not promised are returned.\n","in":"query","name":"outcomes","required":false,"schema":{"default":"","type":"string"}},{"description":"If user_state is set, only posts matching the state specified will be returned. Only one state may be passed and it must be one of the following: viewed, replied, bookmarked <br><br> NOTE: This option will only work with oauth requests.\n","in":"query","name":"user_state","required":false,"schema":{"default":"","type":"string"}},{"description":"If set to 1 (the default), posts that are reposts will be included. If set to 0, reposts will be excluded. See the repost_count field of post objects for details about how reposts are identified.\n","in":"query","name":"include_reposts","required":false,"schema":{"default":1,"maximum":1,"minimum":0,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"end_index":{"description":"The index of the last post being returned (an integer between start_index and num_posts).","type":"integer"},"group_ids":{"description":"The IDs of the groups that the posts were retrieved from (will be null when no group IDs were used). These IDs may be a subset of the requested group IDs when a request includes group IDs for groups that are not open archives and that the current user is not a member of. If the open_archive_groups source is used, these IDs may include the IDs of open archive groups that weren't present in the group_ids parameter of the request.\n","items":{"type":"string"},"type":"array"},"num_pages":{"description":"The total number of pages available.","type":"integer"},"num_posts":{"description":"The total number of posts available.","type":"integer"},"page":{"description":"The page number of the posts being returned.","type":"integer"},"per_page":{"description":"The number of posts being returned per page.","type":"integer"},"posts":{"items":{"$ref":"#/components/schemas/PostSearchResult"},"type":"array"},"start_index":{"description":"The index of the first post being returned (an integer between 1 and num_posts).","type":"integer"}},"type":"object"}}},"description":"The posts and paging data."},"400":{"description":"Missing or invalid parameters."}},"security":[{"api_key":[]}],"summary":"Search posts","tags":["posts"]}},"/posts/{post_id}":{"get":{"operationId":"get_post","parameters":[{"description":"The ID of the post to retrieve.","in":"path","name":"post_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Post"}}},"description":"The post."},"403":{"description":"The user doesn't have permission to access the post."},"404":{"description":"Post not found."}},"security":[{"api_key":[]}],"summary":"Retrieve a post","tags":["posts"]}},"/posts/{post_id}/display":{"get":{"description":"Retrieve a post and other data related to the post that is useful for displaying the post such as data about the user who posted the post and the groups the post was posted on.\n","operationId":"get_post_and_related_data","parameters":[{"description":"The ID of the post to retrieve.","in":"path","name":"post_id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"author":{"$ref":"#/components/schemas/User"},"author_offer_count":{"description":"Count of offer posts made by the post author in the last 90 days.","type":"integer"},"author_posts":{"description":"Other active posts from the post author in the last 90 days. A maximum of 30 posts will be returned.\n","items":{"$ref":"#/components/schemas/Post"},"type":"array"},"author_wanted_count":{"description":"Count of wanted posts made by the post author in the last 90 days.","type":"integer"},"bookmarked":{"description":"Whether or not the current user has bookmarked this post. Will be null for api key requests and for the current users' posts.","type":"boolean"},"feedback":{"description":"Feedback the current user has left on the post author.","items":{"$ref":"#/components/schemas/Feedback"},"type":"array"},"groups":{"description":"The groups the post is published on.","items":{"$ref":"#/components/schemas/Group"},"type":"array"},"post":{"$ref":"#/components/schemas/Post"},"replied":{"description":"Whether or not the current user has replied to this post. Will be null for api key requests and for the current users' posts.","type":"boolean"},"user_can_reply":{"description":"Whether or not the current user (if any) can reply to this post. Unverified users cannot reply to posts until they verify their account.\n","type":"boolean"},"viewed":{"description":"Whether or not the current user has previously viewed this post. Will be null for api key requests and for the current users' posts.","type":"boolean"}},"type":"object"}}},"description":"The post and related data."},"403":{"description":"The user doesn't have permission to access the post."},"404":{"description":"Post not found."}},"security":[{"api_key":[]}],"summary":"Retrieve post display data","tags":["posts"]}},"/users/{user_id}/posts":{"get":{"description":"","operationId":"get_user_posts","parameters":[{"description":"The user ID of the user whose posts will be retrieved. Using 'me' as the user_id will return the posts for the current user.\n","in":"path","name":"user_id","required":true,"schema":{"type":"string"}},{"description":"How to sort the posts that are returned. One of: date, active, distance <br /><br />\nDate sorting will sort posts from newest to oldest. Active sorting will sort active posts before satisfied, withdrawn and expired posts and then sort by date. Distance sorting will sort the closest posts first.\n","in":"query","name":"sort_by","required":false,"schema":{"default":"date","type":"string"}},{"description":"A comma separated list of the post types to return. The available post types are: offer, taken, wanted, received, admin\n","in":"query","name":"types","required":true,"schema":{"type":"string"}},{"description":"A comma separated list of the post sources to retrieve posts from. The available sources are: groups, trashnothing, open_archive_groups. The trashnothing source is for public posts that are posted on trash nothing but are not associated with any group. The open_archive_groups source provides a way to easily request posts from groups that have open_archives set to true without having to pass a group_ids parameter. When passed, it will automatically return posts from open archive groups that are within the area specified by the latitude, longitude and radius parameters (or all the open archive groups the requested user has posted to if latitude, longitude and radius aren't passed). <br /><br /> NOTE: For requests using an api key instead of oauth, passing the trashnothing source or the open_archive_groups source makes the latitude, longitude and radius parameters required.\n","in":"query","name":"sources","required":true,"schema":{"type":"string"}},{"description":"A comma separated list of the group IDs to retrieve posts from. This parameter is only used if the 'groups' source is passed in the sources parameter and only groups that the current user is a member of or that are open archives groups will be used (the group IDs of other groups will be silently discarded*). <br /><br /> NOTE: For requests using an api key instead of oauth, this field is required if the 'groups' source is passed. In addition, only posts from groups that have open_archives set to true will be used (the group IDS of other groups will be silently discarded*). <br /><br/> *To determine which group IDs were used and which were discarded, use the group_ids field in the response.\n","in":"query","name":"group_ids","required":false,"schema":{"default":"The group IDs of every group the current user is a member of.","type":"string"}},{"description":"The number of posts to return per page (must be >= 1 and <= 100).","in":"query","name":"per_page","required":false,"schema":{"default":20,"maximum":100,"minimum":1,"type":"integer"}},{"description":"The page of posts to return.","in":"query","name":"page","required":false,"schema":{"default":1,"minimum":1,"type":"integer"}},{"description":"Client device pixel ratio used to determine thumbnail size (default 1.0).","in":"query","name":"device_pixel_ratio","required":false,"schema":{"default":1,"type":"number"}},{"description":"The latitude of a point around which to return posts.\n","in":"query","name":"latitude","required":false,"schema":{"type":"number"}},{"description":"The longitude of a point around which to return posts.\n","in":"query","name":"longitude","required":false,"schema":{"type":"number"}},{"description":"The radius in meters of a circle centered at the point defined by the latitude and longitude parameters. When latitude, longitude and radius are passed, only posts within the circle defined by these parameters will be returned.\n","in":"query","name":"radius","required":false,"schema":{"maximum":257500,"minimum":0,"type":"number"}},{"description":"Only posts newer than or equal to this UTC date and time will be returned.\n","in":"query","name":"date_min","required":false,"schema":{"format":"date-time","type":"string"}},{"description":"Only posts older than this UTC date and time will be returned.","in":"query","name":"date_max","required":false,"schema":{"format":"date-time","type":"string"}},{"description":"A comma separated list of the post outcomes to return. The available post outcomes are: satisfied, withdrawn <br /><br /> There are also a couple special values that can be passed. If set to an empty string (the default), only posts that are not satisfied and not withdrawn and not expired are returned. If set to 'all', all posts will be returned no matter what outcome the posts have. If set to 'not-promised', only posts that are not satisfied ant not withdrawn and not expired and not promised are returned.\n","in":"query","name":"outcomes","required":false,"schema":{"default":"","type":"string"}},{"description":"If set to 1 (the default), posts that are reposts will be included. If set to 0, reposts will be excluded. See the repost_count field of post objects for details about how reposts are identified.\n","in":"query","name":"include_reposts","required":false,"schema":{"default":1,"maximum":1,"minimum":0,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"end_index":{"description":"The index of the last post being returned (an integer between start_index and num_posts).","type":"integer"},"group_ids":{"description":"The IDs of the groups that the posts were retrieved from (will be null when no group IDs were used). These IDs may be a subset of the requested group IDs when a request includes group IDs for groups that are not open archives and that the current user is not a member of. If the open_archive_groups source is used, these IDs may include the IDs of open archive groups that weren't present in the group_ids parameter of the request.\n","items":{"type":"string"},"type":"array"},"last_listings_view":{"description":"The UTC date and time when the current user last viewed the newest posts on the All Posts page (may be null). <br /><br /> NOTE: For this to be accurate, clients must update the last_listings_view property of the current user every time the user is shown the newest posts on the All Posts page. <br /><br /> NOTE: For requests using an api key instead of oauth, this field is always null.\n","format":"date-time","type":"string"},"num_pages":{"description":"The total number of pages available.","type":"integer"},"num_posts":{"description":"The total number of posts available.","type":"integer"},"page":{"description":"The page number of the posts being returned.","type":"integer"},"per_page":{"description":"The number of posts being returned per page.","type":"integer"},"posts":{"items":{"$ref":"#/components/schemas/Post"},"type":"array"},"start_index":{"description":"The index of the first post being returned (an integer between 1 and num_posts).","type":"integer"}},"type":"object"}}},"description":"The posts and paging data."},"400":{"description":"Missing or invalid parameters."}},"security":[{"api_key":[]}],"summary":"List posts by a user","tags":["users"]}},"/users/{user_id}/posts/search":{"get":{"description":"Searching posts takes the same arguments as listing posts except for the addition of the search and sort_by parameters.\n","operationId":"search_user_posts","parameters":[{"description":"The user ID of the user whose posts will be retrieved. Using 'me' as the user_id will return the posts for the current user.\n","in":"path","name":"user_id","required":true,"schema":{"type":"string"}},{"description":"The search query used to find posts.","in":"query","name":"search","required":true,"schema":{"type":"string"}},{"description":"How to sort the posts that are returned. One of: relevance, date, active, distance <br /><br /> Relevance sorting will sort the posts that best match the search query first. Date sorting will sort posts from newest to oldest. Active sorting will sort active posts before satisfied, withdrawn and expired posts and then sort by date. Distance sorting will sort the closest posts first.\n","in":"query","name":"sort_by","required":false,"schema":{"default":"relevance","type":"string"}},{"description":"A comma separated list of the post types to return. The available post types are: offer, taken, wanted, received, admin\n","in":"query","name":"types","required":true,"schema":{"type":"string"}},{"description":"A comma separated list of the post sources to retrieve posts from. The available sources are: groups, trashnothing, open_archive_groups. The trashnothing source is for public posts that are posted on trash nothing but are not associated with any group. The open_archive_groups source provides a way to easily request posts from groups that have open_archives set to true without having to pass a group_ids parameter. When passed, it will automatically return posts from open archive groups that are within the area specified by the latitude, longitude and radius parameters (or all the open archive groups the requested user has posted to if latitude, longitude and radius aren't passed). <br /><br /> NOTE: For requests using an api key instead of oauth, passing the trashnothing source or the open_archive_groups source makes the latitude, longitude and radius parameters required.\n","in":"query","name":"sources","required":true,"schema":{"type":"string"}},{"description":"A comma separated list of the group IDs to retrieve posts from. This parameter is only used if the 'groups' source is passed in the sources parameter and only groups that the current user is a member of or that are open archives groups will be used (the group IDs of other groups will be silently discarded*). <br /><br /> NOTE: For requests using an api key instead of oauth, this field is required if the 'groups' source is passed. In addition, only posts from groups that have open_archives set to true will be used (the group IDS of other groups will be silently discarded*). <br /><br/> *To determine which group IDs were used and which were discarded, use the group_ids field in the response.\n","in":"query","name":"group_ids","required":false,"schema":{"default":"The group IDs of every group the current user is a member of.","type":"string"}},{"description":"The number of posts to return per page (must be >= 1 and <= 100).","in":"query","name":"per_page","required":false,"schema":{"default":20,"maximum":100,"minimum":1,"type":"integer"}},{"description":"The page of posts to return.","in":"query","name":"page","required":false,"schema":{"default":1,"minimum":1,"type":"integer"}},{"description":"Client device pixel ratio used to determine thumbnail size (default 1.0).","in":"query","name":"device_pixel_ratio","required":false,"schema":{"default":1,"type":"number"}},{"description":"The latitude of a point around which to return posts.\n","in":"query","name":"latitude","required":false,"schema":{"type":"number"}},{"description":"The longitude of a point around which to return posts.\n","in":"query","name":"longitude","required":false,"schema":{"type":"number"}},{"description":"The radius in meters of a circle centered at the point defined by the latitude and longitude parameters. When latitude, longitude and radius are passed, only posts within the circle defined by these parameters will be returned.\n","in":"query","name":"radius","required":false,"schema":{"maximum":257500,"minimum":0,"type":"number"}},{"description":"Only posts newer than or equal to this UTC date and time will be returned.\n","in":"query","name":"date_min","required":false,"schema":{"format":"date-time","type":"string"}},{"description":"Only posts older than this UTC date and time will be returned.","in":"query","name":"date_max","required":false,"schema":{"format":"date-time","type":"string"}},{"description":"A comma separated list of the post outcomes to return. The available post outcomes are: satisfied, withdrawn <br /><br /> There are also a couple special values that can be passed. If set to an empty string (the default), only posts that are not satisfied and not withdrawn and not expired are returned. If set to 'all', all posts will be returned no matter what outcome the posts have. If set to 'not-promised', only posts that are not satisfied ant not withdrawn and not expired and not promised are returned.\n","in":"query","name":"outcomes","required":false,"schema":{"default":"","type":"string"}},{"description":"If set to 1 (the default), posts that are reposts will be included. If set to 0, reposts will be excluded. See the repost_count field of post objects for details about how reposts are identified.\n","in":"query","name":"include_reposts","required":false,"schema":{"default":1,"maximum":1,"minimum":0,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"end_index":{"description":"The index of the last post being returned (an integer between start_index and num_posts).","type":"integer"},"group_ids":{"description":"The IDs of the groups that the posts were retrieved from (will be null when no group IDs were used). These IDs may be a subset of the requested group IDs when a request includes group IDs for groups that are not open archives and that the current user is not a member of. If the open_archive_groups source is used, these IDs may include the IDs of open archive groups that weren't present in the group_ids parameter of the request.\n","items":{"type":"string"},"type":"array"},"num_pages":{"description":"The total number of pages available.","type":"integer"},"num_posts":{"description":"The total number of posts available.","type":"integer"},"page":{"description":"The page number of the posts being returned.","type":"integer"},"per_page":{"description":"The number of posts being returned per page.","type":"integer"},"posts":{"items":{"$ref":"#/components/schemas/PostSearchResult"},"type":"array"},"start_index":{"description":"The index of the first post being returned (an integer between 1 and num_posts).","type":"integer"}},"type":"object"}}},"description":"The posts and paging data."},"400":{"description":"Missing or invalid parameters."}},"security":[{"api_key":[]}],"summary":"Search posts by a user","tags":["users"]}}},"components":{"schemas":{"Feedback":{"example":{"content":"Fred gave me a great antique table for my new apartment!","date":"2025-06-15T13:47:59.894Z","positive":true,"reviewer_user_id":9191,"user_id":2946512},"properties":{"content":{"description":"A comment written by the reviewer about the user (may be null).","type":"string"},"date":{"description":"Date when the feedback was submitted.","format":"date-time","type":"string"},"feedback_id":{"type":"string"},"positive":{"description":"Set to true for positive feedback and false for negative feedback.","type":"boolean"},"reviewer_user_id":{"description":"The user ID of the user that submitted the feedback.","type":"string"},"user_id":{"description":"The user ID of the user that the feedback is about.","type":"string"}},"type":"object"},"Group":{"description":"Groups are run by volunteer moderators and provide a way to group activity in a specific location. Because each group is usually run by different people, there can be variations in rules from group to group (eg. who is allowed to join, what is allowed to be posted, how often reposts are allowed).\n","example":{"country":{"abbreviation":"CA","name":"Canada"},"group_id":46,"has_questions":true,"homepage":"https://trashnothing.com/OttawaReuse","identifier":"OttawaReuse","latitude":45.423494,"longitude":-75.697933,"member_count":4838,"membership":{"date":"2025-06-15T13:47:59.894Z","questionnaire":{"message":"This group is only for people who live in Ottawa.","questions":["Where do you live?"]},"status":"pending-questions"},"name":"Ottawa Reuse","open_archives":false,"open_membership":false,"region":{"abbreviation":"ON","name":"Ontario"},"timezone":"America/Toronto"},"properties":{"country":{"description":"Provides information about the country that is associated with a group. May be null.","example":{"abbreviation":"US","name":"United States"},"properties":{"abbreviation":{"description":"A 2 letter country code for the country (see https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 ).\n","type":"string"},"name":{"description":"The name of the country.","type":"string"}},"type":"object"},"group_id":{"type":"string"},"has_questions":{"description":"When true, anyone requesting membership to this group will be required to answer a new membership questionnaire.","type":"boolean"},"homepage":{"description":"A URL to the group homepage.","type":"string"},"identifier":{"description":"A unique identifier for the group that is used in URLs.","type":"string"},"latitude":{"type":"number"},"longitude":{"type":"number"},"member_count":{"description":"The number of members who belong to the group.","type":"integer"},"membership":{"description":"Provides information about the current users' active or pending membership to this group (if any). Will be null if there is no active or pending membership to this group.\n","properties":{"date":{"description":"The UTC date and time when the membership was last updated.\n","format":"date-time","type":"string"},"questionnaire":{"description":"Membership questionnaire data. Will be null unless the membership status is pending-questions.","properties":{"message":{"description":"A message from the group moderators to be displayed above the questions (may be null).","type":"string"},"questions":{"description":"The list of questions.","items":{"type":"string"},"type":"array"}},"type":"object"},"status":{"description":"One of: subscribed, pending, pending-questions\n","type":"string"}},"type":"object"},"name":{"description":"The name of the group (not guaranteed to be unique).","type":"string"},"open_archives":{"description":"When true, the group posts are viewable by anyone. When false, the group posts can only be viewed by members of the group.","type":"boolean"},"open_membership":{"description":"When true, the group allows anyone to join. When false, the group moderators review and approve applicants.","type":"boolean"},"region":{"description":"Provides information about an area within a country that a group is associated with (eg. a state in the US or a province in Canada). May be null.","example":{"abbreviation":"CA","name":"California"},"properties":{"abbreviation":{"description":"A 2 letter abbreviation for the region (is not guaranteed to be globally unique but is unique among all the regions in the country).","type":"string"},"name":{"description":"The name of the region.","type":"string"}},"type":"object"},"timezone":{"description":"The timezone that the group is in (eg. America/New_York).","type":"string"}},"type":"object"},"Photo":{"example":{"blurhash":"TkJ7jsoz%f~VoLxu-pWCWB-oj[M|","images":[{"height":120,"url":"https://trashnothing.com/img/2018-02-05/cfsbfm-39051735845_379baab73f.90x120.jpg","width":90},{"height":240,"url":"https://trashnothing.com/img/2018-02-05/cfsbfm-39051735845_379baab73f.180x240.jpg","width":180},{"height":360,"url":"https://trashnothing.com/img/2018-02-05/cfsbfm-39051735845_379baab73f.270x360.jpg","width":270},{"height":500,"url":"https://trashnothing.com/img/2018-02-05/cfsbfm-39051735845_379baab73f.375x500.jpg"