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

# Actualizar contacto

> Actualiza uno o más campos de un contacto existente.

Actualiza únicamente los campos incluidos en el body. Los demás valores permanecen sin cambios.

## Endpoint

```text theme={null}
PATCH /contacts/{contactId}
```

## Parámetros de ruta

| Parámetro   | Tipo     | Requerido | Descripción      |
| ----------- | -------- | --------- | ---------------- |
| `contactId` | `string` | Sí        | ID del contacto. |

## Body

Envía al menos uno de los campos editables configurados para tu cuenta. Cada valor debe respetar el tipo y las reglas del campo.

## Ejemplo de solicitud

```bash theme={null}
curl -X PATCH "https://api.insuranceboosters.com/api/v1/contacts/{contactId}" \
  -H "Content-Type: application/json" \
  -H "x-ib-api-key: TU_API_KEY" \
  -d '{
    "email": "nuevo.correo@example.com",
    "phoneNumbers": ["+525500000001"]
  }'
```

## Respuesta exitosa (`200`)

```json theme={null}
{
  "success": true,
  "id": "<contact-id>",
  "message": "Contact updated successfully"
}
```

## Errores frecuentes

| HTTP  | Qué significa                                            | Qué hacer                                       |
| ----- | -------------------------------------------------------- | ----------------------------------------------- |
| `400` | Un campo no es editable o su valor no cumple el esquema. | Revisa el nombre, tipo y formato del campo.     |
| `401` | API key inválida o faltante.                             | Verifica `x-ib-api-key`.                        |
| `403` | El contacto no pertenece a tu cuenta.                    | Confirma que usas el ID y la API key correctos. |
| `404` | El contacto no existe o fue eliminado.                   | Confirma `contactId`.                           |
| `500` | No fue posible actualizar el contacto.                   | Reintenta; si continúa, contacta soporte.       |


## OpenAPI

````yaml openapi/contactos-v1.yaml PATCH /contacts/{contactId}
openapi: 3.1.0
info:
  title: Insurance Boosters API — Contactos
  version: 1.0.0
  description: >-
    API pública para consultar el esquema y crear, listar, buscar, actualizar o
    eliminar contactos.
  license:
    name: Propietaria
    url: https://insuranceboosters.com
servers:
  - url: https://api.insuranceboosters.com/api/v1
    description: Producción
security:
  - IbApiKey: []
tags:
  - name: Contactos
    description: Administración de contactos.
paths:
  /contacts/{contactId}:
    parameters:
      - $ref: '#/components/parameters/ContactId'
    patch:
      tags:
        - Contactos
      summary: Actualizar contacto
      operationId: updateContact
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ContactInput'
            example:
              email: nuevo.correo@example.com
              phoneNumbers:
                - '+525500000001'
      responses:
        '200':
          description: Contacto actualizado.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MutationResponse'
              example:
                success: true
                id: <contact-id>
                message: Contact updated successfully
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  parameters:
    ContactId:
      name: contactId
      in: path
      required: true
      description: ID del contacto.
      schema:
        type: string
  schemas:
    ContactInput:
      type: object
      description: Campos editables configurados para tu cuenta.
      additionalProperties: true
      properties:
        firstName:
          type: string
          minLength: 1
          maxLength: 100
          description: Nombre.
        lastName1:
          type: string
          minLength: 1
          maxLength: 100
          description: Primer apellido.
        lastName2:
          type: string
          maxLength: 100
          description: Segundo apellido.
        email:
          type: string
          format: email
          description: Correo electrónico.
        phoneNumbers:
          type: array
          description: Teléfonos del contacto.
          items:
            type: string
    MutationResponse:
      type: object
      required:
        - success
        - id
        - message
      properties:
        success:
          type: boolean
          const: true
        id:
          type: string
        message:
          type: string
    Error:
      type: object
      properties:
        error:
          type: string
        message:
          type: string
  responses:
    BadRequest:
      description: La solicitud no cumple el esquema de contactos.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: API key inválida o faltante.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: La integración no tiene acceso al contacto.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: El contacto no existe o fue eliminado.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    InternalError:
      description: Error inesperado.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    IbApiKey:
      type: apiKey
      in: header
      name: x-ib-api-key

````