---
title: "Create a new Identity"
method: POST
path: "/api/users/{user_id}/identities/"
tags: ["users"]
---

# Create a new Identity

`POST /api/users/{user_id}/identities/`

## Request

- Base URL: `https://docs.blindinsight.io` (the document declares no server; this is the origin it was published from)
- URL: `https://docs.blindinsight.io/api/users/{user_id}/identities/`
- Auth: one of:
  - API key in cookie `sessionid`
  - HTTP basic
  - HTTP bearer
- TypeScript: <https://skmtc.dev/blindinsight/apis/blind-insight-rest-api/docs/api/users/:user_id/identities/post.ts> (a function with typed inputs; its response is checked against the schema)

Create a new identity.

The response will be the newly created identity object.

**On the command line:**

```bash
blind users identities create --user-id "<user_id>" --data identity.json
```

## Path parameters

- `user_id` string, required

## Request body

- Identity: HyperlinkedModelSerializer with `id` as the first field.
  - `id` string, required
  - `url` string, uri, required
  - `user` string, uri, required
  - `device_id` string, required: The device ID associated with this identity.
  - `primary_public_key` string, required: The primary PGP key for the identity.
  - `sub_public_key` string, required: The PGP sub-key for the identity.

## Response `201`

- Identity: HyperlinkedModelSerializer with `id` as the first field.
  - `id` string, required
  - `url` string, uri, required
  - `user` string, uri, required
  - `device_id` string, required: The device ID associated with this identity.
  - `primary_public_key` string, required: The primary PGP key for the identity.
  - `sub_public_key` string, required: The PGP sub-key for the identity.

---

[API](https://skmtc.dev/blindinsight/apis/blind-insight-rest-api.md) - [All operations](https://skmtc.dev/blindinsight/apis/blind-insight-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/blindinsight/apis/blind-insight-rest-api/revisions/0ac902401cea?raw)
