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

# Update contact

> Updates an existing contact's information.

**🎯 Key Features:**
- Partial updates supported
- Add/remove lists and tags
- Update custom fields
- Change email address




## OpenAPI

````yaml put /contact/{identifier}
openapi: 3.1.0
info:
  title: SendX REST API
  version: 1.0.0
  description: >
    # SendX REST API Documentation


    ## 🚀 Introduction


    The SendX API is organized around REST principles. Our API has predictable
    resource-oriented URLs, accepts JSON-encoded request bodies, returns
    JSON-encoded responses, and uses standard HTTP response codes,
    authentication, and verbs.


    **Key Features:**

    - 🔒 **Security**: Team-based authentication with optional member-level
    access

    - 🎯 **Resource-Oriented**: RESTful design with clear resource boundaries

    - 📊 **Rich Data Models**: Three-layer model system (Input/Output/Internal)

    - 🔗 **Relationships**: Automatic prefix handling for resource relationships

    - 📈 **Scalable**: Built for high-volume email marketing operations


    ## 🏗️ Architecture Overview


    SendX uses a three-layer model architecture:


    1. **Input Models** (`RestE*`): For API requests

    2. **Output Models** (`RestR*`): For API responses with prefixed IDs

    3. **Internal Models**: Core business logic (not exposed in API)


    ## 🔐 Security & Authentication


    SendX uses API key authentication:


    ### Team API Key

    ```http

    X-Team-ApiKey: YOUR_TEAM_API_KEY

    ```

    - **Required for all requests**

    - Team-level access to resources

    - Available in SendX Settings → Team API Key


    ## 🆔 Encrypted ID System


    SendX uses encrypted IDs for security and better developer experience:


    - **Internal IDs**: Sequential integers (not exposed)

    - **Encrypted IDs**: 22-character alphanumeric strings

    - **Prefixed IDs**: Resource-type prefixes in API responses
    (`contact_<22-char-id>`)


    ### ID Format


    **All resource IDs follow this pattern:**

    ```

    <resource_prefix>_<22_character_alphanumeric_string>

    ```


    **Example:**

    ```json

    {
      "id": "contact_BnKjkbBBS500CoBCP0oChQ",
      "lists": ["list_OcuxJHdiAvujmwQVJfd3ss", "list_0tOFLp5RgV7s3LNiHrjGYs"],
      "tags": ["tag_UhsDkjL772Qbj5lWtT62VK", "tag_fL7t9lsnZ9swvx2HrtQ9wM"]
    }

    ```


    ## 📚 Resource Prefixes


    | Resource | Prefix | Example |

    |----------|--------|---------|

    | Contact | `contact_` | `contact_BnKjkbBBS500CoBCP0oChQ` |

    | Campaign | `campaign_` | `campaign_LUE9BTxmksSmqHWbh96zsn` |

    | List | `list_` | `list_OcuxJHdiAvujmwQVJfd3ss` |

    | Tag | `tag_` | `tag_UhsDkjL772Qbj5lWtT62VK` |

    | Sender | `sender_` | `sender_4vK3WFhMgvOwUNyaL4QxCD` |

    | Template | `template_` | `template_f3lJvTEhSjKGVb5Lwc5SWS` |

    | Custom Field | `custom_field_` | `field_MnuqBAG2NPLm7PZMWbjQxt` |

    | Webhook | `webhook_` | `webhook_9l154iiXlZoPo7vngmamee` |

    | Post | `post_` | `post_XyZ123aBc456DeF789GhI` |

    | Post Category | `post_category_` | `post_category_YzS1wOU20yw87UUHKxMzwn`
    |

    | Post Tag | `post_tag_` | `post_tag_123XyZ456AbC` |

    | Member | `member_` | `member_JkL012MnO345PqR678` |

    | Domain | `domain_` | `domain_504` |


    ## 🎯 Best Practices


    ### Error Handling

    - **Always check status codes**: 2xx = success, 4xx = client error, 5xx =
    server error

    - **Read error messages**: Descriptive messages help debug issues

    - **Handle rate limits**: Respect API rate limits for optimal performance


    ### Data Validation

    - **Email format**: Must be valid email addresses

    - **Required fields**: Check documentation for mandatory fields

    - **Field lengths**: Respect maximum length constraints


    ### Performance

    - **Pagination**: Use offset/limit for large datasets

    - **Batch operations**: Process multiple items when supported

    - **Caching**: Cache responses when appropriate


    ## 🛠️ SDKs & Integration


    Official SDKs available for:

    - [Golang](https://github.com/sendx/sendx-go-sdk)

    - [Python](https://github.com/sendx/sendx-python-sdk)

    - [Ruby](https://github.com/sendx/sendx-ruby-sdk)

    - [Java](https://github.com/sendx/sendx-java-sdk)

    - [PHP](https://github.com/sendx/sendx-php-sdk)

    - [JavaScript](https://github.com/sendx/sendx-javascript-sdk)


    ## 📞 Support


    Need help? Contact us:

    - 💬 **Website Chat**: Available on sendx.io

    - 📧 **Email**: hello@sendx.io

    - 📚 **Documentation**: Full guides at help.sendx.io


    ---


    **API Endpoint:** `https://api.sendx.io/api/v1/rest`


    [<img src="https://run.pstmn.io/button.svg" alt="Run In Postman"
    style="width: 128px; height:
    32px;">](https://god.gw.postman.com/run-collection/33476323-44b198b0-5219-4619-a01f-cfc24d573885?action=collection%2Ffork&source=rip_markdown&collection-url=entityId%3D33476323-44b198b0-5219-4619-a01f-cfc24d573885%26entityType%3Dcollection%26workspaceId%3D6b1e4f65-96a9-4136-9512-6266c852517e)
  contact:
    name: SendX API Support
    email: hello@sendx.io
    url: https://sendx.io
  license:
    name: Proprietary
    url: https://sendx.io/terms
servers:
  - url: https://api.sendx.io/api/v1/rest
    description: Production server
security:
  - TeamApiKey: []
tags:
  - name: Contact
    description: >
      **Contact Management**


      Contacts are the core of your SendX account. They represent your
      customers, leads, or any person you wish to communicate with through
      marketing campaigns.


      **Key Features:**

      - ✅ Create, read, update, and delete contacts

      - 🏷️ Associate with lists and tags

      - 📝 Store custom field data

      - 📊 Track engagement metrics

      - 🔒 Team-based access control


      **Business Rules:**

      - Email addresses must be unique within a team

      - Custom fields are created automatically if they don't exist

      - Tags are created automatically when assigned

      - Soft deletes preserve historical data
  - name: Campaign
    description: >
      **Campaign Management**


      Campaigns allow you to send targeted email marketing messages to your
      contacts.


      **Key Features:**

      - 📧 Create and manage email campaigns

      - 🎯 Target specific lists and segments

      - 📊 Track campaign performance

      - ⏰ Schedule campaigns for future delivery

      - 🔄 A/B testing support
  - name: List
    description: |
      **List Management**

      Lists help you organize contacts into groups for targeted messaging.

      **Key Features:**
      - 📁 Create and manage contact lists
      - 👥 Bulk operations on list members
      - 🔗 Associate with campaigns
      - 📊 Track list growth metrics
  - name: Tag
    description: |
      **Tag Management**

      Tags provide flexible contact categorization for advanced segmentation.

      **Key Features:**
      - 🏷️ Create and manage tags
      - 🔍 Advanced contact filtering
      - 🎯 Behavior-based tagging
      - 📊 Tag-based analytics
  - name: Sender
    description: |
      **Sender Management**

      Manage verified sender addresses for your campaigns.

      **Key Features:**
      - ✉️ Add and verify sender addresses
      - 🔐 Domain authentication
      - 📧 Default sender settings
  - name: Template
    description: |
      **Email Template Management**

      Create and manage reusable email templates for campaigns.

      **Key Features:**
      - 🎨 HTML and text templates
      - 🔄 Reusable across campaigns
      - 📱 Mobile-responsive designs
      - 🏷️ Personalization support
  - name: Custom Field
    description: |
      **Custom Field Management**

      Define custom data fields for storing additional contact information.

      **Key Features:**
      - 📝 Create custom data fields
      - 🔢 Support for various data types
      - 📊 Use in segmentation
      - 🔄 Bulk updates
  - name: Webhook
    description: |
      **Webhook Management**

      Configure webhooks to receive real-time event notifications.

      **Key Features:**
      - 🔔 Real-time event notifications
      - 🎯 Event filtering
      - 🔒 Secure payload delivery
      - 📊 Delivery status tracking
  - name: Email Sending
    description: |
      **Email Sending APIs**

      Send transactional and marketing emails programmatically.

      **Key Features:**
      - 📧 Send individual emails
      - 🎨 Template-based sending
      - 📎 Attachment support
      - 🔄 Personalization variables
  - name: Events
    description: |
      **Event Tracking**

      Track custom events and revenue data for advanced analytics.

      **Key Features:**
      - 📊 Custom event tracking
      - 💰 Revenue attribution
      - 🔗 Integration with analytics
      - 📈 Conversion tracking
  - name: Tracking
    description: |
      **Contact Tracking APIs**

      Legacy tracking endpoints for backward compatibility.

      **Key Features:**
      - 👤 Identify contacts
      - 🏷️ Track contact behavior
      - 📊 Update contact properties
      - ⚠️ Consider using newer endpoints
  - name: Report
    description: |
      **Reporting APIs**

      Access detailed reports and analytics data.

      **Key Features:**
      - 📊 Campaign performance metrics
      - 📈 Engagement analytics
      - 💰 Revenue reports
      - 📉 Trend analysis
  - name: Post
    description: |
      **Blog Post Management**

      Manage blog posts and content for your marketing efforts.

      **Key Features:**
      - 📝 Create and manage posts
      - 🏷️ Categorize with tags
      - 📁 Organize by categories
      - 🔍 SEO optimization
  - name: Post Category
    description: |
      **Post Category Management**

      Organize blog posts into categories.

      **Key Features:**
      - 📁 Create categories
      - 🔗 Associate posts
      - 📊 Category analytics
  - name: Post Tag
    description: |
      **Post Tag Management**

      Tag blog posts for better organization and discovery.

      **Key Features:**
      - 🏷️ Create post tags
      - 🔍 Improve discoverability
      - 📊 Tag-based filtering
  - name: Team Member
    description: |
      **Team Member Information**

      Access team member details (read-only).

      **Key Features:**
      - 👤 View member profiles
      - 📧 Access member information
      - 🔒 Read-only access
paths:
  /contact/{identifier}:
    put:
      tags:
        - Contact
      summary: Update contact
      description: |
        Updates an existing contact's information.

        **🎯 Key Features:**
        - Partial updates supported
        - Add/remove lists and tags
        - Update custom fields
        - Change email address
      operationId: updateContact
      parameters:
        - $ref: '#/components/parameters/identifier'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RestEContact'
            examples:
              name_update:
                summary: 📝 Update Name Information
                description: Simple name and company update
                value:
                  firstName: Alexander
                  lastName: Johnson-Smith
                  company: New Enterprise Corp
              email_change:
                summary: ✉️ Change Email Address
                description: Update email address (must be unique)
                value:
                  email: alexander.johnson@newcompany.com
                  company: New Company Inc
              add_custom_fields:
                summary: 📊 Add Custom Field Data
                description: Add or update custom field information
                value:
                  customFields:
                    field_QqfhckbdcvQinLPlduIbHq: '92'
                    field_rMMSPH9VCIN4NP4CHUyFGH: '2024-01-20'
                    field_MnuqBAG2NPLm7PZMWbjQxt: High-value prospect, follow up Q2
              relationship_update:
                summary: 🏷️ Update Lists and Tags
                description: Change list and tag associations
                value:
                  lists:
                    - list_0tOFLp5RgV7s3LNiHrjGYs
                    - list_vUCjsUmrVXtSppS8rD0Ssq
                  tags:
                    - tag_6GN4DNyrHNt4KktCNG8PDO
                    - tag_UhsDkjL772Qbj5lWtT62VK
                    - tag_UhsDkjL772Qbj5lWtT62VK
              complete_update:
                summary: 🎯 Complete Profile Update
                description: Update multiple aspects of the contact
                value:
                  firstName: Alex
                  lastName: Johnson
                  company: Enterprise Solutions LLC
                  customFields:
                    field_MnuqBAG2NPLm7PZMWbjQxt: CTO Office
                    field_rMMSPH9VCIN4NP4CHUyFGH: $100000
                    field_QqfhckbdcvQinLPlduIbHq: 'true'
                  lists:
                    - list_OcuxJHdiAvujmwQVJfd3ss
                    - list_0tOFLp5RgV7s3LNiHrjGYs
                  tags:
                    - tag_fL7t9lsnZ9swvx2HrtQ9wM
                    - tag_UhsDkjL772Qbj5lWtT62VK
                    - tag_high_budget
                  lastTrackedIp: 203.0.113.150
      responses:
        '200':
          description: ✅ Contact updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RestRContact'
              examples:
                updated_contact:
                  summary: Successfully updated contact
                  value:
                    id: contact_BnKjkbBBS500CoBCP0oChQ
                    firstName: Alex
                    lastName: Johnson
                    email: alex.johnson@enterprise.com
                    company: Enterprise Solutions LLC
                    customFields:
                      field_MnuqBAG2NPLm7PZMWbjQxt: CTO Office
                      field_QqfhckbdcvQinLPlduIbHq: Senior Developer
                      field_rMMSPH9VCIN4NP4CHUyFGH: $100000
                      field_LqfhckbdcvQinLPlduIbHq: 'true'
                    lists:
                      - list_OcuxJHdiAvujmwQVJfd3ss
                      - list_0tOFLp5RgV7s3LNiHrjGYs
                    tags:
                      - tag_fL7t9lsnZ9swvx2HrtQ9wM
                      - tag_UhsDkjL772Qbj5lWtT62VK
                      - tag_LesDkjL772Qbj5lWtT62VK
                    unsubscribed: false
                    bounced: false
                    spam: false
                    blocked: false
                    dropped: false
                    created: '2024-01-05T08:30:00Z'
                    updated: '2024-01-21T10:15:00Z'
                    trackData: utm_source=google&utm_campaign=enterprise
                    contactSource: 1
                    pageSource: https://enterprise.com/signup
                    lastTrackedIp: 203.0.113.150
                    ltv: 7500
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - TeamApiKey: []
components:
  parameters:
    identifier:
      name: identifier
      in: path
      required: true
      description: |
        Resource identifier with prefix (e.g., `contact_BnKjkbBBS500CoBCP0oChQ`)

        **Format:** `<prefix>_<22-character-id>`
      schema:
        type: string
        pattern: ^[a-z_]+_[a-zA-Z0-9]{22}$
        example: contact_BnKjkbBBS500CoBCP0oChQ
  schemas:
    RestEContact:
      type: object
      required:
        - email
      properties:
        firstName:
          type: string
          maxLength: 255
          description: First name of the contact
          example: John
        lastName:
          type: string
          maxLength: 255
          description: Last name of the contact
          example: Doe
        email:
          type: string
          format: email
          maxLength: 255
          description: >
            Email address of the contact (required and must be unique within
            team).


            **Validation:**

            - Must be a valid email format

            - Must be unique within the team

            - Cannot be empty or null
          example: john.doe@example.com
        company:
          type: string
          maxLength: 255
          description: Company name of the contact
          example: Example Corp
        customFields:
          type: object
          additionalProperties:
            type: string
          description: >
            Custom fields as key-value pairs. Keys should use `custom_field_`
            prefix.


            **Processing:**

            - Keys are case-sensitive

            - Values are stored as strings


            **Examples:**

            - `"field_MnuqBAG2NPLm7PZMWbjQxt": "Engineering"` → stored as
            `department: Engineering`
          example:
            field_MnuqBAG2NPLm7PZMWbjQxt: Engineering
            field_QqfhckbdcvQinLPlduIbHq: Senior
        lists:
          type: array
          items:
            type: string
            pattern: ^(list_)?[a-zA-Z0-9]{22}$
          description: |
            Array of list identifiers to associate with the contact. 
            Identifiers should use `list_` prefix.

            **Processing:**
            - Invalid list IDs will send our 400 error
            - Duplicates will be removed

            **Examples:**
            - `"list_OcuxJHdiAvujmwQVJfd3ss"` → valid prefixed format
          example:
            - list_OcuxJHdiAvujmwQVJfd3ss
        tags:
          type: array
          items:
            type: string
            pattern: ^(tag_)?[a-zA-Z0-9]{22}$
          description: |
            Array of tag identifiers to associate with the contact.
            Identifiers should use `tag_` prefix.

            **Processing:**
            - Invalid tag IDs will be ignored
            - Duplicates will be removed

            **Examples:**
            - `"tag_UhsDkjL772Qbj5lWtT62VK"` → valid prefixed format
          example:
            - tag_UhsDkjL772Qbj5lWtT62VK
        lastTrackedIp:
          type: string
          format: ipv4
          description: |
            Last tracked IP address of the contact for analytics purposes.

            **Usage:**
            - Used for geographic analytics
            - Helps with spam detection
            - Optional field
          example: 192.168.1.100
    RestRContact:
      type: object
      properties:
        id:
          type: string
          pattern: ^contact_[a-zA-Z0-9]{22}$
          description: |
            Unique contact identifier with contact_ prefix.

            **Format:** `contact_` + 22 alphanumeric characters

            **Usage:**
            - Use this ID for all subsequent API calls
            - Unique across the entire SendX platform
            - Never changes once created
          example: contact_BnKjkbBBS500CoBCP0oChQ
        firstName:
          type: string
          nullable: true
          description: First name of the contact
          example: John
        lastName:
          type: string
          nullable: true
          description: Last name of the contact
          example: Doe
        email:
          type: string
          format: email
          description: Email address of the contact (unique within team)
          example: john.doe@example.com
        company:
          type: string
          nullable: true
          description: Company name of the contact
          example: Example Corp
        customFields:
          type: object
          additionalProperties:
            type: string
          description: |
            Custom fields with custom_field_ prefixed keys.

            **Format:** All keys have `custom_field_` prefix in responses

            **Example Structure:**
            ```json
            {
              "field_MnuqBAG2NPLm7PZMWbjQxt": "Engineering",
              "field_QqfhckbdcvQinLPlduIbHq": "Senior",
              "field_MnuqBAG2NPLm7PZMWbjQxt": "$75000"
            }
            ```
          example:
            field_MnuqBAG2NPLm7PZMWbjQxt: Engineering
            field_QqfhckbdcvQinLPlduIbHq: Senior
        lists:
          type: array
          items:
            type: string
            pattern: ^list_[a-zA-Z0-9]{22}$
          description: |
            Associated lists with list_ prefixed identifiers.

            **Format:** All IDs have `list_` prefix in responses
          example:
            - list_OcuxJHdiAvujmwQVJfd3ss
            - list_xyz789ghi012
        tags:
          type: array
          items:
            type: string
            pattern: ^tag_[a-zA-Z0-9]{22}$
          description: |
            Associated tags with tag_ prefixed identifiers.

            **Format:** All IDs have `tag_` prefix in responses
          example:
            - tag_UhsDkjL772Qbj5lWtT62VK
            - tag_UhsDkjL772Qbj5lWtT62VK
        unsubscribed:
          type: boolean
          description: Whether the contact has unsubscribed from emails
          example: false
        bounced:
          type: boolean
          description: Whether emails to this contact have bounced
          example: false
        spam:
          type: boolean
          description: Whether the contact has marked emails as spam
          example: false
        blocked:
          type: boolean
          description: Whether the contact is blocked from receiving emails
          example: false
        dropped:
          type: boolean
          description: Whether emails to this contact have been dropped
          example: false
        created:
          type: string
          format: date-time
          description: Contact creation timestamp (ISO 8601 format)
          example: '2024-01-10T14:20:00Z'
        updated:
          type: string
          format: date-time
          description: Contact last update timestamp (ISO 8601 format)
          example: '2024-01-15T09:15:00Z'
        trackData:
          type: string
          description: |
            Email tracking data and UTM parameters.

            **Contains:**
            - UTM parameters from campaigns
            - Attribution data
            - Custom tracking parameters
          example: utm_source=website&utm_campaign=signup&utm_medium=banner
        contactSource:
          type: integer
          description: |
            Source type of the contact creation.

            **Values:**
            - `1` - API/Manual
            - `2` - Import
            - `3` - Form
            - `4` - Integration
          example: 1
        pageSource:
          type: string
          nullable: true
          description: URL of the page where contact was created
          example: https://example.com/signup?ref=google-ads
        lastTrackedIp:
          type: string
          format: ipv4
          nullable: true
          description: Last tracked IP address of the contact
          example: 203.0.113.42
        LTV:
          type: integer
          description: |
            Lifetime Value of the contact in cents.

            **Example:** 7500 = $75.00
          example: 7500
    ErrorResponse:
      type: object
      properties:
        status:
          type: string
          enum:
            - error
          example: error
        message:
          type: string
          description: Human-readable error message
          example: Invalid request format
      required:
        - status
        - message
  responses:
    BadRequest:
      description: ❌ Bad Request - Invalid input data
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            invalid_id:
              summary: Invalid ID format
              value:
                status: error
                message: Invalid identifier format
            missing_field:
              summary: Missing required field
              value:
                status: error
                message: Email is required
    Unauthorized:
      description: ❌ Unauthorized - Invalid or missing API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            status: 401
            message: The Team ID or API Key specified is not valid
    NotFound:
      description: ❌ Not Found - Resource does not exist
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            status: error
            message: Resource not found
    Conflict:
      description: ❌ Conflict - Resource already exists
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            status: error
            message: Email already exists
    UnprocessableEntity:
      description: ❌ Unprocessable Entity - Invalid request format
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            status: error
            message: Request body is not in proper format
    InternalServerError:
      description: ❌ Internal Server Error - System error occurred
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            status: error
            message: Internal server error occurred
  securitySchemes:
    TeamApiKey:
      type: apiKey
      in: header
      name: X-Team-ApiKey
      description: >
        Team API key for authentication. Find your API key in SendX Settings →
        Team API Key.


        **Example:**

        ```

        X-Team-ApiKey: your_team_api_key_here

        ```

````