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

# Archive Entity

> Archive an entity, hiding it from active browse while keeping its key reserved so the key cannot be reused. Reversible via Unarchive. Distinct from Delete, which is permanent and frees the key. Archived entities are excluded from Search Entities unless include_archived is set.



## OpenAPI

````yaml /sections/api-reference/openapi-spec-v2.yaml post /v2/entities/{id}/archive
openapi: 3.1.0
info:
  title: Serval Public API
  description: Serval Public API
  contact:
    name: Serval
    url: https://serval.com
    email: support@serval.com
  license:
    name: Serval License
    url: https://serval.com/license
  version: 2.0.0
servers:
  - url: https://public.api.serval.com
security:
  - BearerAuth: []
tags:
  - name: Access Policy API
  - name: Access Policy Approval Procedure API
  - name: Access Profile API
  - name: Access Relationship API
  - name: Access Request API
  - name: Agent API
  - name: App Instance API
  - name: App Resource API
  - name: App Resource Role API
  - name: Approval Delegation API
  - name: Approval Request API
  - name: Audit Log API
  - name: Change Blackout API
  - name: Change Model API
  - name: Custom Field API
  - name: Custom Service API
  - name: Entity API
  - name: Entity Field Mapping API
  - name: Entity Ingestion Config API
  - name: Entity Scan Action API
  - name: Entity Type API
  - name: Folder API
  - name: Group API
  - name: Guidance API
  - name: Help Agent API
  - name: Journey API
  - name: Knowledge API
  - name: Knowledge Base API
  - name: Report API
  - name: SLA API
  - name: Schedule API
  - name: Tag API
  - name: Team API
  - name: Team Group API
  - name: Team User API
  - name: Ticket API
  - name: Topic API
  - name: User API
  - name: User Relationship API
  - name: Workflow API
  - name: Workflow Approval Procedure API
  - name: Workflow Run API
paths:
  /v2/entities/{id}/archive:
    post:
      tags:
        - Entity API
      summary: Archive Entity
      description: >-
        Archive an entity, hiding it from active browse while keeping its key
        reserved so the key cannot be reused. Reversible via Unarchive. Distinct
        from Delete, which is permanent and frees the key. Archived entities are
        excluded from Search Entities unless include_archived is set.
      operationId: svrelay.publicv2.PublicAPIServiceV2.ArchiveEntity
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            title: id
            description: The ID of the entity to archive.
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/svstore.publicapi.ArchiveEntityResponse'
      security:
        - BearerAuth: []
