Management API Reference
This page describes all available API endpoints.
The management API allows to programmatically retrieve and modify the fact
checking specific data. The API is exclusively reachable via HTTPS. All
endpoints are prefixed with
/api/vversion
. All data is transferred as and
expected to have the content type application/json
, encoded as
UTF-8.
- Authentication and authorization
- Pagination, filtering and sorting
- Rate Limiting
- Further Reading
- Webhooks
- Webhook Calls
- Agents
- Research
If you miss anything here or have suggestions or simply want to ask a human being, you can send us a message at the bottom of this page. All messages sent via that form will be read by the development team directly.
Authentication and authorization
To authenticate to the API, you will need to include your channel-wide API key as a bearer token:
GET /api/v0 HTTP/1.1
Host: factchecking.messengerpeople.dev
Authorization: Bearer {{YOUR_API_KEY}}
You can find your API key here. Please keep in mind that this token has administrative privileges for the entire channel, so make sure to keep it protected to prevent unauthorized access or data breaches.
Pagination, filtering and sorting
All API endpoints that list records support generic mechanisms to paginate, filter, sort, and query items. This works by using a set of standard parameters in the query string:
-
To paginate, you may use the
page
andper_page
query parameters. Depending on the resource, the maximum page size may have an upper limit other than the default of 100 records. By passingpage=3
, for example, you would retrieve the third page of all results with the default page size set. By passing?page=3&per_page=20
, you would retrieve the third page of all results for a page size of 20.
To retrieve the total number of records on the server, you can review the response headers. If a response contains a paginated result set, we add theX-Total-Items
header to the response. It contains the number of records that match your current filters and search term. -
To search for records, you may use the
query
query parameter. By setting it to a search term, a substring search will be performed in the fields allowed to search for this specific resource.
By passing?query=example
, the platform would search for any item matching this substring. While similar to the filter expressions, search queries allow searching multiple fields, possibly using advanced searching algorithms rather than a mere substring comparison.
Check the documentation of a specific endpoint to find notes about searches. -
To sort records, you may use the
sort
query parameter. It can be used multiple times to sort by multiple fields. By passing?sort=created_at
, for example, you would sort by the created_at field in ascending direction. To search in descending direction, you would need to pass?sort=created_at:desc
. You can also explicitly request ascending sorting by passing?sort=created_at:asc
, though this is the default value and not strictly required. To sort by multiple fields, you may either pass multiple fields separated by a comma:?sort=created_at:asc,foo:desc
or add the query parameter multiple times:?sort[]=created_at:asc&sort[]=foo:desc
. -
To filter records, you may use the
filter
query parameter. It can be used multiple times to apply multiple filters. Filters can be specified in a simple combination of field name, comparison operator and value. The following expressions may be used:- Equality comparison:
field=value
- Substring comparison:
field:value
- Greater than comparison:
field>value
- Greater than or equal comparison:
field>=value
- Lower than comparison:
field<value
- Lower than or equal comparison:
field<=value
- Unequal comparison:
field!=value
- Null check:
!field
- Not null check:
field
%3D
instead:?filter=field%3Dvalue
. We recommend to use a library that takes care of query parameter serialization to avoid any issues from broken filter expressions. The following examples use the un-encoded operators for improved readability. Filters may be chained bei either comma-separating the individual expressions:?filter=field1:value,field2>42
or passing the filter query parameter multiple times:?filter[]=field1:value&filter[]=field2>42
. - Equality comparison:
Rate limiting
While the API does currently not employ strict rate limits, we reserve the right to employ such measures at any time if we detect abusive behaviour beyond the existing characteristics our web application firewall scans for. This is nothing you should worry about, however, if you do not actively try to probe or damage the integrity of our platform.
HTTP Status Codes
As a web API, we make extensive use of HTTP status codes. This means that you can generally rely on the meaning of status codes as documented by MDN, for example. The following rules apply:
-
If a request to our API was successful, and has any data in its
response body, we send a status of
200 - OK
. -
If a request to our API was successful, and caused a resource to be
created, we send a status of
201 - Created
. The response will include aLocation
header that points to the new resource. -
If a request to our API was successful, but did not explicitly
request information, we don't send superfluous response bodies.
Therefore, the status code will be
204 - No Content
. This also applies to requests that update or delete resources. -
If a request to our API failed due to a missing, broken, outdated or
otherwise invalid token, we send a status code of
401 - Unauthorized
.
For most authorization issues (requests for information the account has no access to), we throw404 - Not Found
errors instead of403 - Forbidden
, with the reasoning here being that we don't want to disclose the existence of information. However, there may be specific cases where a403 - Forbidden
might be thrown. -
If a request to our API failed due to a broken request body, an unknown
content type or other parsing errors, or if the request body cannot be
validated, we send a status code of
400 - Bad Request
. -
If a request to our API fails due to an error on our side, we send a
status code of
500 - Internal Server Error
. The platform is built with a heavy focus on returning usable error responses despite all else, so you should be able to find more information about the error in the response. - Some endpoints may have their own, unique rules regarding possible error codes. These rules should be outlined in the reference documentation further down on this page!
Error Handling
Sometimes, things break. That's okay! We have built the API in such a way
that the errors are as helpful as possible, no matter whether its our
software or yours that caused the issue.
Every error we throw will render as a nicely formatted HTML error page if
shown in a browser, and a JSON object for API requests from other user
agents. Both views include several details on the error:
- The error message. This is a message for humans, for the most part, that we try to keep readable for non-technical folks. It should give a hint on what went wrong. If you happen to see an error message that is unclear or overly technical, please let us know.
-
A detailed hint. The hint contains technical details on
what caused the error, and how to resolve it. This is actually directed
at developers and might contain l33tsp3ak, too :)
If you encounter a hint that is unhelpful or vague, please let us know. - A correlation ID. This is a UUID generated specifically for your request that helps us locating the details of your request and the actual exception thrown in our monitoring systems. If you keep hitting an error and need help in debugging, tell us the correlation ID.
- A stack trace (hopefully not!). In some environments, our platform will include full stack traces in error responses. You will likely never see them, unless if we invite you to a preview version. We'd like to ask you to keep the details of these stack traces confidential. They don't contain any dark secrets, and we're not shy about our tech stack, but might help attackers finding entry points.
An example response might look like the following:
{ "error": "Not authorized", "hint": "Authorization header is missing from request", "correlation_id": "8fb6d7e7-861a-4de2-ac9d-494d81e4767a" }
Further reading
We also recommend to take a look at the MCP REST API for other resources, as it provides live updates for MCP users.