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

# Create Contact

> Create a new Contact



## OpenAPI

````yaml /api-reference/openapi/EvoAI-CRM-Service/contacts.yaml post /api/v1/contacts
openapi: 3.0.4
info:
  title: Evolution Foundation - CRM Service - Contacts
  description: Management of contacts, conversations, inboxes, labels and macros
  version: 1.1.0
servers:
  - url: https://api.evoai.app
    description: Production server
  - url: http://localhost:3000
    description: Development server
    variables:
      port:
        default: '3000'
  - url: '{customUrl}'
    description: Custom server
    variables:
      customUrl:
        default: https://your-instance.com
        description: Enter your server URL
security: []
paths:
  /api/v1/contacts:
    post:
      summary: Create Contact
      description: Create a new Contact
      operationId: contactCreate
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/contact_create_payload'
            example:
              name: Maria Santos
              identifier: maria-external-123
              email: maria@empresa.com.br
              phone_number: '+5521987654321'
              type: person
              blocked: false
              tax_id: '12345678901'
              website: https://empresa.com.br
              industry: Technology
              avatar_url: https://example.com/avatar.jpg
              additional_attributes:
                company: Tech Solutions Ltda
                city: São Paulo
                country: Brazil
                country_code: BR
                description: Lead from website campaign
                social_profiles:
                  linkedin: mariasantos
                  instagram: maria.santos
              custom_attributes:
                lead_source: website
                interest: premium_plan
              labels:
                - lead
                - premium
              company_ids:
                - 550e8400-e29b-41d4-a716-446655440000
              inbox_id: 550e8400-e29b-41d4-a716-446655440001
              source_id: '+5521987654321'
      responses:
        '200':
          description: Contact created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/contact_create_response'
              example:
                success: true
                data:
                  contact:
                    id: 3b49511b-c35c-429c-85c3-a83feb87cbef
                    name: Maria Santos
                    email: maria@empresa.com.br
                    phone_number: '+5521987654321'
                    identifier: maria-external-123
                    blocked: false
                    type: person
                    tax_id: '12345678901'
                    website: https://empresa.com.br
                    industry: Technology
                    additional_attributes:
                      city: São Paulo
                      company: Tech Solutions Ltda
                      country: Brazil
                      country_code: BR
                      description: Lead from website campaign
                      social_profiles:
                        github: ''
                        twitter: ''
                        facebook: ''
                        linkedin: mariasantos
                        instagram: maria.santos
                    custom_attributes:
                      lead_source: website
                      interest: premium_plan
                    created_at: 1765200698
                    last_activity_at: null
                    labels:
                      - id: 550e8400-e29b-41d4-a716-446655440002
                        title: lead
                        color: '#4CAF50'
                      - id: 550e8400-e29b-41d4-a716-446655440003
                        title: premium
                        color: '#2196F3'
                    contact_inboxes:
                      - source_id: '+5521987654321'
                        inbox:
                          id: 550e8400-e29b-41d4-a716-446655440001
                          name: WhatsApp Business
                          channel_type: whatsapp
                    companies:
                      - id: 550e8400-e29b-41d4-a716-446655440000
                        name: Tech Solutions Ltda
                        type: company
                  contact_inbox:
                    inbox:
                      id: 550e8400-e29b-41d4-a716-446655440001
                      name: WhatsApp Business
                      channel_type: whatsapp
                    source_id: '+5521987654321'
                message: Contact created successfully
        '400':
          description: Bad Request (invalid data)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                validation_error:
                  summary: Invalid request parameters
                  value:
                    success: false
                    error:
                      code: VALIDATION_ERROR
                      message: Invalid request parameters
                    meta:
                      timestamp: '2024-01-15T10:30:00Z'
                      path: /api/v1/contacts
                      method: POST
        '401':
          description: Unauthorized (invalid or missing token)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                invalid_token:
                  summary: Invalid or missing token
                  value:
                    success: false
                    error:
                      code: INVALID_TOKEN
                      message: Invalid token
                    meta:
                      timestamp: '2024-01-15T10:30:00Z'
                      path: /api/v1/contacts
                      method: POST
        '403':
          description: Forbidden (insufficient permissions)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                forbidden:
                  summary: Access forbidden
                  value:
                    success: false
                    error:
                      code: FORBIDDEN
                      message: You do not have permission to access this resource
                    meta:
                      timestamp: '2024-01-15T10:30:00Z'
                      path: /api/v1/contacts
                      method: POST
        '404':
          description: Not Found (resource not found)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                not_found:
                  summary: Resource not found
                  value:
                    success: false
                    error:
                      code: NOT_FOUND
                      message: Resource not found
                    meta:
                      timestamp: '2024-01-15T10:30:00Z'
                      path: /api/v1/contacts
                      method: POST
        '500':
          description: Internal Server Error (internal server error)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bad_request_error'
              example:
                success: false
                error: Bad Request
                message: Validation failed
                details:
                  name:
                    - can't be blank
      security:
        - userApiKey: []
