> This page is for Agent Handler.

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

# Agent signup

POST https://ah-api.merge.dev/api/v1/agent/signup/

Creates an organization with no users, an access key for the agent, a claim link, a default tool pack and an `Agent` registered user, so the agent can call tools right away. Show the claim link to a human whenever you want them to take ownership; the key keeps working before and after they do. Rate limited per IP.

Reference: https://docs.merge.dev/merge-agent-handler/agent-handler/agent/agent-signup

## Response

### 201

- `claim_url` (string, required) — Link a human opens to take ownership of the organization.
- `claim_expires_at` (datetime, required) — After this the link stops working; call `POST /agent/claim/` for a new one.
- `api_key` (string, required) — Raw access key with `runtime:all` and `management:all`. Returned only here.
- `organization` (AgentSignupOrganization, required)
- `tool_pack_id` (string, required) — Default tool pack with a curated starter set of connectors; use it as `{tool_pack_id}` in the MCP URL.
- `registered_user_id` (string, required) — Production registered user named `Agent`; use it as `{registered_user_id}` in the MCP URL.
- `next_step` (string, required) — One-line instruction for what to run next, with a link to the agent quickstart guide.

## Types

### AgentSignupOrganization

- `id` (string, required)
- `name` (string, required) — Generated name; rename it after claiming.

## Examples

**Response**

```json
{
  "claim_url": "https://ah.merge.dev/claim/<token>",
  "claim_expires_at": "2026-09-01T12:00:00Z",
  "api_key": "<54-character key>",
  "organization": {
    "id": "3c90c3c0-6d46-4b50-8888-8dd25736052f",
    "name": "agent-amber-cedar-otter-7f3k"
  },
  "tool_pack_id": "9b2a5c1e-4f3d-4a6b-9c8d-1e2f3a4b5c6d",
  "registered_user_id": "0f1e2d3c-4b5a-4968-8776-655443322110",
  "next_step": "Run: merge search-tools \"<intent>\". Guide: https://docs.merge.dev/merge-agent-handler/setup/agent-quickstart"
}
```

**SDK Code**

```python Signed up
import requests

url = "https://ah-api.merge.dev/api/v1/agent/signup/"

response = requests.post(url)

print(response.json())
```

```javascript Signed up
const url = 'https://ah-api.merge.dev/api/v1/agent/signup/';
const options = {method: 'POST'};

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

```go Signed up
package main

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

func main() {

	url := "https://ah-api.merge.dev/api/v1/agent/signup/"

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

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

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

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

}
```

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

url = URI("https://ah-api.merge.dev/api/v1/agent/signup/")

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

request = Net::HTTP::Post.new(url)

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

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

HttpResponse<String> response = Unirest.post("https://ah-api.merge.dev/api/v1/agent/signup/")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://ah-api.merge.dev/api/v1/agent/signup/');

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

```csharp Signed up
using RestSharp;

var client = new RestClient("https://ah-api.merge.dev/api/v1/agent/signup/");
var request = new RestRequest(Method.POST);
IRestResponse response = client.Execute(request);
```

```swift Signed up
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "https://ah-api.merge.dev/api/v1/agent/signup/")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"

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()
```