# IsDelegate REST API

A simple public API for checking if a wallet has valid IsDelegate attestations.

## When to Use

Use this API for:

* Quick authorization checks with minimal code
* Simple bot detection
* Verifying agent status without cryptographic validation

**Important:** This API requires trusting Zipwire's validation. For maximum security and cryptographic verification, use the [ProofPack library](https://docs.zipwire.io/tools-and-integrations/proofpack-agent-delegation) instead.

## Endpoint

```
GET https://zipwire.io/api/v1/is-delegate/{walletAddress}
```

## Request

| Parameter       | Type   | Description                           |
| --------------- | ------ | ------------------------------------- |
| `walletAddress` | string | Ethereum wallet address (0x-prefixed) |

## Response (Success)

```json
{
  "success": true,
  "message": "IsDelegate attestation verified successfully",
  "walletAddress": "0x775d3B494d98f123BecA7b186D7F472026EdCeA2",
  "attestations": [
    {
      "attestationUid": "0x7e08febe71e51acbdcb1d2c6175fb36958594074bed0f1e85b12adc6274eb8b2",
      "attestationExplorerUrl": "https://base.easscan.org/attestation/0x7e08febe71e51acbdcb1d2c6175fb36958594074bed0f1e85b12adc6274eb8b2",
      "valid": true,
      "pointsToHuman": true
    }
  ]
}
```

## Response (No Attestations)

```json
{
  "success": false,
  "message": "No delegation attestations found for wallet",
  "code": "NoAttestationsFound",
  "walletAddress": null,
  "attestations": null
}
```

## Example Usage

**JavaScript:**

```javascript
const response = await fetch('https://zipwire.io/api/v1/is-delegate/0x775d3B494d98f123BecA7b186D7F472026EdCeA2');
const result = await response.json();

if (result.success) {
  console.log('Agent is authorized by a human');
} else {
  console.log('Agent is not authorized');
}
```

**cURL:**

```bash
curl https://zipwire.io/api/v1/is-delegate/0x775d3B494d98f123BecA7b186D7F472026EdCeA2
```

## Notes

* No authentication required (public endpoint)
* Always returns HTTP 200 OK
* Validation includes revocation and expiration checks
* Walks the full delegation chain back to Zipwire's trusted root

## For Maximum Security

For cryptographic verification that doesn't require trusting Zipwire's API, use the [ProofPack library](https://docs.zipwire.io/tools-and-integrations/proofpack-agent-delegation) instead. ProofPack allows you to verify attestations independently on-chain.

***

**Related:**

* [ProofPack Developer Guide](https://docs.zipwire.io/tools-and-integrations/proofpack-agent-delegation)
* [IsDelegate Attestations](https://docs.zipwire.io/fundamentals/security/attestations/isdelegate-agent-delegation)
