---
title: "Create a persona"
method: POST
path: "/api/v1/personas"
tags: ["Personas"]
---

# Create a persona

`POST /api/v1/personas`

## Request

- Base URL: `https://app.promptingco.com`
- URL: `https://app.promptingco.com/api/v1/personas`
- Auth: one of:
  - API key in header `x-api-key`
  - HTTP bearer
  - API key in cookie `better-auth.session_token`

Creates a persona for the product named by productId (brandId is accepted as a legacy alias). Idempotent on name, case-insensitively: an existing persona with the same name is returned with status 200 instead of being duplicated.

## Query parameters

- `productId` string
- `brandId` string

## Request body

- object
  - `name` string, required
  - `description` string, required
  - `systemPrompt` string, nullable

## Response `200`

A persona with this name already existed and is returned unchanged

- object
  - `ok` true, required
  - `data` unknown

## Other responses

- `201`: Successful response
- `400`: Bad request
- `401`: Authentication required
- `403`: Forbidden
- `404`: Not found
- `422`: Validation failed
- `500`: Internal server error

---

[API](https://skmtc.dev/promptingcompany/apis/the-prompting-company-api.md) - [All operations](https://skmtc.dev/promptingcompany/apis/the-prompting-company-api/llms.txt) - [OpenAPI document](https://skmtc.dev/promptingcompany/apis/the-prompting-company-api/revisions/c0451ea10e9a?raw)
