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

# Update Contact

> Update an existing contact

# Update Contact

This endpoint allows you to update an existing contact's information.

## Headers

| Parameter    | Type   | Description                  |
| ------------ | ------ | ---------------------------- |
| X-API-KEY    | string | Formation API Key (required) |
| Content-Type | string | application/json             |

## Path Parameters

| Parameter   | Type   | Description           |
| ----------- | ------ | --------------------- |
| contact\_id | string | Contact ID (required) |

## Request Body

```json theme={null}
{
  "type": "customer",
  "status": "active",
  "full_name": "John Doe Updated",
  "email": "john.doe.updated@example.com",
  "description": "Updated customer contact",
  "cc_emails": ["billing@example.com", "support@example.com"],
  "bcc_emails": ["admin@example.com"],
  "billing": {
    "email": "billing.updated@example.com",
    "phone": "+1234567890",
    "phone_code": "+1",
    "iso_code": "US",
    "country": "United States",
    "address_1": "456 Updated St",
    "address_2": "Suite 200",
    "postal_code": "54321",
    "district": "Uptown",
    "state": "NY",
    "province": "New York",
    "tax_id": "98-7654321"
  },
  "company_id": "64b8f1a2e4b0c8d9f0123456"
}
```

### Required Fields

| Field       | Type   | Description                               |
| ----------- | ------ | ----------------------------------------- |
| type        | string | Contact type: "customer" or "vendor"      |
| full\_name  | string | Full name of the contact                  |
| email       | string | Email address of the contact              |
| company\_id | string | ID of the company this contact belongs to |

### Optional Fields

| Field       | Type   | Description                            |
| ----------- | ------ | -------------------------------------- |
| status      | string | Contact status                         |
| description | string | Description or notes about the contact |
| cc\_emails  | array  | Array of CC email addresses            |
| bcc\_emails | array  | Array of BCC email addresses           |
| billing     | object | Billing information for the contact    |

### Billing Object Fields

| Field        | Type   | Description               |
| ------------ | ------ | ------------------------- |
| email        | string | Billing email address     |
| phone        | string | Phone number              |
| phone\_code  | string | Phone country code        |
| iso\_code    | string | Country ISO code          |
| country      | string | Country name              |
| address\_1   | string | Address line 1            |
| address\_2   | string | Address line 2            |
| postal\_code | string | Postal code               |
| district     | string | District                  |
| state        | string | State                     |
| province     | string | Province                  |
| tax\_id      | string | Tax identification number |

## Response

```json theme={null}
{
  "success": true,
  "message": "Contact updated successfully",
  "data": {
    "id": "64b8f1a2e4b0c8d9f0123456",
    "created_at": 1686787200,
    "updated_at": 1686787300,
    "type": "customer",
    "status": "active",
    "full_name": "John Doe Updated",
    "email": "john.doe.updated@example.com",
    "description": "Updated customer contact",
    "cc_emails": ["billing@example.com", "support@example.com"],
    "bcc_emails": ["admin@example.com"],
    "billing": {
      "email": "billing.updated@example.com",
      "phone": "+1234567890",
      "phone_code": "+1",
      "iso_code": "US",
      "country": "United States",
      "address_1": "456 Updated St",
      "address_2": "Suite 200",
      "postal_code": "54321",
      "district": "Uptown",
      "state": "NY",
      "province": "New York",
      "tax_id": "98-7654321"
    }
  }
}
```

### Response Parameters

| Parameter        | Type    | Description                                |
| ---------------- | ------- | ------------------------------------------ |
| success          | boolean | Indicates if the operation was successful  |
| message          | string  | Additional information about the operation |
| data             | object  | Response data for successful requests      |
| data.id          | string  | Unique identifier for the contact          |
| data.created\_at | integer | Creation timestamp                         |
| data.updated\_at | integer | Last update timestamp                      |
| data.type        | string  | Contact type ("customer" or "vendor")      |
| data.status      | string  | Contact status                             |
| data.full\_name  | string  | Full name of the contact                   |
| data.email       | string  | Email address                              |
| data.description | string  | Contact description                        |
| data.cc\_emails  | array   | CC email addresses                         |
| data.bcc\_emails | array   | BCC email addresses                        |
| data.billing     | object  | Billing information                        |

## Error Responses

### Invalid Request (400)

```json theme={null}
{
  "success": false,
  "message": "Invalid request data",
  "error": {
    "code": "VALIDATION_FAILED",
    "details": "Field 'email' is required"
  }
}
```

### Unauthorized (401)

```json theme={null}
{
  "success": false,
  "message": "API key is required",
  "error": {
    "code": "API_KEY_REQUIRED"
  }
}
```

### Contact Not Found (404)

```json theme={null}
{
  "success": false,
  "message": "Contact not found",
  "error": {
    "code": "CONTACT_NOT_FOUND"
  }
}
```

### Internal Server Error (500)

```json theme={null}
{
  "success": false,
  "message": "Internal server error",
  "error": {
    "code": "INTERNAL_ERROR"
  }
}
```


## OpenAPI

