π How to use Discut API
Discut provides RESTful API that you can use to create custom integrations, bots, or clients.
Create integration and acquire API key
To start using Discut API you need to create an integration in settings. Go to Settings > Manage integrations > Add integration
. Choose a name for the integration and hit Create.
Now you should see details of the integration you just created. You will need the API key to make requests to Discut API. Save it somewhere safe and proceed to the next section.
You can revoke API access for the integration anytime by removing it. Just click Delete integration to do so.
Make API requests
Now that we got an API key, we can make a request to Discut API.
All requests to Discut API must include API key. You can provide the key in two ways:
by setting
Authorization: Bearer <API key>
header (recommended);by setting
api_key=<API key>
query parameter.
While we generally recommend using Authorization header, you still can fallback to the query parameter if setting the header is not an option.
Here is an example request that creates a new member in Discut. It's common to import a user automatically after registration on your platform (donβt forget to replace <your-domain>
and <YOUR_API_KEY_GOES_HERE>
):
curl -X 'POST' \
'https://<your-domain>/api/v1/users' \
-H 'accept: application/json' \
-H 'Authorization: Bearer <YOUR_API_KEY_GOES_HERE>' \
-H 'Content-Type: application/json' \
-d '{
"email": "community-member@gmail.com",
"name": "John Smith"
}'
Here is the same example, but in JavaScript (btw, the name field is optional):
fetch("https://<your-domain>/api/v1/users", {
body: JSON.stringify({
email: "community-member@gmail.com",
name: "John Smith",
}),
headers: {
Accept: "application/json",
Authorization: "Bearer <YOUR_API_KEY_GOES_HERE>",
"Content-Type": "application/json",
},
method: "POST",
});
Or using query parameter:
fetch("https://<your-domain>/api/v1/users?api_key=<YOUR_API_KEY_GOES_HERE>", {
body: JSON.stringify({
email: "community-member@gmail.com",
name: "John Smith",
}),
headers: {
"Content-Type": "application/json",
},
method: "POST",
});
Now that you know how to invoke API endpoints, let's see what Discut API has to offer.
OpenAPI and Swagger UI
You can find OpenAPI document at https://<your-domain>/api/v1/openapi.json
. You can generate API clients from it or import the document into your favorite GUI API Client (e.g., Insomnia).
We also host Swagger UI for your convenience at https://<your-domain>/api/v1/swagger-ui/
. You can execute API endpoints directly from Swagger UI by clicking Authorize button:

And then, enter an API key from a Discut integration (see instructions above):

And it's all done! Now let's retrieve boards to verify that everything works:

And then hit Execute button:

Now you should see JSON that contains an array with boards of your Discut. If you get a non-200 response, please ensure that the API key is valid and you provided the API key using the Authorize button described above.