components:
  schemas:
    svstore.publicapi.ArchiveEntityResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/svstore.Entity'
          title: data
          x-stainless-terraform-configurability: optional
      title: ArchiveEntityResponse
      additionalProperties: false
    svstore.Entity:
      type: object
      properties:
        id:
          type: string
          title: id
          description: Identity
          x-stainless-terraform-configurability: optional
        key:
          type: string
          title: key
          x-stainless-terraform-configurability: optional
        name:
          type: string
          title: name
          x-stainless-terraform-configurability: optional
        teamId:
          type: string
          title: team_id
          x-stainless-terraform-configurability: optional
        entityTypeId:
          type: string
          title: entity_type_id
          x-stainless-terraform-configurability: optional
        entityTypeKey:
          type: string
          title: entity_type_key
          x-stainless-terraform-configurability: optional
        createdByUserId:
          type: string
          title: created_by_user_id
          description: Audit
          x-stainless-terraform-configurability: optional
        updatedByUserId:
          type: string
          title: updated_by_user_id
          x-stainless-terraform-configurability: optional
        createdAt:
          $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: created_at
          x-stainless-terraform-configurability: optional
        updatedAt:
          $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: updated_at
          x-stainless-terraform-configurability: optional
        deletedAt:
          oneOf:
            - $ref: '#/components/schemas/google.protobuf.Timestamp'
            - type: 'null'
          title: deleted_at
          x-stainless-terraform-configurability: optional
        archivedAt:
          oneOf:
            - $ref: '#/components/schemas/google.protobuf.Timestamp'
            - type: 'null'
          title: archived_at
          description: >-
            Set when the entity is archived (reversible, key-reserving). The
            item still
             exists and keeps its key; it's just hidden from active browse.
          x-stainless-terraform-configurability: optional
        fieldValues:
          type: array
          items:
            $ref: '#/components/schemas/svstore.EntityFieldValue'
          title: field_values
          description: Data
          x-stainless-terraform-configurability: optional
        sourceAppInstanceIds:
          type: array
          items:
            type: string
          title: source_app_instance_ids
          x-stainless-terraform-configurability: optional
        sharedMetadata:
          oneOf:
            - $ref: '#/components/schemas/svstore.SharedEntityMetadata'
            - type: 'null'
          title: shared_metadata
          description: >-
            Populated when entity is from a shared schema (visible via org_wide
            visibility).
          x-stainless-terraform-configurability: optional
      title: Entity
      additionalProperties: false
    google.protobuf.Timestamp:
      type: string
      examples:
        - '2025-01-15T01:30:15.000Z'
        - '2025-06-01T00:00:00.000Z'
      format: date-time
      description: A timestamp in RFC 3339 format (e.g., "2025-01-15T01:30:15Z").
    svstore.EntityFieldValue:
      type: object
      properties:
        id:
          type: string
          title: id
          description: >-
            The EAV row id. NOT populated on entity read paths
            (Entity.field_values:
             search / list / get / create / update) since the v4 slim document_json
             dropped it — it has no consumer there. It IS populated on the
             listEntityFieldValueHistory RPC, which reads EAV rows directly.
          x-stainless-terraform-configurability: optional
        entityId:
          type: string
          title: entity_id
          x-stainless-terraform-configurability: optional
        fieldId:
          type: string
          title: field_id
          x-stainless-terraform-configurability: optional
        fieldKey:
          type: string
          title: field_key
          x-stainless-terraform-configurability: optional
        fieldName:
          type: string
          title: field_name
          x-stainless-terraform-configurability: optional
        dataType:
          $ref: '#/components/schemas/svstore.EntityTypeField.DataType'
          title: data_type
          x-stainless-terraform-configurability: optional
        value:
          $ref: '#/components/schemas/google.protobuf.Value'
          title: value
          description: |-
            The field value as a JSON-compatible value. Type interpretation is
             determined by data_type:
               TEXT, UNIQUE, ENUM, ENTITY_REF, USER_REF → string
               NUMBER → number
               BOOL → bool
               TIMESTAMP → string (ISO 8601, e.g. "2024-03-15T10:30:00Z")
               MULTI_SELECT → list of strings (enum option IDs)
          x-stainless-terraform-configurability: optional
        setByUserId:
          type:
            - string
            - 'null'
          title: set_by_user_id
          description: |-
            Attribution: who/what set this field value. Stored in the slim
             document_json and populated on ALL entity read paths (search / list / get
             / create / update) as well as field-value history.
          x-stainless-terraform-configurability: optional
        setByAppInstanceId:
          type:
            - string
            - 'null'
          title: set_by_app_instance_id
          x-stainless-terraform-configurability: optional
        createdAt:
          $ref: '#/components/schemas/google.protobuf.Timestamp'
          title: created_at
          description: >-
            Temporal context. NOT populated on entity read paths
            (Entity.field_values)
             since the v4 slim document_json dropped created_at — it has no consumer
             there. It IS populated on the listEntityFieldValueHistory RPC. The current
             value for a field has deleted_at unset.
          x-stainless-terraform-configurability: optional
        deletedAt:
          oneOf:
            - $ref: '#/components/schemas/google.protobuf.Timestamp'
            - type: 'null'
          title: deleted_at
          x-stainless-terraform-configurability: optional
        pinned:
          type: boolean
          title: pinned
          description: >-
            When true, ingestion cannot overwrite this user-set value. Stored in
            the
             slim document_json and populated on ALL entity read paths.
          x-stainless-terraform-configurability: computed_optional
      title: EntityFieldValue
      additionalProperties: false
      description: |-
        EntityFieldValue represents a concrete field value on a specific entity.
         Used for both current values (on Entity.field_values) and historical values
         (in field value history responses).
    svstore.SharedEntityMetadata:
      type: object
      properties:
        sourceTeamId:
          type: string
          title: source_team_id
          x-stainless-terraform-configurability: optional
        sourceTeamName:
          type: string
          title: source_team_name
          x-stainless-terraform-configurability: optional
      title: SharedEntityMetadata
      additionalProperties: false
      description: Metadata for entities shared from another team's schema.
    svstore.EntityTypeField.DataType:
      type: string
      title: DataType
      enum:
        - DATA_TYPE_UNSPECIFIED
        - TEXT
        - NUMBER
        - BOOL
        - TIMESTAMP
        - ENUM
        - ENTITY_REF
        - USER_REF
        - UNIQUE
        - MULTI_SELECT
        - FILE
    google.protobuf.Value:
      oneOf:
        - type: 'null'
        - type: number
        - type: string
        - type: boolean
        - type: array
        - type: object
          additionalProperties: true
      description: |-
        `Value` represents a dynamically typed value which can be either
         null, a number, a string, a boolean, a recursive struct value, or a
         list of values. A producer of value is expected to set one of these
         variants. Absence of any variant indicates an error.

         The JSON representation for `Value` is JSON value.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````