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:
WorkspaceProfilewithid,workspaceId,name,externalId,isDefault,archived,createdAt,updatedAt. - HTTP 201:
WorkspaceProfilewithid,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_8421async () => {
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
- Field lengths and ranges are in the OpenAPI document.