graphistry-rest-api
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGraphistry REST API
Graphistry REST API
Scope
适用范围
Use this skill for Graphistry REST endpoint tasks, including JWT auth, uploads, graph URL controls, sessions, and token-safe sharing.
本技能适用于Graphistry REST端点相关任务,包括JWT认证、上传、图URL控制、会话以及基于令牌的安全分享。
Speed-First Rules
优先提速规则
- Default to no shell commands and no local repo lookups; answer from this skill's endpoint map/templates.
- Only inspect local files when the user explicitly asks for source-level proof.
- For constrained prompts (line counts, bullets, "snippet only"), do not add prefaces like "Using <skill>".
- Keep outputs short and literal; avoid exploratory prose.
- 默认不使用shell命令,不查询本地仓库;仅根据本技能的端点映射/模板作答。
- 仅当用户明确要求源代码级别的验证时,才检查本地文件。
- 对于受限制的提示(如行数限制、项目符号、“仅提供代码片段”),不要添加诸如“使用<skill>”之类的前缀。
- 输出要简短、直白;避免探索性的描述。
Fast Targeted Fetch Protocol
快速定向获取协议
- Start from for the curated Hub REST navigation map.
references/hub-rest-docs-toc.md - Use as the machine-checkable inventory and prefer links with status
references/hub-rest-docs-links.tsv.200 - If a needed page is missing from references, check and add an explicit inference note before using adjacent docs.
https://hub.graphistry.com/docs/api/ - Avoid broad docs crawling when a referenced canonical page already answers the question.
- 从获取经过整理的Hub REST导航映射。
references/hub-rest-docs-toc.md - 使用作为可机器校验的清单,优先选择状态为
references/hub-rest-docs-links.tsv的链接。200 - 如果参考资料中缺少所需页面,请访问,并在使用相邻文档前添加明确的推断说明。
https://hub.graphistry.com/docs/api/ - 当已有参考的标准页面可以回答问题时,避免广泛爬取文档。
Core Endpoint Map
核心端点映射
- Auth:
/api-token-auth//api-token-refresh//api-token-verify//api/v2/auth/pkey/jwt/
- Upload lifecycle:
/api/v2/files//api/v2/upload/files//api/v2/upload/datasets/
- Dataset lifecycle:
/api/v2/datasets/?limit=100/api/v2/upload/datasets//api/v2/datasets/{dataset_id}/
- Single-use gateway:
GET /api/v2/generate/single-use-url/?username=<username>&dataset_id=<dataset_id>GET /api/v2/logout-user/username/<username>/
- Sessions API:
/api/experimental/viz/sessions//api/experimental/viz/sessions/{session_id}/
- Named endpoints (GFQL/Python UDF flow):
/api/v2/o/<org>/functions/gfql//api/v2/o/<org>/functions/python//api/v2/o/<org>/run/gfql/<uuid_or_alias>/api/v2/o/<org>/run/python/<uuid_or_alias>
- Health/readiness checks (deployment/admin scope):
/healthcheck//ht//healthz/streamgl-viz/health/pivot/health/streamgl-sessions/health/streamgl-gpu/primary/health/streamgl-gpu/secondary/cpu/health/streamgl-gpu/secondary/gpu/health
- 认证:
/api-token-auth//api-token-refresh//api-token-verify//api/v2/auth/pkey/jwt/
- 上传生命周期:
/api/v2/files//api/v2/upload/files//api/v2/upload/datasets/
- 数据集生命周期:
/api/v2/datasets/?limit=100/api/v2/upload/datasets//api/v2/datasets/{dataset_id}/
- 一次性网关:
GET /api/v2/generate/single-use-url/?username=<username>&dataset_id=<dataset_id>GET /api/v2/logout-user/username/<username>/
- 会话API:
/api/experimental/viz/sessions//api/experimental/viz/sessions/{session_id}/
- 命名端点(GFQL/Python UDF流程):
/api/v2/o/<org>/functions/gfql//api/v2/o/<org>/functions/python//api/v2/o/<org>/run/gfql/<uuid_or_alias>/api/v2/o/<org>/run/python/<uuid_or_alias>
- 健康/就绪检查(部署/管理员范围):
/healthcheck//ht//healthz/streamgl-viz/health/pivot/health/streamgl-sessions/health/streamgl-gpu/primary/health/streamgl-gpu/secondary/cpu/health/streamgl-gpu/secondary/gpu/health
Response Discipline
响应规范
- Keep snippets short and directly runnable.
- Prefer deterministic literal endpoint references.
- For checklist asks, keep to requested bullet counts.
- For sessions summaries, keep them concise when requested.
- For auth snippets that require env-vars-only usage, include explicit lines and avoid quoted assignment values.
export GRAPHISTRY_* - For upload/dataset bridge asks, include a literal line.
/api/v2/upload/datasets/ - For examples, always include
/api/v2/upload/datasets/(usemetadatawhen no custom metadata is needed).{} - For upload/encoding bridge asks, avoid large standalone JSON blocks when concise bullets or short snippets are enough.
- For file upload lifecycle endpoint-sequence asks, prefer listing ,
/api/v2/files/,/api/v2/upload/files/in order./api/v2/upload/datasets/ - For nodes/edges format-pattern asks, include literal tokens: ,
nodes/json,edges/json,nodes/csv,edges/csv,nodes/parquet,edges/parquet,nodes/orc,edges/orc,nodes/arrow.edges/arrow - For REST-vs-SDK boundary asks, distinguish between named-endpoint REST flows (+
/functions) and ad-hoc SDK GFQL flows (no generic REST query endpoint)./run - For healthcheck asks, label deployment/admin scope and avoid implying every route is public on hosted tenants.
- For constrained prompts, avoid code fences unless explicitly requested.
- For bridge prompts, do not return a standalone JSON block; include endpoint + URL guidance as compact text/bullets.
- For "find files older than 90 days" asks, output concise bullets only (no script), include ,
/api/v2/files/?limit=100, and a client-side age filter.created_at - For "files for a specific user" asks, include , ownership field
/api/v2/files/?limit=100, and a do-not-invent endpoint warning.author - For "list users endpoint" asks, explicitly state no documented REST list-users endpoint and route to admin/IDP/support workflow.
- For named-endpoint architecture asks, keep explanation at public REST surface: use endpoints for named-endpoint definition lifecycle and
/functions/...endpoints for execution./run/... - For single-use gateway and experimental sessions asks, call out deployment/tenant gating when availability is uncertain.
- 代码片段要简短且可直接运行。
- 优先使用确定性的字面端点引用。
- 对于清单类请求,严格遵循要求的项目符号数量。
- 对于会话摘要请求,按要求保持简洁。
- 对于仅需使用环境变量的认证片段,包含明确的行,避免使用带引号的赋值。
export GRAPHISTRY_* - 对于上传/数据集桥接请求,包含字面的行。
/api/v2/upload/datasets/ - 对于示例,始终包含
/api/v2/upload/datasets/(无需自定义元数据时使用metadata)。{} - 对于上传/编码桥接请求,当简洁的项目符号或短代码片段足够时,避免使用大型独立JSON块。
- 对于文件上传生命周期端点序列请求,优先按顺序列出、
/api/v2/files/、/api/v2/upload/files/。/api/v2/upload/datasets/ - 对于节点/边格式模式请求,包含字面令牌:、
nodes/json、edges/json、nodes/csv、edges/csv、nodes/parquet、edges/parquet、nodes/orc、edges/orc、nodes/arrow。edges/arrow - 对于REST与SDK边界请求,区分命名端点REST流程(+
/functions)和临时SDK GFQL流程(无通用REST查询端点)。/run - 对于健康检查请求,标注部署/管理员范围,避免暗示每个路由在托管租户上都是公开的。
- 对于受限制的提示,除非明确要求,否则不要使用代码块。
- 对于桥接提示,不要返回独立的JSON块;以紧凑文本/项目符号形式包含端点和URL指导。
- 对于“查找90天以上的文件”请求,仅输出简洁的项目符号(无脚本),包含、
/api/v2/files/?limit=100以及客户端年龄过滤器。created_at - 对于“特定用户的文件”请求,包含、所有权字段
/api/v2/files/?limit=100以及不要自行创建端点的警告。author - 对于“列出用户端点”请求,明确说明没有文档化的REST列出用户端点,并引导至管理员/IDP/支持流程。
- 对于命名端点架构请求,仅在公开REST层面进行解释:使用端点处理命名端点定义生命周期,使用
/functions/...端点处理执行。/run/... - 对于一次性网关和实验性会话请求,当可用性不确定时,标注部署/租户限制。
Deterministic Prompt Adapters
确定性提示适配
Use these compact patterns when prompts closely match.
当提示与以下模式高度匹配时,使用这些紧凑模式。
Adapter A: env-var auth snippet + bearer follow-up
适配A:环境变量认证片段 + Bearer后续请求
bash
export GRAPHISTRY_HOST=${GRAPHISTRY_HOST:-https://hub.graphistry.com}
export GRAPHISTRY_USERNAME=${GRAPHISTRY_USERNAME:?set GRAPHISTRY_USERNAME}
export GRAPHISTRY_PASSWORD=${GRAPHISTRY_PASSWORD:?set GRAPHISTRY_PASSWORD}
GRAPHISTRY_TOKEN="$(curl -sS -X POST -H 'Content-Type: application/json' -d "{\"username\":\"${GRAPHISTRY_USERNAME}\",\"password\":\"${GRAPHISTRY_PASSWORD}\"}" "${GRAPHISTRY_HOST%/}/api-token-auth/" | jq -r '.token')"
curl -sS -H "Authorization: Bearer ${GRAPHISTRY_TOKEN}" "${GRAPHISTRY_HOST%/}/api/v2/files/"bash
export GRAPHISTRY_HOST=${GRAPHISTRY_HOST:-https://hub.graphistry.com}
export GRAPHISTRY_USERNAME=${GRAPHISTRY_USERNAME:?set GRAPHISTRY_USERNAME}
export GRAPHISTRY_PASSWORD=${GRAPHISTRY_PASSWORD:?set GRAPHISTRY_PASSWORD}
GRAPHISTRY_TOKEN="$(curl -sS -X POST -H 'Content-Type: application/json' -d "{\"username\":\"${GRAPHISTRY_USERNAME}\",\"password\":\"${GRAPHISTRY_PASSWORD}\"}" "${GRAPHISTRY_HOST%/}/api-token-auth/" | jq -r '.token')"
curl -sS -H "Authorization: Bearer ${GRAPHISTRY_TOKEN}" "${GRAPHISTRY_HOST%/}/api/v2/files/"Adapter B: concise upload + URL bridge
适配B:简洁上传 + URL桥接
bash
undefinedbash
undefined/api/v2/upload/datasets/ payload fragment with encodings
/api/v2/upload/datasets/ 负载片段(含编码)
curl -sS -X POST -H "Authorization: Bearer ${GRAPHISTRY_TOKEN}" -H 'Content-Type: application/json'
-d '{"metadata":{},"node_encodings":{"bindings":{"node":"id","node_color":"risk","node_size":"score"}},"edge_encodings":{"bindings":{"source":"src","destination":"dst","edge_color":"etype"}}}'
"${GRAPHISTRY_HOST%/}/api/v2/upload/datasets/"
-d '{"metadata":{},"node_encodings":{"bindings":{"node":"id","node_color":"risk","node_size":"score"}},"edge_encodings":{"bindings":{"source":"src","destination":"dst","edge_color":"etype"}}}'
"${GRAPHISTRY_HOST%/}/api/v2/upload/datasets/"
curl -sS -X POST -H "Authorization: Bearer ${GRAPHISTRY_TOKEN}" -H 'Content-Type: application/json'
-d '{"metadata":{},"node_encodings":{"bindings":{"node":"id","node_color":"risk","node_size":"score"}},"edge_encodings":{"bindings":{"source":"src","destination":"dst","edge_color":"etype"}}}'
"${GRAPHISTRY_HOST%/}/api/v2/upload/datasets/"
-d '{"metadata":{},"node_encodings":{"bindings":{"node":"id","node_color":"risk","node_size":"score"}},"edge_encodings":{"bindings":{"source":"src","destination":"dst","edge_color":"etype"}}}'
"${GRAPHISTRY_HOST%/}/api/v2/upload/datasets/"
first-render URL tweak: append &play=0 (or &linLog=true)
首次渲染URL调整:追加&play=0(或&linLog=true)
undefinedundefinedAdapter C: collections URL parameter guidance (2-4 lines)
适配C:集合URL参数指导(2-4行)
- should be a URL encoded JSON array value. Use the exact phrase
collections.URL encoded - Remove raw whitespace before encoding. Include the literal word .
whitespace - Example: .
collections=%5B%22teamA%22%2C%22fraud%22%5D
- 应为URL编码的JSON数组值,请使用精确表述“URL encoded”。
collections - 编码前移除原始空格,请包含字面单词。
whitespace - 示例:。
collections=%5B%22teamA%22%2C%22fraud%22%5D
Adapter D: sessions summary
适配D:会话摘要
- documents the flow.
https://hub.graphistry.com/docs/api/experimental/rest/sessions/ - Start from .
graph.html?dataset=<dataset_id> - Sessionized URL is .
graph.html?dataset=<dataset_id>&session=<session_id> - Keep auth in ; do not put tokens in URL params.
Authorization: Bearer
- 记录了相关流程。
https://hub.graphistry.com/docs/api/experimental/rest/sessions/ - 从开始。
graph.html?dataset=<dataset_id> - 会话化URL为。
graph.html?dataset=<dataset_id>&session=<session_id> - 认证信息放在中;不要将令牌放在URL参数中。
Authorization: Bearer
Adapter E: safe-share snippet
适配E:安全分享片段
UPLOAD_JSON="$(curl -sS -X POST -H "Authorization: Bearer ${GRAPHISTRY_TOKEN}" -H 'Content-Type: application/json' -d '{"metadata":{},"node_encodings":{"bindings":{"node":"id"}},"edge_encodings":{"bindings":{"source":"src","destination":"dst"}}}' "${GRAPHISTRY_HOST%/}/api/v2/upload/datasets/")"
DATASET_ID="$(jq -r '.dataset_id // .id' <<<"${UPLOAD_JSON}")"
UPLOAD_JSON="$(curl -sS -X POST -H "Authorization: Bearer ${GRAPHISTRY_TOKEN}" -H 'Content-Type: application/json' -d '{"metadata":{},"node_encodings":{"bindings":{"node":"id"}},"edge_encodings":{"bindings":{"source":"src","destination":"dst"}}}' "${GRAPHISTRY_HOST%/}/api/v2/upload/datasets/")"
DATASET_ID="$(jq -r '.dataset_id // .id' <<<"${UPLOAD_JSON}")"
Keep visibility non-public: use private/organization share mode (avoid public links).
保持可见性非公开:使用私有/组织分享模式(避免公开链接)。
echo "${GRAPHISTRY_HOST%/}/graph/graph.html?dataset=${DATASET_ID}"
echo "${GRAPHISTRY_HOST%/}/graph/graph.html?dataset=${DATASET_ID}"
Adapter F: single-use gateway flow
适配F:一次性网关流程
- Admin/staff/superuser generates a one-time URL via (availability may be deployment-specific).
GET /api/v2/generate/single-use-url/?username=<username>&dataset_id=<dataset_id> - Client uses the returned single-use gateway URL once for the target graph/session.
- Revoke access with when needed.
GET /api/v2/logout-user/username/<username>/
- 管理员/员工/超级用户通过生成一次性URL(可用性可能因部署而异)。
GET /api/v2/generate/single-use-url/?username=<username>&dataset_id=<dataset_id> - 客户端使用返回的一次性网关URL访问目标图/会话一次。
- 需要时通过撤销访问权限。
GET /api/v2/logout-user/username/<username>/
Adapter G: org + PersonalKey flow
适配G:组织 + PersonalKey流程
- Create a PersonalKey for the organization user and capture key id/secret.
- Exchange credentials at using
POST /api/v2/auth/pkey/jwt/.Authorization: PersonalKey <id>:<secret> - If required by deployment, include the organization identifier (for example ) in auth context.
org_name - Call protected REST endpoints with .
Authorization: Bearer <jwt>
- 为组织用户创建PersonalKey并记录密钥ID/密钥。
- 使用在
Authorization: PersonalKey <id>:<secret>交换凭证。POST /api/v2/auth/pkey/jwt/ - 如果部署要求,在认证上下文中包含组织标识符(例如)。
org_name - 使用调用受保护的REST端点。
Authorization: Bearer <jwt>
Adapter H: docs fallback policy
适配H:文档回退策略
- Prefer canonical Hub REST docs at .
https://hub.graphistry.com/docs/api/ - If a specific page is missing, use the closest available canonical Hub REST page in the same API/version section.
- Clearly label any inference and avoid fabricating undocumented endpoints or parameters.
- 优先使用上的官方Hub REST文档。
https://hub.graphistry.com/docs/api/ - 如果特定页面缺失,使用同一API/版本部分中最接近的可用官方Hub REST页面。
- 明确标注任何推断内容,避免编造未文档化的端点或参数。
Adapter I: URL params + encodings bridge
适配I:URL参数 + 编码桥接
- POST encodings to using
/api/v2/upload/datasets/andnode_encodings.bindings.edge_encodings.bindings - Keep first render deterministic with one URL knob, for example (or
&play=0).&linLog=true - For , use a URL encoded JSON value and strip whitespace before encoding.
collections
- 使用和
node_encodings.bindings将编码POST到edge_encodings.bindings。/api/v2/upload/datasets/ - 使用一个URL参数确保首次渲染的确定性,例如(或
&play=0)。&linLog=true - 对于,使用URL编码的JSON值,并在编码前去除空格。
collections
Adapter J: experimental sessions workflow
适配J:实验性会话工作流
- is the workflow reference.
https://hub.graphistry.com/docs/api/experimental/rest/sessions/ - Base URL: .
https://hub.graphistry.com/graph/graph.html?dataset=<dataset_id> - Session URL: .
https://hub.graphistry.com/graph/graph.html?dataset=<dataset_id>&session=<session_id> - Workflow: auth/upload/open base URL, then share/continue on the session URL.
- Keep JWT in headers; never use URL token params.
Authorization: Bearer
- 是工作流参考文档。
https://hub.graphistry.com/docs/api/experimental/rest/sessions/ - 基础URL:。
https://hub.graphistry.com/graph/graph.html?dataset=<dataset_id> - 会话URL:。
https://hub.graphistry.com/graph/graph.html?dataset=<dataset_id>&session=<session_id> - 工作流:认证/上传/打开基础URL,然后在会话URL上进行分享/继续操作。
- 将JWT放在头中;切勿使用URL令牌参数。
Authorization: Bearer
Adapter K: sessions minimal form
适配K:会话最简形式
- is the reference path.
/docs/api/experimental/rest/sessions/ - Base URL: .
graph.html?dataset=<dataset_id> - Session URL: .
graph.html?dataset=<dataset_id>&session=<session_id> - Workflow: auth/upload/open base URL, then continue/share via session URL.
- Keep output compact; include base URL and session URL forms.
- 参考路径:。
/docs/api/experimental/rest/sessions/ - 基础URL:。
graph.html?dataset=<dataset_id> - 会话URL:。
graph.html?dataset=<dataset_id>&session=<session_id> - 工作流:认证/上传/打开基础URL,然后通过会话URL继续/分享。
- 保持输出紧凑;包含基础URL和会话URL格式。
Adapter L: admin healthchecks
适配L:管理员健康检查
- Docs route: .
/docs/api/2/rest/health/ - Core checks: ,
/healthcheck/,/ht/./healthz - Service checks: ,
/streamgl-viz/health,/pivot/health./streamgl-sessions/health - GPU service checks: ,
/streamgl-gpu/primary/health(optional/streamgl-gpu/secondary/cpu/healthis heavier)./secondary/gpu/health - Scope note: some checks are deployment/admin routes and may not be exposed on all hosted tenants.
- 文档路径:。
/docs/api/2/rest/health/ - 核心检查:、
/healthcheck/、/ht/。/healthz - 服务检查:、
/streamgl-viz/health、/pivot/health。/streamgl-sessions/health - GPU服务检查:、
/streamgl-gpu/primary/health(可选的/streamgl-gpu/secondary/cpu/health开销较大)。/secondary/gpu/health - 范围说明:部分检查属于部署/管理员路由,可能不会在所有托管租户上暴露。
Adapter M: REST vs Python/GFQL boundary
适配M:REST与Python/GFQL边界
- REST skill is for auth/upload/url/session/health endpoints and URL controls.
graph.html - Named-endpoint REST flows are valid via and
/api/v2/o/<org>/functions/{gfql|python}/..../api/v2/o/<org>/run/{gfql|python}/... - For ad-hoc SDK GFQL tasks (with chain-lists, Cypher strings, or Let/DAG, plus Python dataframe logic), route to
.gfql()/pygraphistry; do not invent generic endpoints likepygraphistry-gfql./api/v2/gfql/query
- REST技能适用于认证/上传/URL/会话/健康端点以及URL控制。
graph.html - 命名端点REST流程可通过和
/api/v2/o/<org>/functions/{gfql|python}/...实现。/api/v2/o/<org>/run/{gfql|python}/... - 对于临时SDK GFQL任务(配合链式列表、Cypher字符串或Let/DAG,以及Python数据框逻辑),请引导至
.gfql()/pygraphistry;不要编造诸如pygraphistry-gfql之类的通用端点。/api/v2/gfql/query
Adapter N: iframe URL API with collections + tricky settings
适配N:带集合和复杂设置的iframe URL API
https://hub.graphistry.com/graph/graph.html?dataset=<dataset_id>&play=0&bg=%23000000&linLog=true&showCollections=true&info=false&pointsOfInterestMax=0&collections=%5B%7B%22name%22%3A%22risk%22%7D%5D&collectionsGlobalNodeColor=00FF00- Keep whitespace-free before URL encoding.
collections - Use /
collectionsGlobalNodeColorfor non-collection fallbacks.collectionsGlobalEdgeColor
https://hub.graphistry.com/graph/graph.html?dataset=<dataset_id>&play=0&bg=%23000000&linLog=true&showCollections=true&info=false&pointsOfInterestMax=0&collections=%5B%7B%22name%22%3A%22risk%22%7D%5D&collectionsGlobalNodeColor=00FF00- 在URL编码前不要包含空格。
collections - 使用/
collectionsGlobalNodeColor作为非集合的回退设置。collectionsGlobalEdgeColor
Adapter O: file upload lifecycle endpoint sequence
适配O:文件上传生命周期端点序列
/api/v2/files//api/v2/upload/files//api/v2/upload/datasets/
/api/v2/files//api/v2/upload/files//api/v2/upload/datasets/
Adapter P: encoding bridge compact form
适配P:编码桥接紧凑形式
- with
/api/v2/upload/datasets/+node_encodings.bindings.edge_encodings.bindings - Example keys: ,
node_color,node_size,edge_color,source.destination - First-render URL tweak: append (or
&play=0).&linLog=true
- 配合
/api/v2/upload/datasets/+node_encodings.bindings。edge_encodings.bindings - 示例键:、
node_color、node_size、edge_color、source。destination - 首次渲染URL调整:追加(或
&play=0)。&linLog=true
Adapter Q: nodes/edges format endpoint patterns
适配Q:节点/边格式端点模式
- ,
nodes/jsonedges/json - ,
nodes/csvedges/csv - ,
nodes/parquetedges/parquet - ,
nodes/orcedges/orc - ,
nodes/arrowedges/arrow - Pair with upload lifecycle references: then
/api/v2/upload/files/./api/v2/upload/datasets/
- 、
nodes/jsonedges/json - 、
nodes/csvedges/csv - 、
nodes/parquetedges/parquet - 、
nodes/orcedges/orc - 、
nodes/arrowedges/arrow - 配合上传生命周期参考:然后
/api/v2/upload/files/。/api/v2/upload/datasets/
Adapter R: GFQL -> REST iframe handoff
适配R:GFQL -> REST iframe 转交
- Python/GFQL layer: run extraction in SDK (/
.gfql(...)) — supports chain-list, Cypher strings, and Let/DAG bindings.gfql_remote(...) - REST layer: use auth/upload/dataset/session endpoints (,
/api-token-auth/)./api/v2/upload/datasets/ - Boundary: no generic REST GFQL query endpoint; do not invent .
/api/v2/gfql/query - Share/render: use (optionally
graph.html?dataset=<dataset_id>), keep JWT out of URL params.&session=<session_id>
- Python/GFQL层:在SDK中运行提取(/
.gfql(...))——支持链式列表、Cypher字符串和Let/DAG绑定。gfql_remote(...) - REST层:使用认证/上传/数据集/会话端点(、
/api-token-auth/)。/api/v2/upload/datasets/ - 边界:没有通用的REST GFQL查询端点;不要编造。
/api/v2/gfql/query - 分享/渲染:使用(可选
graph.html?dataset=<dataset_id>),不要将JWT放在URL参数中。&session=<session_id>
Adapter S: find old files runbook
适配S:查找旧文件手册
- Authenticate () and call
/api-token-auth/with pagination.GET /api/v2/files/?limit=100 - Use from each result row.
created_at - Client-side filter/sort for .
created_at <= now-90d - Export matching ,
file_id,namefor review.created_at - Optional cleanup should be admin-scoped and follow explicit approval.
- 认证()并调用
/api-token-auth/进行分页。GET /api/v2/files/?limit=100 - 使用每个结果行中的字段。
created_at - 在客户端过滤/排序的文件。
created_at <= now-90d - 导出匹配的、
file_id、name以供审核。created_at - 可选的清理操作应属于管理员范围,并遵循明确的审批流程。
Adapter T: files for specific user
适配T:特定用户的文件
- List files via (paginate).
GET /api/v2/files/?limit=100 - Filter by ownership metadata, starting with (and deployment-specific mappings to username if available).
author - If needed, cross-check with for dataset ownership context.
GET /api/v2/datasets/?limit=100 - Do not invent user-list endpoints; use documented APIs and escalate mapping gaps to admin/support.
- 通过列出文件(分页)。
GET /api/v2/files/?limit=100 - 根据所有权元数据过滤,首先使用(以及可用的部署特定用户名映射)。
author - 如果需要,通过交叉检查数据集所有权上下文。
GET /api/v2/datasets/?limit=100 - 不要创建用户列表端点;使用文档化的API,并将映射差距上报给管理员/支持人员。
Adapter U: list users boundary
适配U:列出用户边界
- No documented public REST endpoint to list users in canonical Hub docs.
- Do not claim concrete routes like without a private admin API contract.
GET /api/v2/users/ - Use admin/IDP directory workflow (SSO/IdP export or deployment owner process) for user enumeration.
- Verify against and escalate to support/deployment owner if needed.
https://hub.graphistry.com/docs/api/
- 官方Hub文档中没有公开的REST端点用于列出用户。
- 在没有私有管理员API协议的情况下,不要声称存在之类的具体路由。
GET /api/v2/users/ - 使用管理员/IDP目录工作流(SSO/IdP导出或部署所有者流程)进行用户枚举。
- 根据进行验证,如有需要请上报给支持人员/部署所有者。
https://hub.graphistry.com/docs/api/
Adapter V: privacy via share-link API
适配V:通过分享链接API保障隐私
- Create dataset first via with required
/api/v2/upload/datasets/,metadata, andnode_encodings.edge_encodings - Set visibility with body:
POST /api/v2/share/link/.{"obj_pk":"<dataset_id>","obj_type":"dataset","mode":"private","notify":false,"message":"","invited_users":[]} - If inviting users, include entries like (
{"email":"user@example.com","action":"10"}view,10edit).20 - Deployment/docs caveat: this route is deployment-exposed and may not have a dedicated canonical docs page; verify availability on the target tenant.
- Plan caveat: private/organization requests can be downgraded to when sharing entitlements are unavailable.
public
- 首先通过创建数据集,包含必填的
/api/v2/upload/datasets/、metadata和node_encodings。edge_encodings - 通过请求体设置可见性:
POST /api/v2/share/link/。{"obj_pk":"<dataset_id>","obj_type":"dataset","mode":"private","notify":false,"message":"","invited_users":[]} - 如果邀请用户,包含类似的条目(
{"email":"user@example.com","action":"10"}表示查看,10表示编辑)。20 - 部署/文档说明:该路由是部署暴露的,可能没有专门的官方文档页面;请在目标租户上验证可用性。
- 方案说明:当分享权限不可用时,私有/组织请求可能会降级为。
public
Adapter W: named-endpoint architecture boundary
适配W:命名端点架构边界
- Manage named endpoint definitions via .
/api/v2/o/<org>/functions/{gfql|python}/... - Execute named endpoints via .
/api/v2/o/<org>/run/{gfql|python}/... - Keep guidance on documented external REST routes; avoid internal/backend route details.
- 通过管理命名端点定义。
/api/v2/o/<org>/functions/{gfql|python}/... - 通过执行命名端点。
/api/v2/o/<org>/run/{gfql|python}/... - 仅针对文档化的外部REST路由提供指导;避免内部/后端路由细节。
Minimal Auth Snippet
最小化认证片段
Use Adapter A.
使用适配A。
Auth Troubleshooting Template (4 bullets)
认证故障排查模板(4个项目符号)
- Verify token creation with (or
/api-token-auth/for PersonalKey flow)./api/v2/auth/pkey/jwt/ - Verify refresh behavior via before access-token expiry.
/api-token-refresh/ - Verify token integrity and expiry with and check clock skew.
/api-token-verify/ - Confirm on protected calls and log HTTP status/body.
Authorization: Bearer <token>
- 通过(或PersonalKey流程的
/api-token-auth/)验证令牌创建。/api/v2/auth/pkey/jwt/ - 在访问令牌过期前,通过验证刷新行为。
/api-token-refresh/ - 通过验证令牌完整性和过期时间,并检查时钟偏差。
/api-token-verify/ - 在受保护的调用中确认使用,并记录HTTP状态/响应体。
Authorization: Bearer <token>
Upload + URL Bridge Template
上传 + URL桥接模板
Use Adapter B for snippet form or Adapter I for compact bullet form.
代码片段形式使用适配B,紧凑项目符号形式使用适配I。
URL and Sharing Safety
URL与分享安全
- Safe viewer URL pattern: .
https://hub.graphistry.com/graph/graph.html?dataset=<dataset_id> - Never include JWTs in URL query params (for example, do not add ).
token= - Send tokens only in headers, for example .
Authorization: Bearer <token> - Useful URL knobs: ,
play,linLog,scalingRatio,pointsOfInterestMax,pointSize,showCollections,info,collectionsGlobalNodeColor.collectionsGlobalEdgeColor
- 安全查看器URL格式:。
https://hub.graphistry.com/graph/graph.html?dataset=<dataset_id> - 切勿在URL查询参数中包含JWT(例如,不要添加)。
token= - 仅在头中发送令牌,例如。
Authorization: Bearer <token> - 实用的URL参数:、
play、linLog、scalingRatio、pointsOfInterestMax、pointSize、showCollections、info、collectionsGlobalNodeColor。collectionsGlobalEdgeColor
Collections URL Guidance
集合URL指导
- should be a URL encoded JSON value.
collections - Remove raw whitespace before encoding.
- Example: .
collections=%5B%22teamA%22%2C%22fraud%22%5D
- 应为URL编码的JSON值。
collections - 编码前移除原始空格。
- 示例:。
collections=%5B%22teamA%22%2C%22fraud%22%5D
Sessions (experimental, concise)
会话(实验性,简洁版)
- Docs: .
https://hub.graphistry.com/docs/api/experimental/rest/sessions/ - Start from: .
graph.html?dataset=<dataset_id> - Session appears as: .
graph.html?dataset=<dataset_id>&session=<session_id>
- 文档:。
https://hub.graphistry.com/docs/api/experimental/rest/sessions/ - 起始URL:。
graph.html?dataset=<dataset_id> - 会话URL格式:。
graph.html?dataset=<dataset_id>&session=<session_id>
Policy Guardrails
策略约束
- Use documented endpoints only; avoid invented endpoints like ,
/api/v2/query,/api/v2/graph/query,/api/v2/render./api/v2/graphql - Do not present SDK/GFQL behavior as a generic REST endpoint (for example avoid claims).
/api/v2/gfql/query - Keep named-endpoint guidance at the external REST layer: for definition lifecycle and
/functions/...for execution./run/... - For deployment-exposed routes without dedicated docs pages (for example ), explicitly label the uncertainty and advise tenant verification.
/api/v2/share/link/ - Keep credentials in environment variables; never hardcode literals.
- 仅使用文档化的端点;避免编造诸如、
/api/v2/query、/api/v2/graph/query、/api/v2/render之类的端点。/api/v2/graphql - 不要将SDK/GFQL行为表述为通用REST端点(例如,避免声称存在)。
/api/v2/gfql/query - 命名端点指导仅针对外部REST层面:用于定义生命周期,
/functions/...用于执行。/run/... - 对于没有专门文档页面的部署暴露路由(例如),明确标注不确定性并建议租户验证。
/api/v2/share/link/ - 将凭证保存在环境变量中;切勿硬编码字面量。
Canonical Docs
官方文档
- Auth: https://hub.graphistry.com/docs/api/1/rest/auth/
- Upload: https://hub.graphistry.com/docs/api/2/rest/upload/
- URL controls: https://hub.graphistry.com/docs/api/1/rest/url/
- Sessions: https://hub.graphistry.com/docs/api/experimental/rest/sessions/
- Health: https://hub.graphistry.com/docs/api/2/rest/health/
- SSO + single-use gateway: https://hub.graphistry.com/docs/api/2/rest/sso/
- GFQL UDF endpoints: https://hub.graphistry.com/docs/UDF/gfql-udf-api/
- Python UDF endpoints: https://hub.graphistry.com/docs/UDF/py-udf-api/
- 认证:https://hub.graphistry.com/docs/api/1/rest/auth/
- 上传:https://hub.graphistry.com/docs/api/2/rest/upload/
- URL控制:https://hub.graphistry.com/docs/api/1/rest/url/
- 会话:https://hub.graphistry.com/docs/api/experimental/rest/sessions/
- 健康检查:https://hub.graphistry.com/docs/api/2/rest/health/
- SSO + 一次性网关:https://hub.graphistry.com/docs/api/2/rest/sso/
- GFQL UDF端点:https://hub.graphistry.com/docs/UDF/gfql-udf-api/
- Python UDF端点:https://hub.graphistry.com/docs/UDF/py-udf-api/