---
title: "Create a workspace profile"
description: "PubNio API profiles.create: create a workspace profile. 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.

# Create a workspace profile

Create a workspace profile with [`POST /api/v1/profiles`](https://pubnio.com/api/v1/docs#tag/profiles/POST/api/v1/profiles). Requires an API key with the `publish` scope or a signed-in workspace owner.

## Request

The same name and externalId again return the existing profile with 200; a taken name or externalId returns 409.

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

| Body field   | Type   | Required |
| ------------ | ------ | -------- |
| `name`       | string | Yes      |
| `externalId` | string | No       |

## Response

- HTTP 200: `WorkspaceProfile` with `id`, `workspaceId`, `name`, `externalId`, `isDefault`, `archived`, `createdAt`, `updatedAt`.
- HTTP 201: `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 created = await workspace.profiles.create({
  name: "Trail Notes",
  externalId: "cus_8421",
});
```

### Python

```python
created = workspace.profiles.create(name="Trail Notes", external_id="cus_8421")
```

### cURL

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

### CLI

```sh
pnio profiles create --name "Trail Notes" --external-id cus_8421
```

### MCP execute

```js
async () => {
  const response = await codemode.request({
    method: "POST",
    path: "/api/v1/profiles",
    query: { workspaceId: codemode.workspaceId },
    body: { name: "Trail Notes", externalId: "cus_8421" },
  });
  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 `POST` 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-create/index.mdx
