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

# Accept an invitation

POST https://api.getdial.ai/api/v1/members/invites/{token}/accept
Content-Type: application/json

Completes an invitation and returns the new member's API key. Requires a verification code issued by Create an account for the *invited* address — a code issued for any other address is rejected. Unauthenticated: the token plus the emailed code are the credentials. No new account is created and no phone number is provisioned; the caller joins the inviting account.

Reference: https://docs.getdial.ai/api-reference/rest-api/members/accept-member-invite

## Request

### Path parameters

- `token` (string, required)

### Body (application/json)

- `verificationId` (string, required) — The `verificationId` returned by Create an account for the invited address.
- `code` (string, required) — The 6-digit code emailed to the invited address.

## Response

### 200

The invitation was accepted. The API key is shown once — store it.

- `accountId` (string, required) — The account the caller has joined.
- `apiKey` (string, required) — The member's own API key. Shown once.
- `member` (object, required)
  - `id` (string, required, nullable) — The membership id, used to remove the member. Always `null` for the owner, who is the account's own email address and cannot be removed.
  - `email` (string, required)
  - `role` (enum, required)
    - Allowed values: `owner`, `member`
  - `status` (enum, required) — `pending` until the invitation is accepted. A pending member has no API key and no access. The owner is always `active`.
    - Allowed values: `pending`, `active`
  - `invitedByEmail` (string, optional, nullable) — Who sent the invitation. Null for the owner.
  - `invitedAt` (datetime, optional, nullable)
  - `acceptedAt` (datetime, optional, nullable) — When the invitation was accepted, or null while pending.
  - `lastActiveAt` (datetime, optional, nullable) — When this member's API key was last used, or null if never used.

## Examples

**Request**

```json
{
  "verificationId": "verif_9f8b7c6d5e4a3b2c1d0e",
  "code": "482915"
}
```

**Response**

```json
{
  "accountId": "acct_1234567890abcdef",
  "apiKey": "sk_live_4f3e2d1c0b9a8e7d6c5b",
  "member": {
    "id": "mem_abcdef1234567890",
    "email": "jane.doe@example.com",
    "role": "member",
    "status": "active",
    "invitedByEmail": "owner@example.com",
    "invitedAt": "2024-01-15T09:30:00Z",
    "acceptedAt": "2024-01-15T09:45:00Z",
    "lastActiveAt": "2024-04-20T14:22:10Z"
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.getdial.ai/api/v1/members/invites/token/accept"

payload = {
    "verificationId": "verif_9f8b7c6d5e4a3b2c1d0e",
    "code": "482915"
}
headers = {"Content-Type": "application/json"}

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

print(response.json())
```

```javascript
const url = 'https://api.getdial.ai/api/v1/members/invites/token/accept';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: '{"verificationId":"verif_9f8b7c6d5e4a3b2c1d0e","code":"482915"}'
};

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.getdial.ai/api/v1/members/invites/token/accept"

	payload := strings.NewReader("{\n  \"verificationId\": \"verif_9f8b7c6d5e4a3b2c1d0e\",\n  \"code\": \"482915\"\n}")

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

	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.getdial.ai/api/v1/members/invites/token/accept")

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

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n  \"verificationId\": \"verif_9f8b7c6d5e4a3b2c1d0e\",\n  \"code\": \"482915\"\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.getdial.ai/api/v1/members/invites/token/accept")
  .header("Content-Type", "application/json")
  .body("{\n  \"verificationId\": \"verif_9f8b7c6d5e4a3b2c1d0e\",\n  \"code\": \"482915\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.getdial.ai/api/v1/members/invites/token/accept', [
  'body' => '{
  "verificationId": "verif_9f8b7c6d5e4a3b2c1d0e",
  "code": "482915"
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.getdial.ai/api/v1/members/invites/token/accept");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"verificationId\": \"verif_9f8b7c6d5e4a3b2c1d0e\",\n  \"code\": \"482915\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = [
  "verificationId": "verif_9f8b7c6d5e4a3b2c1d0e",
  "code": "482915"
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.getdial.ai/api/v1/members/invites/token/accept")! 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()
```