> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hipp.health/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Specialization

> Create a new provider specialization category in your organization. Requires permission to manage providers. A name that duplicates an existing active category is rejected with a 409.

## Create Specialization

Create a new provider specialization category in your organization. Requires an
API key whose role permits managing providers.

### Headers

```
Authorization: Bearer <your-api-key>
Content-Type: application/json
```

### Request Body

```json theme={null}
{
  "name": "Autism Spectrum Disorder"
}
```

### Field Descriptions

* `name` (required): Display name of the specialization category. Leading and trailing whitespace is trimmed. A name that duplicates an existing active category (case-insensitive) is rejected with a `409`.

### Success Response (201)

```json theme={null}
{
  "publicId": "spec_abc123",
  "name": "Autism Spectrum Disorder",
  "isActive": true
}
```

### Error Responses

#### 400 - Validation Error

```json theme={null}
{
  "message": "Validation Error",
  "statusCode": 400,
  "validationErrors": [
    {
      "code": "too_small",
      "message": "Name is required",
      "path": ["name"]
    }
  ]
}
```

#### 401 - Unauthorized

```json theme={null}
{
  "error": "API key required",
  "statusCode": 401
}
```

#### 403 - Forbidden

Returned when your role does not permit managing providers.

```json theme={null}
{
  "error": "Access denied",
  "statusCode": 403
}
```

#### 409 - Conflict

Returned when an active category with the same name already exists (matched case-insensitively, after trimming).

```json theme={null}
{
  "error": "A specialization with this name already exists",
  "statusCode": 409
}
```


## OpenAPI

````yaml POST /v1/specializations
openapi: 3.0.0
info:
  title: Hipp Health API
  version: 1.0.0
  description: API for managing users and resources within your Hipp Health organization
servers:
  - url: https://app.hipp.health/api
    description: Production Server
security: []
paths:
  /v1/specializations:
    post:
      tags:
        - specializations
      summary: Create a specialization category
      description: >-
        Create a new provider specialization category in your organization.
        Requires permission to manage providers. A name that duplicates an
        existing active category is rejected with a 409.
      operationId: createSpecialization
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateSpecializationRequest'
            examples:
              basic:
                summary: Create a specialization
                value:
                  name: Autism Spectrum Disorder
      responses:
        '201':
          description: Specialization created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SpecializationCategory'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '403':
          $ref: '#/components/responses/403'
        '409':
          $ref: '#/components/responses/409'
      security:
        - BearerAuth: []
components:
  schemas:
    CreateSpecializationRequest:
      type: object
      properties:
        name:
          type: string
          minLength: 1
          description: >-
            Display name of the specialization category. Leading/trailing
            whitespace is trimmed.
      required:
        - name
    SpecializationCategory:
      type: object
      description: >-
        A provider specialization category. isActive is derived from soft-delete
        state; soft-deleted categories are returned with isActive=false.
      properties:
        publicId:
          type: string
          description: Public identifier of the specialization category
        name:
          type: string
          description: Display name of the specialization category
        isActive:
          type: boolean
          description: Whether the category is active (not soft-deleted)
      required:
        - publicId
        - name
        - isActive
    ValidationError:
      type: object
      required:
        - message
        - statusCode
        - validationErrors
      properties:
        message:
          type: string
          example: Validation Error
        statusCode:
          type: integer
          example: 400
        validationErrors:
          type: array
          description: Zod validation issues
          items:
            type: object
            properties:
              code:
                type: string
                example: invalid_type
              message:
                type: string
                example: Required
              path:
                type: array
                items:
                  oneOf:
                    - type: string
                    - type: integer
                example:
                  - email
    ApiErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Human-readable error message
          example: User not found
        statusCode:
          type: integer
          example: 404
      required:
        - error
        - statusCode
  responses:
    '400':
      description: Bad Request - Validation Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ValidationError'
    '401':
      description: Unauthorized - API key required
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorResponse'
          example:
            error: API key required
            statusCode: 401
    '403':
      description: Forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorResponse'
          example:
            error: Access denied
            statusCode: 403
    '409':
      description: Conflict
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorResponse'
          example:
            error: A record with this email already exists
            statusCode: 409
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        API key authentication. Include your API key in the Authorization header
        as 'Bearer <your-api-key>'

````