> ## Documentation Index
> Fetch the complete documentation index at: https://docs.credprotocol.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Feedback JSON

> Retrieve the off-chain feedback JSON document for a submission

## Overview

Serves the [ERC-8004](https://eips.ethereum.org/EIPS/eip-8004) off-chain feedback JSON document for a completed reputation submission. This URL is stored on-chain as the `endpoint` parameter in `giveFeedback`, allowing anyone to verify the full feedback details.

<Info>
  This is a **public endpoint** — no authentication required. Responses are cached for 24 hours.
</Info>

## Path Parameters

<ParamField path="agent_id" type="integer" required>
  ERC-8004 agent ID. Must be >= 1.
</ParamField>

<ParamField path="submission_id" type="string" required>
  Submission UUID
</ParamField>

## Response

Returns the raw ERC-8004 feedback JSON document.

<ResponseField name="agentRegistry" type="string">
  CAIP-2 Identity Registry address
</ResponseField>

<ResponseField name="agentId" type="integer">
  Agent ID in the Identity Registry
</ResponseField>

<ResponseField name="clientAddress" type="string">
  CAIP-2 address of the feedback submitter (Cred Protocol's wallet)
</ResponseField>

<ResponseField name="createdAt" type="string">
  ISO 8601 timestamp of when the feedback was created
</ResponseField>

<ResponseField name="value" type="integer">
  Feedback value (e.g., credit score)
</ResponseField>

<ResponseField name="valueDecimals" type="integer">
  Decimal places for the value
</ResponseField>

<ResponseField name="tag1" type="string">
  Feedback metric type (e.g., `creditScore`)
</ResponseField>

<ResponseField name="tag2" type="string">
  Provider identifier (`credprotocol`)
</ResponseField>

<ResponseField name="endpoint" type="string">
  URL to this feedback JSON endpoint
</ResponseField>

<ResponseField name="context" type="object">
  Cred-specific scoring context and details
</ResponseField>

## Response Headers

| Header            | Description                                                            |
| ----------------- | ---------------------------------------------------------------------- |
| `X-Feedback-Hash` | KECCAK-256 hash of the feedback JSON (matches on-chain `feedbackHash`) |
| `X-Feedback-URI`  | IPFS URI of the feedback document                                      |
| `Cache-Control`   | `public, max-age=86400` (24 hour cache)                                |

<RequestExample>
  ```bash cURL theme={null}
  curl -X GET "https://api.credprotocol.com/api/v2/agents/18/reputation/feedback/550e8400-e29b-41d4-a716-446655440000"
  ```

  ```javascript JavaScript theme={null}
  const agentId = 18;
  const submissionId = '550e8400-e29b-41d4-a716-446655440000';

  const response = await fetch(
    `https://api.credprotocol.com/api/v2/agents/${agentId}/reputation/feedback/${submissionId}`
  );

  const feedback = await response.json();
  console.log(`Score: ${feedback.value} (${feedback.tag1})`);
  console.log(`Hash: ${response.headers.get('X-Feedback-Hash')}`);
  ```

  ```python Python theme={null}
  import requests

  agent_id = 18
  submission_id = '550e8400-e29b-41d4-a716-446655440000'

  response = requests.get(
      f'https://api.credprotocol.com/api/v2/agents/{agent_id}/reputation/feedback/{submission_id}'
  )

  feedback = response.json()
  print(f"Score: {feedback['value']} ({feedback['tag1']})")
  print(f"Hash: {response.headers.get('X-Feedback-Hash')}")
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "agentRegistry": "eip155:8453:0x8004A169FB4a3325136EB29fA0ceB6D2e539a432",
    "agentId": 18,
    "clientAddress": "eip155:8453:0x1234567890abcdef1234567890abcdef12345678",
    "createdAt": "2026-02-27T15:30:00Z",
    "value": 782,
    "valueDecimals": 0,
    "tag1": "creditScore",
    "tag2": "credprotocol",
    "endpoint": "https://api.credprotocol.com/api/v2/agents/18/reputation/feedback/550e8400-e29b-41d4-a716-446655440000",
    "context": {
      "model_version": "andromeda_1.0",
      "address_scored": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
      "score_range": "good"
    }
  }
  ```

  ```json 404 theme={null}
  {
    "detail": "Feedback not found"
  }
  ```
</ResponseExample>
