---
title: "POST /api/v1/register"
method: POST
path: "/api/v1/register"
tags: ["fabric-ca-server"]
---

# POST /api/v1/register

`POST /api/v1/register`

Register a new identity with the Fabric CA server.   
An enrollment secret is returned which can then be used, along with the enrollment ID, to enroll a new identity.   
The caller must have **hf.Registrar** authority.

## Query parameters

- `ca` string

## Headers

- `Authorization` string, required

## Request body

- object
  - `id` string, required — The enrollment ID which uniquely identifies an identity
  - `type` string — The type of the identity (e.g. *user*, *app*, *peer*, *orderer*, etc)
  - `secret` string — The enrollment secret. If not provided, a random secret is generated.
  - `max_enrollments` integer — The maximum number of times that the secret can be used to enroll. If 0, use the configured max_enrollments of the fabric-ca-server; If > 0 and <= configured max enrollments of the fabric-ca-server, use max_enrollments; If > configured max enrollments of the fabric-ca-server, error.
  - `affiliation` string — The affiliation of the new identity. If no affliation is provided, the affiliation of the registrar is used.
  - `attrs` object[], required — An array of attribute names and values to give to the registered identity.
    - `name` string, required — Attribute name
    - `value` string, required — Value of attribute
    - `ecert` boolean — A value of true indicates that this attribute should be included in an enrollment certificate by default
  - `caname` string — Name of the CA to direct traffic to within server.

## Response `201`

Successfully registered identity

- ResponseBase
  - `result` unknown, required
  - `success` boolean, required — Boolean indicating if the request was successful.
  - `errors` object[], required — An array of error messages (code and message)
    - `code` integer, required — Integer code denoting the type of error.
    - `message` string, required — An error message
  - `messages` object[], required — An array of information messages (code and message)
    - `code` integer, required — Integer code denoting the type of message.
    - `message` string, required — A more specific message.

---

[API](https://skmtc.dev/hyperledger/apis/fabric-ca-server-api.md) · [All operations](https://skmtc.dev/hyperledger/apis/fabric-ca-server-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/hyperledger/fabric-ca-server-api/revisions/f1cf3d665f0e/schema)
