---
title: "Change the plan bound to an access"
description: "PATCH /admin/v1/workspace-accesses/{accessId}/plan — Change the plan bound to an access"
---

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

# Change the plan bound to an access

## Endpoint

```http
PATCH /admin/v1/workspace-accesses/{accessId}/plan
```

Operation ID: `changeAccessPlan`

## Authentication

Send a Nexus Management Key as `Authorization: Bearer <management-key>`. This credential is control-plane only.

## Idempotency

This operation does not declare an `Idempotency-Key` requirement in the accepted OpenAPI contract.

## Request

### Parameters

| Name       | Location | Required | Schema   | Description |
| ---------- | -------- | -------- | -------- | ----------- |
| `accessId` | path     | Yes      | `string` | —           |

### application/json body

Required: **Yes**

Type: `ChangeAccessPlanDto`

| Field         | Required | Type     | Description |
| ------------- | -------- | -------- | ----------- |
| `planId`      | Yes      | `string` | —           |
| `effectiveAt` | No       | `string` | —           |

## Responses

| Status | Description | Content type     | Schema               |
| ------ | ----------- | ---------------- | -------------------- |
| `200`  | —           | application/json | `WorkspaceAccessDto` |

Only responses explicitly declared by the accepted Admin OpenAPI contract are shown. The current contract does not declare operation-specific error bodies; the SDK preserves any non-success status and body in [`AdminApiError`](/management-sdk/error-handling).

### `200` application/json schema

Type: `WorkspaceAccessDto`

| Field            | Required | Type                                                            | Description |
| ---------------- | -------- | --------------------------------------------------------------- | ----------- |
| `id`             | Yes      | `string`                                                        | —           |
| `workspaceId`    | Yes      | `string`                                                        | —           |
| `userId`         | Yes      | `string`                                                        | —           |
| `externalUserId` | Yes      | `string`                                                        | —           |
| `planId`         | Yes      | `string`                                                        | —           |
| `status`         | Yes      | `string (PENDING \| ACTIVE \| SUSPENDED \| EXPIRED \| REVOKED)` | —           |
| `accessStartsAt` | Yes      | `string / date-time`                                            | —           |
| `accessEndsAt`   | No       | `string / date-time`                                            | —           |
| `metadata`       | No       | `object`                                                        | —           |

## Examples

### TypeScript Management SDK

`NexusAdminClient.changeAccessPlan` uses `AdminOperationInput<"changeAccessPlan">` and returns `Promise<AdminOperationOutput<"changeAccessPlan">>`.

```ts
import { NexusAdminClient } from '@nexus/sdk-typescript';

const nexus = new NexusAdminClient({
  baseUrl: 'https://nexus.microvoid.io',
  managementKey: process.env.NEXUS_MANAGEMENT_KEY,
});

const result = await nexus.changeAccessPlan({
  path: {
    accessId: '533c4e1e-2823-4349-86b9-d6f1a869a2ca',
  },
  body: {
    planId: '533c4e1e-2823-4349-86b9-d6f1a869a2ca',
  },
});
```

### Fetch

```ts
const response = await fetch(
  'https://nexus.microvoid.io/admin/v1/workspace-accesses/533c4e1e-2823-4349-86b9-d6f1a869a2ca/plan',
  {
    method: 'PATCH',
    headers: {
      Authorization: `Bearer ${process.env.NEXUS_MANAGEMENT_KEY}`,
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      planId: '533c4e1e-2823-4349-86b9-d6f1a869a2ca',
    }),
  },
);

if (!response.ok) throw new Error(`Nexus request failed: ${response.status}`);
```

### curl

```bash
curl --request PATCH \
  "https://nexus.microvoid.io/admin/v1/workspace-accesses/533c4e1e-2823-4349-86b9-d6f1a869a2ca/plan" \
  --header "Authorization: Bearer ${NEXUS_MANAGEMENT_KEY}" \
  --header "Content-Type: application/json" \
  --data "{\"planId\":\"533c4e1e-2823-4349-86b9-d6f1a869a2ca\"}"
```

## Related guide

- [Workspace access](/docs/give-users-access/workspace-access)
- [API Reference overview](/api-reference)

Source: https://nexus.microvoid.io/api-reference/admin/users-and-access/change-access-plan/index.mdx
