# How to create a new profile

If you have no profile yet (the build pipeline has never made one for you),
you can create one yourself and start editing it right away. To learn why
creation and ownership happen together, see [Core concepts](/prosopia/concepts.md).

You can sign in with **ORCID** or **Google**. There is one create endpoint:

- with an ORCID iD linked to your account, the new profile's id IS your ORCID iD;
- signed in with Google only, the new profile gets a Prosopia id (`local:...`).
  That id is permanent. If you have an ORCID iD, link it first (Account
  settings, or the **Link ORCID iD first** button on the form). If you link it
  later, you are offered **Convert your profile to my ORCID iD**, which merges
  your profile into a new one with your ORCID iD and keeps your handle.

Every account has at most one profile about itself, so you can create one only
while you have none.

## Prerequisites

- You have no profile yet. If one exists for you, claim it instead. See
  [How to claim your researcher profile](/prosopia/how-to/claim-a-profile.md).

## Steps

1. Sign in. This redirects you to the provider and back, then sets your
   session cookie:

    ```
    GET /auth/orcid      (or GET /auth/google)
    ```

2. Confirm you can create. In the session probe response, `creatable` is `true`
   only when you have no profile and nothing to claim. `create_rid_kind` says
   whether the new profile gets your ORCID iD (`orcid`) or a Prosopia id
   (`local`):

    ```bash
    curl -b "rp_session=<your-cookie>" https://prosopia.databio.org/api/v1/manage/session
    ```

3. Create the profile. Every field is optional. With an ORCID session you can
   send an empty body; the server uses the name from your login and derives a
   slug:

    ```bash
    curl -b "rp_session=<your-cookie>" \
      -H "Content-Type: application/json" \
      -X POST https://prosopia.databio.org/api/v1/manage/profiles \
      -d '{}'
    ```

    You can also supply a `name` (required if your login provider gave none)
    and a `slug` (a lowercase handle; collisions get a `-2`, `-3`, … suffix):

    ```bash
    curl -b "rp_session=<your-cookie>" \
      -H "Content-Type: application/json" \
      -X POST https://prosopia.databio.org/api/v1/manage/profiles \
      -d '{"name": "Jane A. Doe", "slug": "jane-doe"}'
    ```

    You can also say where you are in your career with `current_rank`: one of
    `assistant_professor`, `associate_professor`, `professor`,
    `research_faculty`, `staff_scientist`, `postdoc`, `graduate_student`,
    `undergraduate`, `clinician`, `industry` or `other`. The form on the
    website asks this as one optional click. It changes what the editor's checklist and the AI interview ask
    for: a student is not asked for papers they do not have yet. It is saved as
    your own answer, so a later build never overwrites it, and you can change
    it in the editor:

    ```bash
    curl -b "rp_session=<your-cookie>" \
      -H "Content-Type: application/json" \
      -X POST https://prosopia.databio.org/api/v1/manage/profiles \
      -d '{"current_rank": "graduate_student"}'
    ```

    The server writes the owner grant in the same transaction that creates the
    profile, so there is never a moment when the profile exists but nobody owns
    it.

4. Edit the profile right away. The response includes the edit URLs. The new
   profile starts minimal and unpublished (`level: "lite"`,
   `visibility: "limited"`), so the public sees none of it until you choose
   what the public may read on the Privacy page:

    ```bash
    curl -b "rp_session=<your-cookie>" \
      -H "Content-Type: application/json" \
      -X PATCH https://prosopia.databio.org/api/v1/profiles/jane-doe/metadata \
      -d '{"field": "Computational Biology", "summary": "I study genomes.", "soul": "# How I think\n"}'
    ```

    `soul` is the "how I think" narrative. It is a field like the others, so
    one request saves it with the rest.

## What success looks like

Creation returns `201 Created` with the slug, the rid, its kind, and the edit URLs:

```json
{
  "slug": "jane-doe",
  "rid": "0000-0002-1825-0097",
  "rid_kind": "orcid",
  "level": "lite",
  "visibility": "limited",
  "edit_urls": {
    "metadata": "/api/v1/profiles/jane-doe/metadata",
    "visibility": "/api/v1/profiles/jane-doe/visibility"
  }
}
```

## What can go wrong

- **`401`**: you are not logged in, or your session expired.
- **`400`**: the server could not determine a name, or the requested `slug` is
  malformed.
- **`409`**: you already have a profile, a profile with your ORCID iD already
  exists (claim it instead), or the `slug` you requested is taken.

## Deleting a profile

You can remove a profile you created by mistake. Only the owner can delete a
profile. Deletion returns `204 No Content`:

```bash
curl -b "rp_session=<your-cookie>" \
  -X DELETE https://prosopia.databio.org/api/v1/manage/profiles/jane-doe
```

## Next steps

- A freshly created profile is an empty shell: no publications, no expertise
  narrative, no embedding index. Fill it in yourself with
  [How to build a profile](/prosopia/how-to/build-on-demand.md).
- No papers yet? Connect an AI app and ask it to interview you; see
  [Connect an AI app](/prosopia/how-to/connect-an-ai.md).
- To put it on the open web, see
  [How to share your profile](/prosopia/how-to/share-your-profile.md).
