> ## Documentation Index
> Fetch the complete documentation index at: https://hilos-40.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Create or Update a contact

> When you POST a new Contact, we'll first check if another contact exists with the same phone. If it does, we'll do a partial update to the existing contact with this new information. We do this so you don't end up with duplicate contacts in your account. 

You can set arbitrary attributes for a contact in the meta object, using `meta={custom_property_1: 'some value', another_property: 'another value ...', ...}`. We parse all these attributes as strings for now. 

 We append the received `meta`, `tags` and `default_assignees` properties with the contact current ones, if you want to delete some key inside the `meta` or a `tags` you have to use the `overwrite_meta` or `overwrite_tags` attributes in the request body.



## OpenAPI

````yaml post /api/contact
openapi: 3.0.3
info:
  title: Hilos API
  version: 1.0.0
  description: >-
    All of the below API endpoints require API key authentication, get your
    token at https://app.hilos.io/dev/api-keys.


    To use this token, send with every request an `Authorization: Token <your
    token>` header.


    Production API server is located at api.hilos.io using HTTPS.


    No versioning info is required for now.
servers:
  - url: https://api.hilos.io
    description: Production Server
security: []
paths:
  /api/contact:
    post:
      tags:
        - Contact
      summary: Create a contact
      description: >-
        When you POST a new Contact, we'll first check if another contact exists
        with the same phone. If it does, we'll do a partial update to the
        existing contact with this new information. We do this so you don't end
        up with duplicate contacts in your account. 


        You can set arbitrary attributes for a contact in the meta object, using
        `meta={custom_property_1: 'some value', another_property: 'another value
        ...', ...}`. We parse all these attributes as strings for now. 

         We append the received `meta`, `tags` and `default_assignees` properties with the contact current ones, if you want to delete some key inside the `meta` or a `tags` you have to use the `overwrite_meta` or `overwrite_tags` attributes in the request body.
      operationId: Create or Update Contact
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedContactEditPublic'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedContactEditPublic'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedContactEditPublic'
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContactDetailReadPublic'
          description: ''
      security:
        - tokenAuth: []
components:
  schemas:
    PatchedContactEditPublic:
      type: object
      properties:
        phone:
          type: string
          maxLength: 30
        first_name:
          type: string
          nullable: true
          maxLength: 100
        last_name:
          type: string
          nullable: true
          maxLength: 100
        email:
          type: string
          format: email
          nullable: true
          maxLength: 254
        meta:
          type: object
          additionalProperties: {}
        external_url:
          type: string
          format: uri
          nullable: true
          maxLength: 200
        id:
          type: string
          format: uuid
        source:
          type: string
          default: website
        created_on:
          type: string
          format: date-time
          title: Creado el
        tags:
          type: array
          items:
            $ref: '#/components/schemas/ContactTag'
        default_assignees:
          type: array
          items:
            type: integer
        overwrite_tags:
          type: boolean
          default: false
          description: >-
            If true, the `tags` will be overwritten with the new value. If
            false, the new value will be merged with the existing value. Default
            is false.
        overwrite_default_assignees:
          type: boolean
          default: false
          description: >-
            If true, the `default_assignees` will be overwritten with the new
            value. If false, the new value will be merged with the existing
            value. Default is false.
        overwrite_meta:
          type: boolean
          default: false
          description: >-
            If true, the `meta` field will be overwritten with the new value. If
            false, the new value will be merged with the existing value. Default
            is false.
    ContactDetailReadPublic:
      type: object
      properties:
        first_name:
          type: string
          nullable: true
          maxLength: 100
        last_name:
          type: string
          nullable: true
          maxLength: 100
        email:
          type: string
          format: email
          nullable: true
          maxLength: 254
        meta:
          type: object
          additionalProperties: {}
        external_url:
          type: string
          format: uri
          nullable: true
          maxLength: 200
        canonical_phone:
          type: string
          maxLength: 30
        created_by:
          type: integer
          readOnly: true
          description: User ID of the user who created the contact
        phone:
          type: string
          description: Phone number of the contact
        id:
          type: string
          description: UUID representing the contact ID
        created_on:
          type: string
          format: date-time
          title: Creado el
        last_updated_on:
          type: string
          format: date-time
          readOnly: true
          title: Última actualización el
        source:
          type: string
          maxLength: 255
        tags:
          type: array
          items:
            $ref: '#/components/schemas/ContactTag'
          description: Tags associated with the contact
        default_assignees:
          type: array
          items:
            $ref: '#/components/schemas/AccountMemberUserBasicRead'
          description: ID of the default assignees for the contact
        inbox_contacts:
          type: array
          items:
            $ref: '#/components/schemas/InboxContactURL'
          description: URL of the inbox conversation associated with the contact
        default_conversation_url:
          type: string
          readOnly: true
      required:
        - canonical_phone
        - created_by
        - default_assignees
        - default_conversation_url
        - id
        - inbox_contacts
        - last_updated_on
        - phone
        - source
        - tags
    ContactTag:
      type: object
      properties:
        id:
          type: integer
          readOnly: true
        name:
          type: string
          maxLength: 100
      required:
        - id
        - name
    AccountMemberUserBasicRead:
      type: object
      properties:
        id:
          type: integer
        first_name:
          type: string
          readOnly: true
        last_name:
          type: string
          readOnly: true
        email:
          type: string
          format: email
          readOnly: true
          title: Email address
        account:
          type: integer
          readOnly: true
        profile_image:
          type: string
          format: uri
          readOnly: true
        date_joined:
          type: string
          format: date-time
          readOnly: true
      required:
        - account
        - date_joined
        - email
        - first_name
        - id
        - last_name
        - profile_image
    InboxContactURL:
      type: object
      properties:
        id:
          type: string
          format: uuid
        url:
          type: string
          readOnly: true
        channel:
          type: integer
      required:
        - channel
        - url
  securitySchemes:
    tokenAuth:
      type: apiKey
      in: header
      name: Authorization
      description: Token-based authentication with required prefix "Token"

````