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

# Create a contact

> Create a new contact in your organization



## OpenAPI

````yaml /openapi.json post /v1/contacts
openapi: 3.0.3
info:
  title: Emailr API
  version: 1.0.0
servers:
  - url: https://api.emailr.dev
    description: Production
security: []
tags:
  - name: emails
    description: Email sending and management
  - name: contacts
    description: Contact management
  - name: templates
    description: Email template management
  - name: domains
    description: Domain verification and management
  - name: webhooks
    description: Webhook configuration
  - name: broadcasts
    description: Broadcast campaign management
  - name: segments
    description: Contact segmentation
paths:
  /v1/contacts:
    post:
      tags:
        - contacts
      summary: Create a contact
      description: Create a new contact in your organization
      operationId: createContact
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateContactRequest'
      responses:
        '200':
          description: Contact created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Contact'
        '400':
          description: Validation error or duplicate email
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
components:
  schemas:
    CreateContactRequest:
      type: object
      properties:
        email:
          type: string
          format: email
          example: contact@example.com
        first_name:
          type: string
          nullable: true
          example: John
        last_name:
          type: string
          nullable: true
          example: Doe
        subscribed:
          type: boolean
          default: true
          example: true
        metadata:
          type: object
          additionalProperties:
            anyOf:
              - type: string
              - type: number
              - type: boolean
            description: >-
              Property value supporting string, number, boolean, or date (as ISO
              string) types
            nullable: true
          description: >-
            Custom properties for the contact. Supports string, number, boolean,
            and date (as ISO string) values.
          example:
            source: website
            plan: pro
            active: true
            score: 100
            signup_date: '2024-01-15'
        tags:
          type: array
          items:
            type: string
          description: Tags for categorization. Lowercase, max 50 chars each, max 20 tags.
          example:
            - newsletter
            - vip
      required:
        - email
    Contact:
      type: object
      properties:
        id:
          type: string
          format: uuid
          example: 123e4567-e89b-12d3-a456-426614174000
        organization_id:
          type: string
          format: uuid
        email:
          type: string
          format: email
        first_name:
          type: string
          nullable: true
        last_name:
          type: string
          nullable: true
        metadata:
          type: object
          nullable: true
          additionalProperties:
            anyOf:
              - type: string
              - type: number
              - type: boolean
            description: >-
              Property value supporting string, number, boolean, or date (as ISO
              string) types
            nullable: true
          description: >-
            Custom properties for the contact. Supports string, number, boolean,
            and date (as ISO string) values.
        subscribed:
          type: boolean
        unsubscribed_at:
          type: string
          nullable: true
          format: date-time
        tags:
          type: array
          items:
            type: string
          description: Tags for categorization.
          example:
            - newsletter
            - vip
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
      required:
        - id
        - organization_id
        - email
        - first_name
        - last_name
        - metadata
        - subscribed
        - unsubscribed_at
        - tags
        - created_at
        - updated_at
    Error:
      type: object
      properties:
        error:
          type: string
          example: An error occurred
        code:
          type: string
          example: VALIDATION_ERROR
        details: {}
      required:
        - error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: API key authentication. Use your API key as the bearer token.

````