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

# Create Person

> Creates a new person record in the database.



## OpenAPI

````yaml /api-reference/openapi.json post /people
openapi: 3.1.0
info:
  title: baselayer-api-service
  version: 0.1.0
servers:
  - url: https://api.baselayer.com/
security: []
paths:
  /people:
    post:
      tags:
        - People
      summary: Create Person
      description: Creates a new person record in the database.
      operationId: create_person_people_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/v1.CreatePersonRequest'
        required: true
      responses:
        '201':
          description: Person created successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/v1.PersonSummaryResponse'
        '400':
          description: Failed to create person due to validation errors.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIError'
                title: FailedToCreatePerson
                description: Failed to create person due to validation errors.
                examples:
                  - code: 1000
                    message: Failed to create person due to validation errors.
                    metadata: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    v1.CreatePersonRequest:
      properties:
        first_name:
          type: string
          maxLength: 255
          minLength: 2
          title: First Name
          description: The first name of the person
          examples:
            - John
            - Jane
        last_name:
          type: string
          maxLength: 255
          minLength: 2
          title: Last Name
          description: The last name of the person
          examples:
            - Doe
            - Smith
        middle_name:
          anyOf:
            - type: string
              maxLength: 255
              minLength: 1
            - type: 'null'
          title: Middle Name
          description: The middle name of the person
          examples:
            - Michael
            - James
            - T
        phone_number:
          anyOf:
            - type: string
              maxLength: 30
              minLength: 12
              pattern: >-
                ^\+(?:[1-9]\d{0,2})(?:[
                -]?\d{1,4}){1,4}(?:\s?(?:x|ext\.?)\s?\d{1,10})?$
            - type: 'null'
          title: Phone Number
          description: The phone number of the person. Area code is mandatory.
          examples:
            - '+14013059855'
            - +1 707 456 7890 x784
            - +44 207-183-8750 ext. 784
        email:
          anyOf:
            - type: string
              maxLength: 255
              minLength: 5
              pattern: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$
            - type: 'null'
          title: Email
          description: The email address of the person
          examples:
            - john.doe@example.com
            - jane.smith@example.com
        date_of_birth:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Date Of Birth
          description: The date of birth of the person
          examples:
            - '1990-01-15'
        gender:
          anyOf:
            - $ref: '#/components/schemas/Gender'
            - type: 'null'
          description: The gender of the person
          examples:
            - M
            - F
        ssn:
          anyOf:
            - type: string
              maxLength: 9
              minLength: 9
              description: The full social security number of the person
              examples:
                - '123456789'
                - 123-45-6789
            - type: string
              maxLength: 4
              minLength: 4
              description: The last four digits of the social security number of the person
              examples:
                - '1234'
          title: Ssn
        marital_status:
          anyOf:
            - $ref: '#/components/schemas/MaritalStatus'
            - type: 'null'
          description: The marital status of the person
          examples:
            - married
            - single
        suffix:
          anyOf:
            - type: string
            - type: 'null'
          title: Suffix
          description: The suffix of the person
          examples:
            - Jr.
            - Sr.
        title:
          anyOf:
            - type: string
            - type: 'null'
          title: Title
          description: The title of the person
          examples:
            - Mr.
            - Mrs.
      additionalProperties: false
      type: object
      required:
        - first_name
        - last_name
        - ssn
      title: CreatePersonRequest (v1)
    v1.PersonSummaryResponse:
      properties:
        id:
          description: The unique identifier of the person
          examples:
            - c2fe09a9-2e5c-4254-9b54-2ea3b376a4f7
          format: uuid
          title: Id
          type: string
        first_name:
          description: The first name of the person
          examples:
            - John
            - Jane
          title: First Name
          type: string
        last_name:
          description: The last name of the person
          examples:
            - Doe
            - Smith
          title: Last Name
          type: string
        ssn:
          description: The social security number of the person
          examples:
            - XXXXX1234
          title: Ssn
          type: string
        middle_name:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: The middle name of the person
          examples:
            - Michael
            - James
            - T
          title: Middle Name
        suffix:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: The suffix of the person
          examples:
            - Jr.
            - Sr.
          title: Suffix
        title:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          description: The title of the person
          examples:
            - Mr.
            - Mrs.
          title: Title
        created_at:
          description: When the person record was created
          examples:
            - '2025-01-15T12:00:00Z'
          format: date-time
          title: Created At
          type: string
        updated_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          default: null
          description: When the person record was last updated
          examples:
            - '2025-01-15T12:00:00Z'
          title: Updated At
      required:
        - id
        - first_name
        - last_name
        - ssn
        - created_at
      title: PersonSummaryResponse (v1)
      type: object
    APIError:
      properties:
        code:
          type: integer
          title: Code
        message:
          type: string
          title: Message
        uri:
          anyOf:
            - type: string
            - type: 'null'
          title: Uri
        metadata:
          additionalProperties: true
          type: object
          title: Metadata
      type: object
      required:
        - code
        - message
      title: APIError
      description: >-
        APIError is a Pydantic model for standardizing error responses from the
        API.


        This class is used internally by APIException for JSON serialization.

        Users should typically work with APIException directly in exception
        catalogs.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    Gender:
      enum:
        - M
        - F
      title: Gender
      type: string
    MaritalStatus:
      enum:
        - married
        - single
        - divorced
        - widowed
        - separated
        - domestic_partner
        - civil_union
        - other
      title: MaritalStatus
      type: string
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key

````