Skip to main content
GET
/
apps
/
annotations
List Annotations
curl --request GET \
  --url https://{api_base_url}/apps/annotations \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://{api_base_url}/apps/annotations"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://{api_base_url}/apps/annotations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://{api_base_url}/apps/annotations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://{api_base_url}/apps/annotations"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("Authorization", "Bearer <token>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://{api_base_url}/apps/annotations")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://{api_base_url}/apps/annotations")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
{
  "data": [
    {
      "id": "a1b2c3d4-5678-90ab-cdef-1234567890ab",
      "question": "What is Dify?",
      "answer": "Dify is an open-source LLM application development platform.",
      "hit_count": 5,
      "created_at": 1705407629
    }
  ],
  "has_more": false,
  "limit": 20,
  "total": 1,
  "page": 1
}

Authorizations

Authorization
string
header
required

Every request authenticates with an API key: Authorization: Bearer {API_KEY}. App endpoints take an app API key; knowledge endpoints take a knowledge base API key (Get Started).

Keep keys server-side; never embed them in client code. Requests with a missing or invalid key fail with HTTP 401 (unauthorized).

Query Parameters

page
integer
default:1

Page number.

Required range: x >= 1
limit
integer
default:20

Number of items per page. Requests above 100 are capped at 100.

Required range: x >= 1
keyword
string

Keyword to filter annotations by question or answer content.

Response

200 - application/json

Successfully retrieved annotation list.

data
object[]

List of annotation items for the current page.

has_more
boolean

true if more pages are available beyond the current result set.

limit
integer

Number of items per page.

total
integer

Total number of annotations matching the query.

page
integer

Current page number.