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

# Create a new record

> Creates a new record for a specific object type with the provided attributes



## OpenAPI

````yaml /api-reference/openapi.json post /v1/objects/{slug}
openapi: 3.0.0
info:
  description: >-
    REST API for accessing and managing your Nex data. Generate API keys from
    the Nex web UI and use them to authenticate requests.
  title: Nex Developer API
  contact: {}
  version: '1.0'
servers:
  - url: https://app.nex.ai/api/developers
security: []
paths:
  /v1/objects/{slug}:
    post:
      tags:
        - Records
      summary: Create a new record
      description: >-
        Creates a new record for a specific object type with the provided
        attributes
      operationId: createRecord
      parameters:
        - description: Object slug (e.g., 'person', 'company')
          name: slug
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/developer.CreateRecordRequest'
        description: Record attributes
        required: true
      responses:
        '200':
          description: Created record with all attributes
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/developer.CreateRecordResponse'
        '400':
          description: Bad request - Invalid data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/httpx.APIError'
        '401':
          description: Unauthorized - Invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/httpx.APIError'
        '404':
          description: Object type not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/httpx.APIError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/httpx.APIError'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    developer.CreateRecordRequest:
      type: object
      required:
        - attributes
      properties:
        attributes:
          type: object
          required:
            - name
          properties:
            name:
              description: >-
                Can be a string (e.g., 'John Doe') or an object (e.g.,
                {'first_name': 'John', 'last_name': 'Doe'} for Person objects).
              oneOf:
                - type: string
                - type: object
                  additionalProperties: {}
          additionalProperties: {}
      example:
        attributes:
          name:
            first_name: John
            last_name: Doe
          name (alternative): John Doe
          email_addresses:
            - john@example.com
          phone_number:
            country_code: 1
            number: '5551234567'
          job_title: Software Engineer
          location:
            street: 123 Main St
            city: Boston
            region: MA
            postal_code: '02134'
            country: US
    developer.CreateRecordResponse:
      type: object
      properties:
        attributes:
          type: object
          additionalProperties: {}
        created_at:
          type: string
        id:
          type: string
        object_id:
          type: string
        type:
          type: string
        updated_at:
          type: string
        workspace_id:
          type: string
      example:
        id: '32710180831586561'
        object_id: '32710180831586560'
        type: person
        workspace_id: '32710180831586559'
        created_at: '2024-01-15T10:30:00Z'
        updated_at: '2024-01-15T10:30:00Z'
        attributes:
          name:
            first_name: John
            last_name: Doe
          email_addresses:
            - john@example.com
          phone_number:
            country_code: 1
            number: '5551234567'
          job_title: Software Engineer
          location:
            street: 123 Main St
            city: Boston
            region: MA
            postal_code: '02134'
            country: US
    httpx.APIError:
      type: object
      properties:
        code:
          type: integer
        message:
          type: string
  securitySchemes:
    ApiKeyAuth:
      description: 'API key for authentication (format: "Bearer YOUR_API_KEY")'
      type: apiKey
      name: Authorization
      in: header

````