---
title: "Rename a profile or change its external ID"
description: "PubNio API profiles.update: rename a profile or change its external ID. 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.

# Rename a profile or change its external ID

Rename a profile or change its external ID with [`PATCH /api/v1/profiles/{profileId}`](https://pubnio.com/api/v1/docs#tag/profiles/PATCH/api/v1/profiles/{profileId}). Requires an API key with the `publish` scope or a signed-in workspace owner.

## Request

| Parameter     | In    | Type | Required |
| ------------- | ----- | ---- | -------- |
| `profileId`   | path  | UUID | Yes      |
| `workspaceId` | query | UUID | Yes      |

| Body field   | Type           | Required |
| ------------ | -------------- | -------- |
| `name`       | string         | No       |
| `externalId` | string or null | No       |

## Response

- HTTP 200: `WorkspaceProfile` with `id`, `workspaceId`, `name`, `externalId`, `isDefault`, `archived`, `createdAt`, `updatedAt`.

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

## Examples

### TypeScript

```ts
const updated = await workspace.profiles.update(profileId, {
  name: "Trail Notes Co.",
});
```

### Python

```python
updated = workspace.profiles.update(profile_id, name="Trail Notes Co.")
```

### cURL

```sh
curl -X PATCH "https://pubnio.com/api/v1/profiles/$PROFILE_ID?workspaceId=$WORKSPACE_ID" \
  -H "Authorization: Bearer $PUBNIO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"Trail Notes Co."}'
```

### CLI

```sh
pnio profiles update "$PROFILE_ID" --name "Trail Notes Co."
```

### MCP execute

```js
async () => {
  const profileId = "<profileId>";
  const response = await codemode.request({
    method: "PATCH",
    path: `/api/v1/profiles/${profileId}`,
    query: { workspaceId: codemode.workspaceId },
    body: { name: "Trail Notes Co." },
  });
  return response.data;
};
```

## Errors

It declares no problem of its own.

It declares the problems [most operations](https://pubnio.com/docs/reference/#shared-problems) declare.

## Idempotency

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

## Limits

- Field lengths and ranges are in the [OpenAPI document](https://pubnio.com/api/v1/openapi).

## Related

- [Profiles operations](https://pubnio.com/docs/reference/#profiles)
- [Accounts and connections](https://pubnio.com/docs/accounts/)
- [Build a platform](https://pubnio.com/docs/build-a-platform/)

Source: https://pubnio.com/docs/reference/profiles-update/index.mdx
