# Partner Detail

### Request

Retrieve detailed metadata about a specific partner's participation in the network. This endpoint provides insights into the partner’s current operational status, including the number of active nodes, connection duration, amount of data shared, and total earnings. It is typically used to monitor partner engagement and performance across the network.

### Endpoint

```
GET /api/v1/partner/detail
```

### URL:

```
https://stats.api.datagram.network/api/v1/partner/detail
```

### Query Parameters

| Parameters            | Type   | Required | Description                              | Example                |
| --------------------- | ------ | -------- | ---------------------------------------- | ---------------------- |
| **secret**            | string | ✅ Yes    | Unique secret token identifying partner. | `"pt_sec_abc123XYZ!*"` |
| **partner\_node\_id** | string | ✅ Yes    | External ID of the partner node.         | `"partner_12345"`      |

### Authentication

Add the organization token in the `Authorization` header:

* Example: `Authorization: <token, optional>`.

**Example Request**

```
GET /api/v1/partner/detail?secret=<partner-secret>&partner_node_id=dg-node-1 HTTP/1.1
Host: stats.api.datagram.network
Authorization: <organization token>
```

### Responses

{% tabs %}
{% tab title="200" %}
The request was successful. The server returns a structured JSON object containing metadata about the partner’s current status in the network.

| Field                  | Type    | Description                                       | Example           |
| ---------------------- | ------- | ------------------------------------------------- | ----------------- |
| **connection\_status** | string  | Connection status ("connected" or "disconnected") | `"connected"`     |
| total\_uptime          | integer | Total uptime in Unix timestamp (ms).              | `99999`           |
| partner\_node\_id      | string  | Identifier of the external partner node.          | "`partner_12345"` |

**Example:**

```
{
  "data": {
    "connection_status": "connected",
    "total_uptime": 99999,
    "partner_node_id": "partner_12345"
  }
}
```

{% endtab %}

{% tab title="400" %}
Returns if the parameters are malformed or missing, or the time range exceeds the maximum allowed.

**Response Body**

| Field     | Type    | Description               | Example              |
| --------- | ------- | ------------------------- | -------------------- |
| `message` | string  | Description of the issue. | `INVALID_PARAMETERS` |
| `status`  | integer | HTTP status code.         | `400` (Bad Request)  |

**Example Response**

```
{
  "error": {
    "message": "INVALID_PARAMETERS",
    "status": 400
  }
}
```

{% endtab %}

{% tab title="401" %}
Returned when the authorization token is missing or invalid.

**Response Body**

| Field     | Types   | Description                      | Example              |
| --------- | ------- | -------------------------------- | -------------------- |
| `message` | string  | Explanation of the auth failure. | `"UNAUTHORIZED"`     |
| `status`  | integer | HTTP status code.                | `401` (Unauthorized) |

**Example Response**

```
{
  "error": {
    "message": "UNAUTHORIZED",
    "status": 401
  }
}
```

{% endtab %}
{% endtabs %}