components:
  schemas:
    contact_create_payload:
      type: object
      required:
        - name
      properties:
        name:
          type: string
          description: Name of the contact
          example: Maria Santos
        identifier:
          type: string
          description: Unique identifier for the contact (e.g., external ID)
          example: maria-santos-123
        email:
          type: string
          format: email
          description: Email address of the contact
          example: maria@empresa.com.br
        phone_number:
          type: string
          description: Phone number with country code
          example: '+5521987654321'
        blocked:
          type: boolean
          description: Whether the contact is blocked
          default: false
          example: false
        avatar_url:
          type: string
          format: uri
          description: URL to download and set as contact's avatar
          example: https://example.com/avatar.jpg
        type:
          type: string
          enum:
            - person
            - company
          default: person
          description: Type of contact
          example: person
        tax_id:
          type: string
          description: Tax ID (CPF/CNPJ)
          example: '12345678901'
        website:
          type: string
          format: uri
          description: Contact's website URL
          example: https://empresa.com.br
        industry:
          type: string
          description: Industry/sector of the contact or company
          example: Technology
        additional_attributes:
          type: object
          description: Additional attributes for the contact
          additionalProperties: true
          example:
            company: Tech Solutions Ltda
            city: São Paulo
            country: Brazil
            country_code: BR
            description: Lead from website
            social_profiles:
              linkedin: mariasantos
              instagram: maria.santos
        custom_attributes:
          type: object
          description: Custom attributes as key-value pairs
          additionalProperties: true
          example:
            lead_source: website
            interest: premium_plan
        labels:
          type: array
          description: Labels to assign to the contact
          items:
            type: string
          example:
            - lead
            - premium
        company_ids:
          type: array
          description: >-
            Array of company IDs to associate with this contact (only for person
            type)
          items:
            type: string
            format: uuid
          example:
            - 550e8400-e29b-41d4-a716-446655440000
        inbox_id:
          type: string
          format: uuid
          description: Inbox ID to create a contact_inbox association
          example: 550e8400-e29b-41d4-a716-446655440001
        source_id:
          type: string
          description: >-
            Source ID for the contact_inbox (e.g., WhatsApp number, email
            address)
          example: '+5521987654321'
    contact_create_response:
      type: object
      required:
        - success
        - data
        - message
      properties:
        success:
          type: boolean
          example: true
        data:
          type: object
          required:
            - contact
          properties:
            contact:
              allOf:
                - $ref: '#/components/schemas/contact_full'
                - type: object
                  properties:
                    companies:
                      type: array
                      description: Companies associated with this contact
                      items:
                        type: object
                        properties:
                          id:
                            type: string
                            format: uuid
                          name:
                            type: string
                          type:
                            type: string
                            enum:
                              - company
            contact_inbox:
              type: object
              nullable: true
              description: Contact inbox created (if inbox_id was provided)
              properties:
                inbox:
                  type: object
                  properties:
                    id:
                      type: string
                      format: uuid
                    name:
                      type: string
                    channel_type:
                      type: string
                source_id:
                  type: string
                  description: Source ID for the contact in this inbox
        message:
          type: string
          example: Contact created successfully
    ErrorResponse:
      type: object
      required:
        - success
        - error
        - meta
      properties:
        success:
          type: boolean
          example: false
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              example: VALIDATION_ERROR
            message:
              type: string
              example: Validation failed
            details:
              type: object
              additionalProperties: true
              nullable: true
        meta:
          type: object
          required:
            - timestamp
            - path
            - method
          properties:
            timestamp:
              type: string
              format: date-time
              example: '2024-01-15T10:30:00Z'
            path:
              type: string
              example: /public/api/v1/inboxes/{inbox_identifier}/contacts
            method:
              type: string
              example: POST
    bad_request_error:
      type: object
      properties:
        success:
          type: boolean
          example: false
        error:
          type: string
          example: Bad Request
        message:
          type: string
          example: Validation failed
        details:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
          example:
            name:
              - can't be blank
            email:
              - is invalid
    contact_full:
      type: object
      properties:
        id:
          type: string
          format: uuid
          example: 3b49511b-c35c-429c-85c3-a83feb87cbef
        name:
          type: string
          example: Maria Santos
        email:
          type: string
          nullable: true
          example: maria@empresa.com.br
        phone_number:
          type: string
          nullable: true
          example: '+5521987654321'
        identifier:
          type: string
          nullable: true
          example: DavidsonGomes
        blocked:
          type: boolean
          example: false
        type:
          type: string
          enum:
            - person
            - company
          example: person
        tax_id:
          type: string
          nullable: true
        website:
          type: string
          nullable: true
        industry:
          type: string
          nullable: true
        additional_attributes:
          type: object
          properties:
            city:
              type: string
            company:
              type: string
              example: Tech Solutions Ltda
            country:
              type: string
            location:
              type: object
              properties:
                city:
                  type: string
                country:
                  type: string
                country_code:
                  type: string
            description:
              type: string
            company_name:
              type: string
            country_code:
              type: string
            language_code:
              type: string
              example: pt-br
            username:
              type: string
            social_profiles:
              type: object
              properties:
                github:
                  type: string
                twitter:
                  type: string
                facebook:
                  type: string
                linkedin:
                  type: string
                instagram:
                  type: string
            social_telegram_user_id:
              type: integer
            social_telegram_user_name:
              type: string
        custom_attributes:
          type: object
          additionalProperties: true
        created_at:
          type: integer
          description: Unix timestamp
          example: 1765200698
        last_activity_at:
          type: integer
          nullable: true
          description: Unix timestamp of last activity
          example: 1768597854
        labels:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                format: uuid
              title:
                type: string
              color:
                type: string
        contact_inboxes:
          type: array
          items:
            type: object
            properties:
              source_id:
                type: string
              inbox:
                type: object
                properties:
                  id:
                    type: string
                    format: uuid
                  name:
                    type: string
                  channel_type:
                    type: string
  securitySchemes:
    userApiKey:
      type: apiKey
      in: header
      name: api_access_token

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.