# How to claim your researcher profile

If the build pipeline has already made a profile for you, claiming it makes you
its owner. You can then edit, publish, and manage it. A claim succeeds only when
the ORCID iD you log in with matches the profile's identity, so no operator has
to approve it. For why the claim verifies itself, see
[Core concepts](/prosopia/concepts.md).

## Prerequisites

- You have an ORCID iD, and a profile already exists with that ORCID as its
  `rid` (built by the pipeline).
- That profile is unowned — nobody has claimed it yet.

## Steps

1. Log in with ORCID. Open the site and start the login flow. It redirects
   you to ORCID and back:

    ```
    GET /api/manage/login
    ```

    On return you hold a signed session cookie (`rp_session`). That cookie
    authenticates every step below.

2. Confirm the profile is claimable. Read the session probe and look at the
   `claimable` list. It names the slug of any profile whose `rid` matches your
   logged-in ORCID and that nobody owns yet:

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

    ```json
    {
      "authenticated": true,
      "user": {"orcid": "0000-0002-1825-0097", "name": "Jane A. Doe"},
      "claimable": ["jane-doe"],
      "owned": []
    }
    ```

    If both `claimable` and `owned` are empty, no profile carries your ORCID.
    See [How to create a new profile](/prosopia/how-to/create-a-profile.md) instead.

3. Claim it. Post the slug from `claimable`:

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

## What success looks like

The claim returns `201 Created` with your new ownership:

```json
{
  "slug": "jane-doe",
  "rid": "0000-0002-1825-0097",
  "owned": [{"slug": "jane-doe", "rid": "0000-0002-1825-0097", "published": false}]
}
```

The profile now appears under `owned` on the session probe. You can edit it,
share it, and publish it.

## What can go wrong

- **`401`**: you are not logged in, or your session expired. Repeat step 1.
- **`403`**: the profile's ORCID identity does not match your logged-in ORCID,
  or the profile has no ORCID `rid` at all. You can only claim your own profile.
  A non-ORCID profile requires an admin grant.
- **`404`**: no profile resolves to that slug.
- **`409`**: the profile is already claimed. Each profile has exactly one
  owner.

## Next steps

- Claiming does not publish. See
  [How to share your profile](/prosopia/how-to/share-your-profile.md).
- A claimed profile made by the pipeline already has content. To fill in a
  shell profile yourself, see [How to build a profile](/prosopia/how-to/build-on-demand.md).
