> 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

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: rest
  version: 1.0.0
paths:
  /api/v1/members/invites/{token}/accept:
    post:
      operationId: accept-member-invite
      summary: Accept an invitation
      description: >-
        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.
      tags:
        - members
      parameters:
        - name: token
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: The invitation was accepted. The API key is shown once — store it.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Members_acceptMemberInvite_Response_200'
        '400':
          description: The request body failed validation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: >-
            The verification code is invalid, expired, already used, or was
            issued for a different address.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: The token is unknown, already accepted, or expired.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AcceptMemberInviteRequest'
servers:
  - url: https://api.getdial.ai
    description: Dial REST API
components:
  schemas:
    AcceptMemberInviteRequest:
      type: object
      properties:
        verificationId:
          type: string
          description: >-
            The `verificationId` returned by Create an account for the invited
            address.
        code:
          type: string
          description: The 6-digit code emailed to the invited address.
      required:
        - verificationId
        - code
      title: AcceptMemberInviteRequest
    AccountMemberRole:
      type: string
      enum:
        - owner
        - member
      title: AccountMemberRole
    AccountMemberStatus:
      type: string
      enum:
        - pending
        - active
      description: >-
        `pending` until the invitation is accepted. A pending member has no API
        key and no access. The owner is always `active`.
      title: AccountMemberStatus
    AccountMember:
      type: object
      properties:
        id:
          type:
            - string
            - 'null'
          description: >-
            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:
          type: string
          format: email
        role:
          $ref: '#/components/schemas/AccountMemberRole'
        status:
          $ref: '#/components/schemas/AccountMemberStatus'
          description: >-
            `pending` until the invitation is accepted. A pending member has no
            API key and no access. The owner is always `active`.
        invitedByEmail:
          type:
            - string
            - 'null'
          format: email
          description: Who sent the invitation. Null for the owner.
        invitedAt:
          type:
            - string
            - 'null'
          format: date-time
        acceptedAt:
          type:
            - string
            - 'null'
          format: date-time
          description: When the invitation was accepted, or null while pending.
        lastActiveAt:
          type:
            - string
            - 'null'
          format: date-time
          description: When this member's API key was last used, or null if never used.
      required:
        - id
        - email
        - role
        - status
      title: AccountMember
    Members_acceptMemberInvite_Response_200:
      type: object
      properties:
        accountId:
          type: string
          description: The account the caller has joined.
        apiKey:
          type: string
          description: The member's own API key. Shown once.
        member:
          $ref: '#/components/schemas/AccountMember'
      required:
        - accountId
        - apiKey
        - member
      title: Members_acceptMemberInvite_Response_200
    ErrorError:
      oneOf:
        - type: string
        - type: object
          additionalProperties:
            description: Any type
      description: An error message, or a validation-error object for 400 responses.
      title: ErrorError
    Error:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/ErrorError'
          description: An error message, or a validation-error object for 400 responses.
      title: Error

```

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