# Answer an invitation

Source: https://docs.vlayers.ai/reference/conversations/respond-to-invite

`POST /v1/conversations/{id}/invite-response` · scope `calendar:use`

Accepts, declines or says maybe to a meeting invitation that arrived by email. The answer leaves from the mailbox the invitation reached, in the same thread, and follows that mailbox's rules: who it may write to, and any approval step. The invitation is on the message as `invite`.

Requires an API key with the `calendar:use` scope.

| Name | In | Type | Required | Description |
|---|---|---|---|---|
| `id` | path | string | yes | The conversation id. Example: `"0192f5b0-7c3e-7a51-9b2d-4e8f1a6c3d21"` |
| `idempotency-key` | header | string | no | A unique value (a UUID works) that makes a retry safe: sending the same key again returns the first result instead of acting twice. 1–255 printable characters. Example: `"7f3c9a2e-5b1d-4c8e-9f0a-2d6b8e4c1a37"` |
| `messageId` | body | string | yes | The id of the message that shows the invitation. |
| `response` | body | "accept" \| "decline" \| "tentative" | yes | `accept`, `decline`, or `tentative` for maybe. |
| `note` | body | string | no | An optional line to the organizer, sent in the same email. |

## Request

cURL:

```bash
curl -X POST "https://api.vlayers.ai/v1/conversations/$CONVERSATION_ID/invite-response" \
  -H "Authorization: Bearer $VOICELAYER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "messageId": "0192f5b0-8d1f-7b62-8c3e-5f9a2b7d4e32",
    "response": "accept"
  }'
```

TypeScript:

```ts
import { VoiceLayer } from '@voicelayer/api';

const voicelayer = new VoiceLayer();

const { summary } = await voicelayer.conversations.respondInvite('<conversation-id>', {
  messageId: '0192f5b0-8d1f-7b62-8c3e-5f9a2b7d4e32',
  response: 'accept'
});
console.log(summary);
```

Python:

```python
from voicelayer import VoiceLayer

vl = VoiceLayer()

result = vl.conversations.respond_invite(
    "<conversation-id>",
    message_id="0192f5b0-8d1f-7b62-8c3e-5f9a2b7d4e32",
    response="accept",
)
print(result.summary)
```

## Response `202`

```json
{
  "message": {
    "id": "0192f5b0-8d1f-7b62-8c3e-5f9a2b7d4e32",
    "conversationId": "0192f5b0-7c3e-7a51-9b2d-4e8f1a6c3d21",
    "channel": "sms",
    "direction": "outbound",
    "status": "queued",
    "text": "Accepted: Demo call",
    "media": [],
    "from": "+14155550100",
    "to": "+15550123",
    "bindingId": null,
    "metadata": {},
    "error": null,
    "untrusted": false,
    "createdAt": "2026-10-20T15:04:05.000Z",
    "parts": [
      {
        "id": "0192f5b0-8d1f-7b62-8c3e-5f9a2b7d4e32",
        "status": "queued"
      }
    ]
  },
  "summary": "Accepted \"Demo call\": your answer is on its way to ada@example.org."
}
```
