Skip to content

Create a workspace profile

PubNio API profiles.create: create a workspace profile. Request fields, examples in five clients, errors, and idempotency.

Create a workspace profile with 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 has each field’s type.

Examples

const created = await workspace.profiles.create({
  name: "Trail Notes",
  externalId: "cus_8421",
});
created = workspace.profiles.create(name="Trail Notes", external_id="cus_8421")
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"}'
pnio profiles create --name "Trail Notes" --external-id cus_8421
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 declare.

Idempotency

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

Limits

Type to search…

↑↓ navigate↵ selectEsc close