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

# Archive contact

> DELETE /contacts/{contactId} — archive an object

## Endpoint

```http theme={null}
DELETE https://api.routera.io/contacts/{id}
```

**Route:** `/contacts/{contactId}`\
**Authentication:** Bearer JWT

**Path parameter:** `contactId` — object ID

`DELETE` archives the object. The record is kept and `archived` is set to an ISO timestamp.

## Response fields after archive

The **200** response uses default properties plus `archived_by`:

| Property | Description |
| - | - |
| `id` | Internal object ID |
| `first_name` | First name |
| `last_name` | Last name |
| `email` | User email (read-only) |
| `contact_owner` | Assigned owner email |
| `external_id` | External identifier (nullable) |
| `archived` | `false` when active; ISO timestamp when archived |
| `archived_by` | User or API client ID who archived the object (only when archived; added automatically) |

| Field | Value when archived |
| - | - |
| `archived` | ISO timestamp (no longer `false`) |
| `archived_by` | ID of the user or API client who archived the object |

> [!NOTE]
>
> `created_at` and `updated_at` are always included in every response.

## Response example

```json theme={null}
{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "external_id": "ext-001",
  "created_at": "2026-05-01T10:00:00.000Z",
  "updated_at": "2026-05-28T12:00:00.000Z",
  "archived": "2026-05-28T12:00:00.000Z",
  "first_name": "Ada",
  "last_name": "Lovelace",
  "email": "ada@example.com",
  "contact_owner": "jane@example.com",
  "archived_by": "user-uuid"
}
```

## Errors

| Status | When |
| - | - |
| `400` | Missing `contactId` in path |
| `401` | Missing account context |
| `404` | Object not found or already archived |


## OpenAPI

````yaml DELETE /contacts/{contactId}
openapi: 3.0.1
info:
  title: Routera API
  description: >-
    Routera v2 REST API. Objects CRUD for contacts, companies, deals, and
    tickets, users and routers APIs, plus router dispatch.
  version: 1.0.0
servers:
  - url: https://api.routera.io
    description: >-
      API Gateway base URL (override with ROUTERA_API_BASE_URL when generating
      docs)
security: []
tags:
  - name: Authentication
    description: Access token issuance
  - name: Contacts
    description: Contact records
  - name: Companies
    description: Company records
  - name: Deals
    description: Deal records
  - name: Tickets
    description: Ticket records
  - name: Users
    description: Account members
  - name: Routers
    description: Router configuration
  - name: Dispatch
    description: Router assignment
paths:
  /contacts/{contactId}:
    delete:
      tags:
        - Contacts
      summary: Archive contact
      operationId: deleteContact
      parameters:
        - name: contactId
          in: path
          required: true
          description: Object identifier
          schema:
            type: string
      responses:
        '200':
          description: Archived object
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Contact'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
      security:
        - bearerAuth: []
components:
  schemas:
    Contact:
      type: object
      description: >-
        Flat JSON object; custom fields at top level alongside id and
        external_id. created_at and updated_at are always present.
      properties:
        id:
          type: string
        external_id:
          type: string
          nullable: true
        first_name:
          type: string
          nullable: true
        last_name:
          type: string
          nullable: true
        email:
          type: string
          nullable: true
        contact_owner:
          type: string
          nullable: true
          description: Assigned owner email
          example: jane@example.com
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
        archived:
          description: false when active, or ISO timestamp when archived
          oneOf:
            - type: boolean
            - type: string
              format: date-time
        archived_by:
          type: string
          description: Present when archived
    ApiError:
      type: object
      required:
        - message
        - error
      properties:
        message:
          type: string
        error:
          type: boolean
          enum:
            - true
        field:
          type: string
          description: Field that caused a conflict (409 duplicate responses)
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Bearer JWT with valid account context.

````

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