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

# Update a Contact

> Changes only the fields you send. Attributes are merged. Fires the contact updated workflows.



## OpenAPI

````yaml PATCH /api/pub/crm/contacts/{id}
openapi: 3.1.0
info:
  title: AdsEra REST API
  description: >-
    Welcome to the AdsEra REST API. Use our API to integrate powerful,
    multi-channel communication (Email and WhatsApp) directly into your
    applications. Automate transactional messages, trigger marketing campaigns,
    manage your audience, and track performance programmatically.
  contact:
    name: Shubham
    email: shubham@adsera.in
  version: 1.0.0
servers:
  - url: https://app.adsera.in
    description: Production Server
security:
  - AppIdAuth: []
    AppSecretAuth: []
paths:
  /api/pub/crm/contacts/{id}:
    patch:
      tags:
        - 'CRM: Contacts'
      summary: Update a Contact
      description: >-
        Changes only the fields you send. Attributes are merged. Fires the
        contact updated workflows.
      operationId: crmUpdateContact
      parameters:
        - name: id
          in: path
          required: true
          description: Contact id.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CrmContactPatch'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    $ref: '#/components/schemas/CrmContact'
        '400':
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CrmError'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CrmError'
        '409':
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CrmError'
        '429':
          description: >-
            Rate limit: 120 requests a minute per app. See the Retry-After
            header.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CrmError'
components:
  schemas:
    CrmContactPatch:
      type: object
      properties:
        email:
          type: string
          format: email
        attributes:
          type: object
          additionalProperties: true
          example:
            CITY: Pune
        subscription:
          type: object
          properties:
            whatsapp:
              type: boolean
            email:
              type: boolean
            sms:
              type: boolean
        assignTo:
          type: string
          format: email
          nullable: true
          description: Email of a user in your workspace; `null` unassigns.
    CrmContact:
      type: object
      properties:
        _id:
          type: string
          example: 6650f1c2a1b2c3d4e5f60718
        phone:
          type: string
          example: '919876543210'
        email:
          type: string
          example: priya@example.com
        attributes:
          type: object
          additionalProperties: true
          example:
            FIRSTNAME: Priya
            CITY: Jaipur
          description: Custom fields by title.
        labels:
          type: array
          items:
            type: object
            properties:
              _id:
                type: string
                example: 6650f1c2a1b2c3d4e5f60718
              title:
                type: string
        lists:
          type: array
          items:
            type: object
            properties:
              _id:
                type: string
                example: 6650f1c2a1b2c3d4e5f60718
              name:
                type: string
        subscription:
          type: object
          properties:
            whatsapp:
              type: boolean
            email:
              type: boolean
            sms:
              type: boolean
        assignTo:
          type: object
          nullable: true
          properties:
            _id:
              type: string
              example: 6650f1c2a1b2c3d4e5f60718
            firstName:
              type: string
            lastName:
              type: string
            email:
              type: string
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    CrmError:
      type: object
      properties:
        success:
          type: boolean
          example: false
        error:
          type: string
          example: Contact not found
    ErrorResponse:
      type: object
      properties:
        status:
          type: integer
          example: 500
        success:
          type: boolean
          example: false
        error:
          type: string
          example: Internal Server Error!
  responses:
    Unauthorized:
      description: Unauthorized. The API keys are missing or invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            status: 401
            success: false
            error: 'Unauthorized: Please provide valid API credentials.'
  securitySchemes:
    AppIdAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: Your application's unique ID.
    AppSecretAuth:
      type: apiKey
      in: header
      name: x-api-secret
      description: Your application's secret key.

````

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