# dev.keytrace.reverseLookup

> Published by [keytrace.dev](https://lexicon.garden/identity/did:plc:hcwfdlmprcc335oixyfsw7u3)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:hcwfdlmprcc335oixyfsw7u3/dev.keytrace.reverseLookup)
- [Documentation](https://lexicon.garden/lexicon/did:plc:hcwfdlmprcc335oixyfsw7u3/dev.keytrace.reverseLookup/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:hcwfdlmprcc335oixyfsw7u3/dev.keytrace.reverseLookup/examples)

## Definitions

### `dev.keytrace.reverseLookup`

**Type**: `query`

Find the ATProto DIDs (and the at-uris of their keytrace claim records) that have verifiably claimed a given external identity, keyed by claim type and subject. Matching is exact (case-sensitive) on the subject. Only non-retracted claims whose attestation signatures validate against a known keytrace server key are returned.

#### Parameters

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `type` | `string` | Yes | The claim type (e.g. 'github', 'dns', 'npm'). Mirrors dev.keytrace.claim#type; keep in sync when adding a new provider. |
| `subject` | `string` | Yes | The subject identifier being looked up. Matched exactly (case-sensitive). For types whose subject is a shared namespace rather than a personal account (e.g. 'npmorg', where the subject is the scope 'babel'), a single subject may legitimately match several DIDs — one per person who proved publish access. |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `total` | `integer` | Yes | Total number of matching claims. |
| `matches` | `array` | Yes |  |

#### Errors

- **UnknownType**: The requested claim type is not supported by this server.

### `dev.keytrace.reverseLookup#match`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `did` | `string` (did) | Yes | The DID of the ATProto account that made the claim. |
| `claim` | `string` (at-uri) | Yes | The at-uri of the dev.keytrace.claim record backing this match. |
| `verifiedAt` | `string` (datetime) | Yes | Timestamp the claim was most recently verified (lastVerifiedAt if present, otherwise createdAt). |
| `recheckSuggested` | `boolean` | No | Present (and true) only when the most recent re-verification attempt hit a transient failure (e.g. key-fetch network error). The match is still based on a prior successful verification, but callers who need strong freshness guarantees may wish to re-verify the claim themselves. Absent when the most recent check succeeded. |

## Raw Schema

```json
{
  "id": "dev.keytrace.reverseLookup",
  "defs": {
    "main": {
      "type": "query",
      "errors": [
        {
          "name": "UnknownType",
          "description": "The requested claim type is not supported by this server."
        }
      ],
      "output": {
        "schema": {
          "type": "object",
          "required": [
            "total",
            "matches"
          ],
          "properties": {
            "total": {
              "type": "integer",
              "minimum": 0,
              "description": "Total number of matching claims."
            },
            "matches": {
              "type": "array",
              "items": {
                "ref": "#match",
                "type": "ref"
              }
            }
          }
        },
        "encoding": "application/json"
      },
      "parameters": {
        "type": "params",
        "required": [
          "type",
          "subject"
        ],
        "properties": {
          "type": {
            "type": "string",
            "description": "The claim type (e.g. 'github', 'dns', 'npm'). Mirrors dev.keytrace.claim#type; keep in sync when adding a new provider.",
            "knownValues": [
              "github",
              "dns",
              "activitypub",
              "bsky",
              "npm",
              "npmorg",
              "tangled",
              "pgp",
              "twitter",
              "linkedin",
              "instagram",
              "reddit",
              "hackernews",
              "orcid",
              "itchio",
              "discord",
              "steam"
            ]
          },
          "subject": {
            "type": "string",
            "description": "The subject identifier being looked up. Matched exactly (case-sensitive). For types whose subject is a shared namespace rather than a personal account (e.g. 'npmorg', where the subject is the scope 'babel'), a single subject may legitimately match several DIDs — one per person who proved publish access."
          }
        }
      },
      "description": "Find the ATProto DIDs (and the at-uris of their keytrace claim records) that have verifiably claimed a given external identity, keyed by claim type and subject. Matching is exact (case-sensitive) on the subject. Only non-retracted claims whose attestation signatures validate against a known keytrace server key are returned."
    },
    "match": {
      "type": "object",
      "required": [
        "did",
        "claim",
        "verifiedAt"
      ],
      "properties": {
        "did": {
          "type": "string",
          "format": "did",
          "description": "The DID of the ATProto account that made the claim."
        },
        "claim": {
          "type": "string",
          "format": "at-uri",
          "description": "The at-uri of the dev.keytrace.claim record backing this match."
        },
        "verifiedAt": {
          "type": "string",
          "format": "datetime",
          "description": "Timestamp the claim was most recently verified (lastVerifiedAt if present, otherwise createdAt)."
        },
        "recheckSuggested": {
          "type": "boolean",
          "description": "Present (and true) only when the most recent re-verification attempt hit a transient failure (e.g. key-fetch network error). The match is still based on a prior successful verification, but callers who need strong freshness guarantees may wish to re-verify the claim themselves. Absent when the most recent check succeeded."
        }
      }
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
