エンドユーザー
エンドユーザー取得
対象アプリ:Chatflow、Workflow、Agent、チャットボット、レガシー Agent、テキストジェネレーター。
ID を指定してエンドユーザーの詳細を返します。別のエンドポイントが返したエンドユーザー ID(例:ファイルをアップロード レスポンスの created_by)を解決するのに便利です。
GET
/
end-users
/
{end_user_id}
エンドユーザー取得
curl --request GET \
--url https://{api_base_url}/end-users/{end_user_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://{api_base_url}/end-users/{end_user_id}"
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}/end-users/{end_user_id}', 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}/end-users/{end_user_id}",
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}/end-users/{end_user_id}"
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}/end-users/{end_user_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{api_base_url}/end-users/{end_user_id}")
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{
"app_id": "a1b2c3d4-5678-90ab-cdef-1234567890ab",
"created_at": "2024-01-16T12:00:29Z",
"external_user_id": "abc-123",
"id": "f1e2d3c4-b5a6-7890-abcd-ef1234567890",
"is_anonymous": false,
"name": null,
"session_id": "abc-123",
"tenant_id": "11223344-5566-7788-99aa-bbccddeeff00",
"type": "service-api",
"updated_at": "2024-01-16T12:00:29Z"
}{
"code": "end_user_not_found",
"message": "End user not found.",
"status": 404
}Authorizations
すべてのリクエストは API キーで認証します:Authorization: Bearer {API_KEY}。アプリのエンドポイントにはアプリの API キーを、ナレッジのエンドポイントにはナレッジベースの API キーを使用します(Dify API クイックスタート)。
キーはサーバーサイドで保管し、クライアントコードには決して埋め込まないでください。キーが欠落または無効なリクエストは HTTP 401(unauthorized)で失敗します。
Path Parameters
照会するエンドユーザーの ID です。
Response
エンドユーザーを正常に取得しました。
アプリケーション ID。
作成タイムスタンプ。
API リクエストで提供された user 識別子です(例:チャットメッセージを送信 の user フィールド)。
エンドユーザー ID。
ユーザーが匿名かどうかを示します。元の API リクエストで user 識別子が提供されなかった場合、true になります。
エンドユーザー名。
セッション識別子。デフォルトは external_user_id の値です。
テナント ID。
エンドユーザーのタイプ。Service API ユーザーの場合は常に service-api です。
最終更新タイムスタンプ。
Last modified on September 30, 2026
Was this page helpful?
⌘I
エンドユーザー取得
curl --request GET \
--url https://{api_base_url}/end-users/{end_user_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://{api_base_url}/end-users/{end_user_id}"
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}/end-users/{end_user_id}', 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}/end-users/{end_user_id}",
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}/end-users/{end_user_id}"
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}/end-users/{end_user_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{api_base_url}/end-users/{end_user_id}")
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{
"app_id": "a1b2c3d4-5678-90ab-cdef-1234567890ab",
"created_at": "2024-01-16T12:00:29Z",
"external_user_id": "abc-123",
"id": "f1e2d3c4-b5a6-7890-abcd-ef1234567890",
"is_anonymous": false,
"name": null,
"session_id": "abc-123",
"tenant_id": "11223344-5566-7788-99aa-bbccddeeff00",
"type": "service-api",
"updated_at": "2024-01-16T12:00:29Z"
}{
"code": "end_user_not_found",
"message": "End user not found.",
"status": 404
}