Bluesky アイデンティティの PLC 履歴
GET/tools/plc-history
PLC ディレクトリにある did:plc アイデンティティの操作ログをタイムラインとして返します:作成、ハンドルの変更、別サーバー(PDS)への移行、署名鍵とローテーション鍵の変更、無効化された操作、tombstone。ハンドルも受け付けます。操作は 1 ページ分を新しい順に返し、元の操作は求められたときだけ含めます。2 回分の呼び出しとして数えます。
パラメーター
| 名前 | 場所 | 型 | 説明 |
|---|---|---|---|
| q (必須) | query | string | did:plc、ハンドル、または bsky.app のプロフィールリンク。 |
| limit | query | integer (1–100), default 50 | 1 ページあたりの操作数(新しい順):1〜100、既定は 50。 |
| page | query | integer (1–), default 1 | 操作のページ(1 から)。 |
| include_raw | query | boolean, default false | PLC ディレクトリが公開したままの各操作(`operation`)を含める。 |
レスポンス
| ステータス | 説明 | 本文 |
|---|---|---|
| 200 | ツールの回答と、そのページの正規 URL。 | ToolPlcHistory |
| 400 | 無効なクエリパラメーター(コード `bad_request`)。 | Error |
| 401 | 不明、期限切れ、または取り消されたトークンです(コード `unauthorized`)。`Authorization` ヘッダーがなければ、ツールは匿名で応答します。 | Error |
| 404 | 見つかりません。ボットのハンドルのサブドメインでも返されます。API はメインサイトでのみ提供されます。 | Error |
| 429 | レート制限に達しました:IP ごとに `toolsApi`(1 分あたり 60)と `toolsApiDaily`(1 日あたり 2,000)、作成者のトークンがあればアカウントごとにどちらも 10 倍です。複数のリクエストを送るツールは 1 回より多く数えられます。 | Error |
| 500 | 予期しないエラー。 | Error |
| 502 | ツールが問い合わせたサービスが応答しませんでした(コード `upstream_error`)。 | Error |
例
curl \
-G \
--data-urlencode "q=did:plc:z72i7hdynmk6r22z27h6tvur" \
-H "Authorization: Bearer $BLUESKY_BOT_TOKEN" \
https://bluesky.bot/api/v1/tools/plc-historyスキーマ
Error
| フィールド | 型 | 説明 |
|---|---|---|
| error (必須) | object | |
| error.code (必須) | string: "bad_request", "invalid_handle", "not_found", "rate_limited", "internal_error", "unauthorized", "forbidden", "conflict", "invalid_grant", "upstream_error", "insufficient_scope", "invalid_listing", "consent_required" | |
| error.message (必須) | string | |
| error.reason | string | `invalid_handle`、`invalid_listing`、`conflict`、`forbidden` の場合。例:`reserved`、`taken`、`too_long`、`no_handle`、`suspended`。 |
| error.url | string, uri | consent_required の場合、このダッシュボードページを開いてプロフィールの編集を許可してください。 |
| error.field | string | `invalid_listing` の場合:拒否されたフィールド。 |
| error.scope | string | `insufficient_scope` の場合:トークンに足りないスコープ。 |
| error.parameter | string | 無効なクエリパラメーター。 |
| error.retryAfterSeconds | integer (1–) | `rate_limited` の場合。 |
ToolPlcHistory
| フィールド | 型 | 説明 |
|---|---|---|
| tool (必須) | string = "plc-history" | ツールのスラッグ。 |
| url (必須) | string | Bluesky.bot 上のツールのページの正規 URL。 |
| result (必須) | object | ツールの回答。 |
| result.did (必須) | string | この履歴の DID。 |
| result.kind (必須) | string: "history", "too_long", "not_plc" | `history`。ログが 1 MB を超える場合は `too_long`。公開ログのない did:web などのメソッドでは `not_plc`。 |
| result.summary (必須) | object | null | アイデンティティの概要。`kind` が `history` でなければ null。 |
| result.truncated (必須) | boolean | 操作が 1,000 件を超えています。最新の 1,000 件だけを返します。 |
| result.operations (必須) | object[] | 操作の 1 ページ分(新しい順)。 |
| result.operations[].cid (必須) | string | 操作の CID。 |
| result.operations[].createdAt (必須) | string | PLC ディレクトリが受け取った日時。 |
| result.operations[].type (必須) | string: "plc_operation", "create", "plc_tombstone" | `plc_operation`、旧形式の `create`、または `plc_tombstone`。 |
| result.operations[].nullified (必須) | boolean | その後、優先度の高いローテーション鍵で(72 時間以内に)置き換えられた操作。ディレクトリには残ります。 |
| result.operations[].events (必須) | object[] | 一つ前の有効な操作からの変更点。 |
| result.operations[].events[].kind (必須) | string: "created", "handle", "pds", "signing_key", "rotation_keys", "services", "other", "tombstone", "no_change" | `created`、`handle`、`pds`(別サーバーへの移行)、`signing_key`、`rotation_keys`、`services`(その他のサービス)、`other`(その他のエイリアスまたは検証方法)、`tombstone`、`no_change` のいずれか。 |
| result.operations[].events[].from (必須) | string | null | 変更前:ハンドル、PDS のエンドポイント、または署名鍵。ない場合や該当しない場合は null。 |
| result.operations[].events[].to (必須) | string | null | 変更後:ハンドル、PDS のエンドポイント、または署名鍵。ない場合や該当しない場合は null。 |
| result.operations[].events[].added (必須) | string[] | 追加されたローテーション鍵。 |
| result.operations[].events[].removed (必須) | string[] | 削除されたローテーション鍵。 |
| result.operations[].operation | object | PLC ディレクトリが公開したままの操作。`include_raw` のときだけ。 |
| result.page (必須) | integer | 返した操作のページ。 |
| result.pages (必須) | integer | この `limit` での操作のページ数。 |
| result.notes (必須) | object[] | 確認すべき点:ローテーション鍵とサーバーが 24 時間以内に変わった場合は `keys_and_server`(移行、または乗っ取り)。 |
| result.notes[].kind (必須) | string: "keys_and_server" | メモの種類。 |
| result.notes[].at (必須) | string | サーバーが変わった日時。 |