````yaml PATCH /contacts/{contact_id}
openapi: 3.0.3
info:
  title: Clemta Formation API
  description: >-
    API for company formation services. This API allows partners to create,
    retrieve, and manage company formations programmatically.
  version: '2025-06-24'
  contact:
    name: Clemta API Support
    email: tech@clemta.com
  license:
    name: Proprietary
    url: https://clemta.com/terms
servers:
  - url: https://api.clemta.com
    description: Production server
  - url: https://sandbox.clemta.com
    description: Sandbox server
security:
  - ApiKeyAuth: []
paths:
  /contacts/{contact_id}:
    patch:
      tags:
        - Contacts
      summary: Update Contact
      description: Updates an existing contact
      operationId: updateContact
      parameters:
        - name: contact_id
          in: path
          required: true
          description: Contact ID
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateContactRequest'
      responses:
        '200':
          description: Contact updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContactUpdateResponse'
        '400':
          description: Invalid request data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestError'
        '401':
          description: Unauthorized - Invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedError'
        '404':
          description: Contact not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ContactNotFoundError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerError'
components:
  schemas:
    UpdateContactRequest:
      type: object
      required:
        - type
        - full_name
        - email
        - company_id
      properties:
        type:
          type: string
          enum:
            - customer
            - vendor
          description: Contact type
        status:
          type: string
          description: Contact status
        full_name:
          type: string
          description: Full name of the contact
        email:
          type: string
          format: email
          description: Email address
        description:
          type: string
          description: Contact description
        cc_emails:
          type: array
          items:
            type: string
            format: email
          description: CC email addresses
        bcc_emails:
          type: array
          items:
            type: string
            format: email
          description: BCC email addresses
        billing:
          $ref: '#/components/schemas/ContactBilling'
        company_id:
          type: string
          description: Company ID
    ContactUpdateResponse:
      type: object
      properties:
        success:
          type: boolean
          example: true
        message:
          type: string
          example: Contact updated successfully
        data:
          $ref: '#/components/schemas/ContactResponse'
    BadRequestError:
      type: object
      properties:
        success:
          type: boolean
          example: false
        message:
          type: string
          example: Invalid request data
        data:
          type: object
          nullable: true
          example: null
        error:
          type: object
          properties:
            code:
              type: string
              example: INVALID_REQUEST
            details:
              type: string
              example: Field 'name' is required
    UnauthorizedError:
      type: object
      properties:
        success:
          type: boolean
          example: false
        message:
          type: string
          example: API key is required
        data:
          type: object
          nullable: true
          example: null
        error:
          type: object
          properties:
            code:
              type: string
              example: API_KEY_REQUIRED
            details:
              type: string
              example: ''
    ContactNotFoundError:
      type: object
      properties:
        success:
          type: boolean
          example: false
        message:
          type: string
          example: Contact not found
        data:
          type: object
          nullable: true
          example: null
        error:
          type: object
          properties:
            code:
              type: string
              example: NOT_FOUND
            details:
              type: string
              example: ''
    InternalServerError:
      type: object
      properties:
        success:
          type: boolean
          example: false
        message:
          type: string
          example: Internal server error
        data:
          type: object
          nullable: true
          example: null
        error:
          type: object
          properties:
            code:
              type: string
              example: INTERNAL_ERROR
            details:
              type: string
              example: An unexpected error occurred.
    ContactBilling:
      type: object
      properties:
        email:
          type: string
          description: Billing email address
        phone:
          type: string
          description: Phone number
        phone_code:
          type: string
          description: Phone country code
        iso_code:
          type: string
          description: Country ISO code
        country:
          type: string
          description: Country name
        address_1:
          type: string
          description: Address line 1
        address_2:
          type: string
          description: Address line 2
        postal_code:
          type: string
          description: Postal code
        district:
          type: string
          description: District
        state:
          type: string
          description: State
        province:
          type: string
          description: Province
        tax_id:
          type: string
          description: Tax ID
    ContactResponse:
      type: object
      example:
        id: 64b8f1a2e4b0c8d9f0123456
        created_at: 1640995200
        updated_at: 1640995200
        type: customer
        status: active
        full_name: John Doe
        email: john.doe@example.com
        description: Primary contact for the company
        cc_emails:
          - cc1@example.com
          - cc2@example.com
        bcc_emails:
          - bcc1@example.com
          - bcc2@example.com
        billing:
          email: billing@example.com
          phone: '1234567890'
          phone_code: '+1'
          iso_code: US
          country: United States
          address_1: 123 Main Street
          address_2: Suite 100
          postal_code: '12345'
          district: Downtown
          state: CA
          province: California
          tax_id: 12-3456789
      properties:
        id:
          type: string
          description: Contact ID
        created_at:
          type: integer
          description: Creation timestamp
        updated_at:
          type: integer
          description: Last update timestamp
        type:
          type: string
          enum:
            - customer
            - vendor
          description: Contact type
        status:
          type: string
          description: Contact status
        full_name:
          type: string
          description: Full name
        email:
          type: string
          description: Email address
        description:
          type: string
          description: Description
        cc_emails:
          type: array
          items:
            type: string
          description: CC email addresses
        bcc_emails:
          type: array
          items:
            type: string
          description: BCC email addresses
        billing:
          $ref: '#/components/schemas/ContactBilling'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: Formation API key for authentication.

````