# /User-Profile

## Overview

The `/user-profile` endpoint returns the latest profile event for the given public key.

## Endpoint Details

* **URL**: `/user-profile`
* **Method**: GET
* **Auth Required**: No
* **Permissions Required**: None

## Request Parameters

| Parameter | Description                                           | Required |
| --------- | ----------------------------------------------------- | -------- |
| `pubkey`  | The public key of the user whose profile is requested | Yes      |

## Response Schema

The response is a JSON object with the following structure:

```json
{
  "profile": {
    "id": "profile_event_id",
    "pubkey": "user_pubkey",
    "created_at": 1234567890,
    "kind": 0,
    "tags": [],
    "content": "Profile content in JSON format",
    "sig": "event_signature"
  }
}
```

* `profile`: The most recent profile metadata event (kind 0) for the requested user.

## Example Call

```bash
curl -X GET "https://huddlers-ovduv.ondigitalocean.app/user-profile?pubkey=82341f882b6eabcd2ba7f1ef90aad961cf074af15b9ef44a09f9d2a8fbfbe6a2"
```

## Error Responses

* **400 Bad Request**: If the pubkey parameter is missing or invalid.
* **404 Not Found**: If no profile can be found for the given pubkey.
* **500 Internal Server Error**: If there's an issue processing the request.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.huddlers.dev/user-profile.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
