---
title: "Accept a pending workspace invitation"
description: "PubNio API me.invites.accept: accept a pending workspace invitation. Request fields, examples in five clients, errors, and idempotency."
---

> Documentation Index
> Fetch the complete documentation index at: https://pubnio.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Accept a pending workspace invitation

Accept a pending workspace invitation with [`POST /api/v1/me/invites/accept`](https://pubnio.com/api/v1/docs#tag/me/POST/api/v1/me/invites/accept). Requires a signed-in user, in the web app or the CLI; API keys are not accepted and MCP cannot call it. The invitation must match your verified email.

## Request

The body takes one of 2 shapes.

| Body field | Type   | Required      |
| ---------- | ------ | ------------- |
| `token`    | string | Yes (shape 1) |
| `inviteId` | UUID   | Yes (shape 2) |

## Response

- HTTP 200: `WorkspaceInviteAccepted` with `workspace`, `membership`.

The [OpenAPI document](https://pubnio.com/api/v1/openapi) has each field's type.

## Examples

### TypeScript

```ts
const accepted = await client.me.acceptInvite({ inviteId });
```

Create this client with a signed-in person's `accessToken`, not an `apiKey`.

### Python

The Python SDK authenticates with a workspace API key, which this operation does not accept, so it has no method for it.

### cURL

```sh
curl -X POST "https://pubnio.com/api/v1/me/invites/accept" \
  -H "Authorization: Bearer $PUBNIO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"inviteId":"'"$INVITE_ID"'"}'
```

### CLI

```sh
pnio profile invites accept "$INVITE_ID"
```

### MCP execute

```js
async () => {
  const inviteId = "<inviteId>";
  const response = await codemode.request({
    method: "POST",
    path: "/api/v1/me/invites/accept",
    body: { inviteId: inviteId },
  });
  return response.data;
};
```

## Errors

It declares no problem of its own.

It declares the problems [every Your invitations operation](https://pubnio.com/docs/reference/#your-invitations) and [most operations](https://pubnio.com/docs/reference/#shared-problems) declare.

## Idempotency

No key, so a retried `POST` is not deduplicated. Read the current state before you retry.

## Limits

- API keys and MCP cannot call it. A signed-in person runs it from the CLI after `pnio auth login` or in the web app.

## Related

- [Your invitations operations](https://pubnio.com/docs/reference/#your-invitations)

Source: https://pubnio.com/docs/reference/me-invites-accept/index.mdx
