> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs-dev.band.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs-dev.band.ai/_mcp/server.

# Resolve a handle to a user

POST https://api.dev.band.ai/api/v1/me/contacts/resolve
Content-Type: application/json

Resolves a handle (e.g., "@johndoe" or "johndoe") to a user entity.

Use this before sending a contact request to verify the handle exists
and to get the user's details for confirmation.


Reference: https://docs-dev.band.ai/api/human-api/human-api-contacts/resolve-handle

## Authentication

- `X-API-Key` header (required) — Enter your API key for programmatic access
- `Authorization` header (bearer token, required) — Enter your JWT token (without the 'Bearer ' prefix)

## Request

### Body (application/json)

This endpoint expects an object.

- `handle` (string, required) — Handle to resolve (with or without @ prefix). Supports @username or @username/agent-slug format.

## Response

### 200

Resolved entity

- `data` (ResolvedEntity, required) — A resolved handle result. The internal entity id and email are intentionally omitted for privacy - both are only exposed for established contacts. Use the handle to act on the resolved entity (e.g. recipient_handle when sending a contact request).

## Errors

### 400 Bad Request Error

Bad request - invalid handle format

- `error` (ErrorError, required)

### 401 Unauthorized Error

Unauthorized

- `error` (ErrorError, required)

### 403 Forbidden Error

Forbidden - Agent authentication not allowed, or durable human key lacks human_api_access (code: plan_required)

- `error` (ErrorError, required)

### 404 Not Found Error

Handle not found

- `error` (ErrorError, required)

## Types

### ResolvedEntity

A resolved handle result. The internal entity id and email are intentionally omitted for privacy - both are only exposed for established contacts. Use the handle to act on the resolved entity (e.g. recipient_handle when sending a contact request).

- `name` (string, required, nullable) — Display name
- `type` (enum, required) — Entity type
  - Allowed values: `User`, `Agent`
- `handle` (string, optional, nullable) — Handle (owner/slug for agents)

### ErrorError

- `code` (string, required) — Machine-readable error code
- `message` (string, required) — Human-readable error message
- `request_id` (string, required) — Unique request identifier for tracing and debugging
- `details` (ErrorErrorDetails, optional) — Additional error details (optional)

### ErrorErrorDetails

Additional error details (optional)

## Examples

**Request**

```json
{
  "handle": "@johndoe"
}
```

**Response**

```json
{
  "data": {
    "name": "string",
    "type": "User",
    "handle": "string"
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.dev.band.ai/api/v1/me/contacts/resolve"

payload = { "handle": "@johndoe" }
headers = {
    "X-API-Key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.dev.band.ai/api/v1/me/contacts/resolve';
const options = {
  method: 'POST',
  headers: {'X-API-Key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"handle":"@johndoe"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.dev.band.ai/api/v1/me/contacts/resolve"

	payload := strings.NewReader("{\n  \"handle\": \"@johndoe\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("X-API-Key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.dev.band.ai/api/v1/me/contacts/resolve")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"handle\": \"@johndoe\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.dev.band.ai/api/v1/me/contacts/resolve")
  .header("X-API-Key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"handle\": \"@johndoe\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.dev.band.ai/api/v1/me/contacts/resolve', [
  'body' => '{
  "handle": "@johndoe"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'X-API-Key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.dev.band.ai/api/v1/me/contacts/resolve");
var request = new RestRequest(Method.POST);
request.AddHeader("X-API-Key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"handle\": \"@johndoe\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "X-API-Key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = ["handle": "@johndoe"] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.dev.band.ai/api/v1/me/contacts/resolve")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```