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

# Obtener un contacto

> Lee un contacto de Instagram por ID con su perfil completo, atributos personalizados, etiquetas asignadas y cronología paginada de actividad.

Este endpoint devuelve el registro completo de un contacto y una página de su
cronología de actividad. Usa el UUID de contacto que devuelve
[Listar contactos](/es/api/v1/contacts/list) como `contactId`.

## Acceso

Tu clave de API necesita el permiso `contacts:read_pii`. El parámetro de
consulta `account_id` debe identificar una cuenta de Instagram a la que pueda
acceder la clave, y `contactId` debe pertenecer a esa cuenta.

Este endpoint incluye información de identificación personal (PII) y está
auditado. Si la API no puede registrar la entrada de auditoría obligatoria,
falla sin devolver el contacto.

## Datos devueltos

El objeto `contact` contiene todos los campos que devuelve la lista de
contactos, incluidos `email`, `phone`, `biography`, `website`, `tags`,
`attributes`, `instagram_profile_url` y `send_instagram_dm_url`. También
contiene un objeto `timeline`.

Consulta
[Listar contactos](/es/api/v1/contacts/list#datos-devueltos) para ver todos los
grupos de campos y el significado de los enums.

El array `timeline.items` puede contener estos tipos de eventos:

* `first_contact`: levios registró la primera actividad del contacto.
* `dm_sent`: se envió un mensaje directo.
* `dm_failed`: se produjo un error al enviar un mensaje directo.
* `tag_applied`: se añadió una etiqueta al contacto.
* `attribute_captured`: se capturó un atributo del contacto.

Cada elemento de la cronología incluye `id`, `type` y `timestamp`.

## Solicitud de ejemplo

```bash theme={null}
curl --get \
  --url "https://levios.app/api/v1/contacts/${LEVIOS_CONTACT_ID}" \
  --header "Authorization: Bearer ${LEVIOS_API_KEY}" \
  --data-urlencode "account_id=${LEVIOS_ACCOUNT_ID}" \
  --data-urlencode 'timeline_limit=25'
```

## Paginación de la cronología

Configura `timeline_limit` con un valor entre 1 y 50. Cuando
`contact.timeline.next_cursor` no sea `null`, envíalo sin cambios como
`timeline_cursor` con los mismos `account_id` y `contactId`. Detente cuando el
cursor sea `null`.

Trata los cursores de la cronología como valores opacos. No reutilices un
cursor para otro contacto o cuenta.

Como esta respuesta incluye datos personales, evita escribir la carga
completa en registros, eventos de analítica o informes de errores.


## OpenAPI

````yaml openapi/v1.json GET /api/v1/contacts/{contactId}
openapi: 3.1.0
info:
  title: levios public API
  version: '1'
servers:
  - url: https://levios.app
security:
  - bearerAuth: []
paths:
  /api/v1/contacts/{contactId}:
    get:
      tags:
        - contact
      summary: Get a contact
      description: >-
        Returns one contact with profile data, attributes, tags, and a paginated
        interaction timeline.
      operationId: contacts.get
      parameters:
        - name: contactId
          in: path
          required: true
          schema:
            type: string
            format: uuid
        - name: account_id
          in: query
          required: true
          schema:
            type: string
            format: uuid
        - name: timeline_cursor
          in: query
          required: false
          schema:
            type: string
            minLength: 1
            maxLength: 2048
        - name: timeline_limit
          in: query
          required: false
          schema:
            type: string
      responses:
        '200':
          description: Successful response.
          headers:
            X-Correlation-ID:
              description: Correlation identifier for this request.
              schema:
                type: string
                pattern: ^[0-9A-HJKMNP-TV-Z]{26}$
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicContactDetailResult'
        '400':
          description: Error response.
          headers:
            X-Correlation-ID:
              description: Correlation identifier for this request.
              schema:
                type: string
                pattern: ^[0-9A-HJKMNP-TV-Z]{26}$
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    properties:
                      error:
                        type: object
                        properties:
                          code:
                            type: string
                            enum:
                              - api_invalid_content_length
                          correlation_id:
                            type: string
                          message:
                            type: string
                            enum:
                              - Invalid Content-Length.
                        required:
                          - code
                          - message
                        additionalProperties: false
                    required:
                      - error
                    additionalProperties: false
                  - type: object
                    properties:
                      error:
                        type: object
                        properties:
                          code:
                            type: string
                            enum:
                              - api_invalid_json
                          correlation_id:
                            type: string
                          message:
                            type: string
                            enum:
                              - The request body is not valid JSON.
                        required:
                          - code
                          - message
                        additionalProperties: false
                    required:
                      - error
                    additionalProperties: false
                  - type: object
                    properties:
                      error:
                        type: object
                        properties:
                          code:
                            type: string
                            enum:
                              - api_invalid_request_url
                          correlation_id:
                            type: string
                          message:
                            type: string
                            enum:
                              - The request URL is invalid.
                        required:
                          - code
                          - message
                        additionalProperties: false
                    required:
                      - error
                    additionalProperties: false
                  - type: object
                    properties:
                      error:
                        type: object
                        properties:
                          code:
                            type: string
                            enum:
                              - api_invalid_utf8
                          correlation_id:
                            type: string
                          message:
                            type: string
                            enum:
                              - The request body is not valid UTF-8.
                        required:
                          - code
                          - message
                        additionalProperties: false
                    required:
                      - error
                    additionalProperties: false
        '401':
          description: Error response.
          headers:
            X-Correlation-ID:
              description: Correlation identifier for this request.
              schema:
                type: string
                pattern: ^[0-9A-HJKMNP-TV-Z]{26}$
            WWW-Authenticate:
              description: API key Bearer challenge.
              schema:
                type: string
                enum:
                  - Bearer
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        enum:
                          - api_unauthorized
                      correlation_id:
                        type: string
                      message:
                        type: string
                        enum:
                          - Authentication required.
                    required:
                      - code
                      - message
                    additionalProperties: false
                required:
                  - error
                additionalProperties: false
        '403':
          description: Error response.
          headers:
            X-Correlation-ID:
              description: Correlation identifier for this request.
              schema:
                type: string
                pattern: ^[0-9A-HJKMNP-TV-Z]{26}$
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    properties:
                      error:
                        type: object
                        properties:
                          code:
                            type: string
                            enum:
                              - api_account_not_granted
                          correlation_id:
                            type: string
                          message:
                            type: string
                            enum:
                              - >-
                                This credential is not authorized for the
                                request.
                        required:
                          - code
                          - message
                        additionalProperties: false
                    required:
                      - error
                    additionalProperties: false
                  - type: object
                    properties:
                      error:
                        type: object
                        properties:
                          code:
                            type: string
                            enum:
                              - api_forbidden
                          correlation_id:
                            type: string
                          message:
                            type: string
                            enum:
                              - >-
                                This credential is not authorized for the
                                request.
                        required:
                          - code
                          - message
                        additionalProperties: false
                    required:
                      - error
                    additionalProperties: false
                  - type: object
                    properties:
                      error:
                        type: object
                        properties:
                          code:
                            type: string
                            enum:
                              - api_scope_denied
                          correlation_id:
                            type: string
                          message:
                            type: string
                            enum:
                              - >-
                                This credential is not authorized for the
                                request.
                        required:
                          - code
                          - message
                        additionalProperties: false
                    required:
                      - error
                    additionalProperties: false
        '404':
          description: Error response.
          headers:
            X-Correlation-ID:
              description: Correlation identifier for this request.
              schema:
                type: string
                pattern: ^[0-9A-HJKMNP-TV-Z]{26}$
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        enum:
                          - api_contact_not_found
                      correlation_id:
                        type: string
                      message:
                        type: string
                        enum:
                          - The requested contact was not found.
                    required:
                      - code
                      - message
                    additionalProperties: false
                required:
                  - error
                additionalProperties: false
        '413':
          description: Error response.
          headers:
            X-Correlation-ID:
              description: Correlation identifier for this request.
              schema:
                type: string
                pattern: ^[0-9A-HJKMNP-TV-Z]{26}$
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    properties:
                      error:
                        type: object
                        properties:
                          code:
                            type: string
                            enum:
                              - api_body_too_large
                          correlation_id:
                            type: string
                          message:
                            type: string
                            enum:
                              - The JSON request body exceeds 1 MiB.
                        required:
                          - code
                          - message
                        additionalProperties: false
                    required:
                      - error
                    additionalProperties: false
                  - type: object
                    properties:
                      error:
                        type: object
                        properties:
                          code:
                            type: string
                            enum:
                              - api_json_too_deep
                          correlation_id:
                            type: string
                          message:
                            type: string
                            enum:
                              - The JSON request body exceeds maximum depth.
                        required:
                          - code
                          - message
                        additionalProperties: false
                    required:
                      - error
                    additionalProperties: false
        '415':
          description: Error response.
          headers:
            X-Correlation-ID:
              description: Correlation identifier for this request.
              schema:
                type: string
                pattern: ^[0-9A-HJKMNP-TV-Z]{26}$
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        enum:
                          - api_unsupported_media_type
                      correlation_id:
                        type: string
                      message:
                        type: string
                        enum:
                          - Content-Type must be application/json.
                    required:
                      - code
                      - message
                    additionalProperties: false
                required:
                  - error
                additionalProperties: false
        '422':
          description: Error response.
          headers:
            X-Correlation-ID:
              description: Correlation identifier for this request.
              schema:
                type: string
                pattern: ^[0-9A-HJKMNP-TV-Z]{26}$
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    properties:
                      error:
                        type: object
                        properties:
                          code:
                            type: string
                            enum:
                              - api_invalid_cursor
                          correlation_id:
                            type: string
                          message:
                            type: string
                            enum:
                              - The contact timeline cursor is invalid.
                        required:
                          - code
                          - message
                        additionalProperties: false
                    required:
                      - error
                    additionalProperties: false
                  - type: object
                    properties:
                      error:
                        type: object
                        properties:
                          code:
                            type: string
                            enum:
                              - api_invalid_limit
                          correlation_id:
                            type: string
                          message:
                            type: string
                            enum:
                              - >-
                                The page limit must be an integer between 1 and
                                50.
                        required:
                          - code
                          - message
                        additionalProperties: false
                    required:
                      - error
                    additionalProperties: false
                  - type: object
                    properties:
                      error:
                        type: object
                        properties:
                          code:
                            type: string
                            enum:
                              - api_validation_error
                          correlation_id:
                            type: string
                          details:
                            type: object
                            properties:
                              issues:
                                type: array
                                items:
                                  type: object
                                  properties:
                                    code:
                                      type: string
                                      minLength: 1
                                      maxLength: 64
                                    path:
                                      type: array
                                      items:
                                        type: integer
                                        minimum: 0
                                      maxItems: 16
                                  required:
                                    - code
                                    - path
                                  additionalProperties: false
                                maxItems: 32
                            required:
                              - issues
                            additionalProperties: false
                          message:
                            type: string
                            enum:
                              - The request does not match the declared schema.
                        required:
                          - code
                          - message
                        additionalProperties: false
                    required:
                      - error
                    additionalProperties: false
        '429':
          description: Error response.
          headers:
            X-Correlation-ID:
              description: Correlation identifier for this request.
              schema:
                type: string
                pattern: ^[0-9A-HJKMNP-TV-Z]{26}$
            Retry-After:
              description: Seconds to wait before retrying.
              schema:
                type: integer
                minimum: 1
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        enum:
                          - rate_limited
                      correlation_id:
                        type: string
                      message:
                        type: string
                        enum:
                          - Rate limit exceeded.
                    required:
                      - code
                      - message
                    additionalProperties: false
                required:
                  - error
                additionalProperties: false
        '500':
          description: Error response.
          headers:
            X-Correlation-ID:
              description: Correlation identifier for this request.
              schema:
                type: string
                pattern: ^[0-9A-HJKMNP-TV-Z]{26}$
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    properties:
                      error:
                        type: object
                        properties:
                          code:
                            type: string
                            enum:
                              - api_internal_error
                          correlation_id:
                            type: string
                          message:
                            type: string
                            enum:
                              - The request could not be completed.
                        required:
                          - code
                          - message
                        additionalProperties: false
                    required:
                      - error
                    additionalProperties: false
                  - type: object
                    properties:
                      error:
                        type: object
                        properties:
                          code:
                            type: string
                            enum:
                              - api_invalid_projection
                          correlation_id:
                            type: string
                          message:
                            type: string
                            enum:
                              - The contact projection is invalid.
                        required:
                          - code
                          - message
                        additionalProperties: false
                    required:
                      - error
                    additionalProperties: false
                  - type: object
                    properties:
                      error:
                        type: object
                        properties:
                          code:
                            type: string
                            enum:
                              - api_projection_too_large
                          correlation_id:
                            type: string
                          message:
                            type: string
                            enum:
                              - >-
                                The projected result exceeds the result byte
                                limit.
                        required:
                          - code
                          - message
                        additionalProperties: false
                    required:
                      - error
                    additionalProperties: false
        '503':
          description: Error response.
          headers:
            X-Correlation-ID:
              description: Correlation identifier for this request.
              schema:
                type: string
                pattern: ^[0-9A-HJKMNP-TV-Z]{26}$
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    properties:
                      error:
                        type: object
                        properties:
                          code:
                            type: string
                            enum:
                              - api_account_resolution_unavailable
                          correlation_id:
                            type: string
                          message:
                            type: string
                            enum:
                              - The reachable account set could not be read.
                        required:
                          - code
                          - message
                        additionalProperties: false
                    required:
                      - error
                    additionalProperties: false
                  - type: object
                    properties:
                      error:
                        type: object
                        properties:
                          code:
                            type: string
                            enum:
                              - api_audit_unavailable
                          correlation_id:
                            type: string
                          message:
                            type: string
                            enum:
                              - The security audit log is unavailable.
                        required:
                          - code
                          - message
                        additionalProperties: false
                    required:
                      - error
                    additionalProperties: false
                  - type: object
                    properties:
                      error:
                        type: object
                        properties:
                          code:
                            type: string
                            enum:
                              - api_contact_read_unavailable
                          correlation_id:
                            type: string
                          message:
                            type: string
                            enum:
                              - The contact data could not be read.
                        required:
                          - code
                          - message
                        additionalProperties: false
                    required:
                      - error
                    additionalProperties: false
                  - type: object
                    properties:
                      error:
                        type: object
                        properties:
                          code:
                            type: string
                            enum:
                              - rate_limiter_unavailable
                          correlation_id:
                            type: string
                          message:
                            type: string
                            enum:
                              - Rate limiter unavailable.
                        required:
                          - code
                          - message
                        additionalProperties: false
                    required:
                      - error
                    additionalProperties: false
components:
  schemas:
    PublicContactDetailResult:
      $ref: cb9156d2-9e83-4383-b8e2-96efb1e5d550
      $defs:
        PublicContactDetailResult:
          additionalProperties: false
          properties:
            contact:
              additionalProperties: false
              properties:
                account_id:
                  format: uuid
                  pattern: >-
                    ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
                  type: string
                account_type:
                  anyOf:
                    - description: >-
                        Values: `BUSINESS`: an Instagram business account;
                        `CREATOR`: an Instagram creator account; `PERSONAL`: an
                        Instagram personal account; `UNKNOWN`: the Instagram
                        account type is unavailable.
                      enum:
                        - PERSONAL
                        - BUSINESS
                        - CREATOR
                        - UNKNOWN
                      type: string
                    - type: 'null'
                attributes:
                  items:
                    additionalProperties: false
                    properties:
                      created_at:
                        format: date-time
                        type: string
                      id:
                        pattern: ^[1-9][0-9]{0,18}$
                        type: string
                      key:
                        maxLength: 100
                        minLength: 1
                        type: string
                      source:
                        description: >-
                          Values: `capture`: derived from an automation capture
                          rule; `lead_capture`: provided by the contact through
                          a lead-capture step; `manual`: set manually.
                        enum:
                          - capture
                          - lead_capture
                          - manual
                        type: string
                      source_ref:
                        anyOf:
                          - maxLength: 200
                            minLength: 1
                            type: string
                          - type: 'null'
                      updated_at:
                        format: date-time
                        type: string
                      value:
                        anyOf:
                          - maxLength: 10000
                            minLength: 0
                            type: string
                          - type: 'null'
                    required:
                      - id
                      - key
                      - value
                      - source
                      - source_ref
                      - created_at
                      - updated_at
                    type: object
                  maxItems: 1000
                  type: array
                biography:
                  anyOf:
                    - maxLength: 100000
                      minLength: 1
                      type: string
                    - type: 'null'
                blocked:
                  type: boolean
                blocked_at:
                  anyOf:
                    - format: date-time
                      type: string
                    - type: 'null'
                created_at:
                  format: date-time
                  type: string
                email:
                  anyOf:
                    - maxLength: 320
                      minLength: 1
                      type: string
                    - type: 'null'
                enrichment_status:
                  description: >-
                    Values: `failed`: the most recent enrichment attempt failed;
                    `fresh`: the enrichment data is current; `pending`: profile
                    enrichment has not finished; `stale`: the enrichment data
                    needs to be refreshed.
                  enum:
                    - pending
                    - fresh
                    - stale
                    - failed
                  type: string
                first_seen_at:
                  format: date-time
                  type: string
                followers_count:
                  anyOf:
                    - maximum: 9007199254740991
                      minimum: 0
                      type: integer
                    - type: 'null'
                follows_count:
                  anyOf:
                    - maximum: 9007199254740991
                      minimum: 0
                      type: integer
                    - type: 'null'
                id:
                  format: uuid
                  pattern: >-
                    ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
                  type: string
                instagram_profile_url:
                  anyOf:
                    - format: uri
                      pattern: ^https://instagram\.com/[a-z0-9._]{1,30}$
                      type: string
                    - type: 'null'
                  description: >-
                    Server-derived profile URL for the canonical username; null
                    when username is absent or invalid.
                  readOnly: true
                instagram_user_id:
                  maxLength: 100
                  minLength: 1
                  type: string
                is_user_follow_business:
                  anyOf:
                    - type: boolean
                    - type: 'null'
                is_verified:
                  anyOf:
                    - type: boolean
                    - type: 'null'
                last_enriched_at:
                  anyOf:
                    - format: date-time
                      type: string
                    - type: 'null'
                last_enrichment_attempt_at:
                  anyOf:
                    - format: date-time
                      type: string
                    - type: 'null'
                last_seen_at:
                  format: date-time
                  type: string
                media_count:
                  anyOf:
                    - maximum: 9007199254740991
                      minimum: 0
                      type: integer
                    - type: 'null'
                name:
                  anyOf:
                    - maxLength: 120
                      minLength: 1
                      type: string
                    - type: 'null'
                opt_out:
                  type: boolean
                opt_out_at:
                  anyOf:
                    - format: date-time
                      type: string
                    - type: 'null'
                phone:
                  anyOf:
                    - maxLength: 64
                      minLength: 1
                      type: string
                    - type: 'null'
                profile_picture_url:
                  anyOf:
                    - maxLength: 2048
                      minLength: 1
                      type: string
                    - type: 'null'
                send_instagram_dm_url:
                  anyOf:
                    - format: uri
                      pattern: ^https://ig\.me/m/[a-z0-9._]{1,30}$
                      type: string
                    - type: 'null'
                  description: >-
                    Server-derived Instagram DM URL for the canonical username;
                    null when username is absent or invalid.
                  readOnly: true
                tags:
                  items:
                    additionalProperties: false
                    properties:
                      id:
                        description: >-
                          Stable public tag UUID. Internal numeric catalog IDs
                          are never exposed.
                        format: uuid
                        pattern: >-
                          ^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
                        type: string
                      name:
                        description: >-
                          Normalized tag name: trimmed, with consecutive
                          whitespace collapsed to one ASCII space.
                        maxLength: 50
                        minLength: 1
                        pattern: >-
                          ^(?!.*\s{2})(?!\s)(?!.*\s$)(?!.*[\u0000-\u001F\u007F]).+$
                        type: string
                    required:
                      - id
                      - name
                    type: object
                  maxItems: 100
                  type: array
                timeline:
                  additionalProperties: false
                  properties:
                    items:
                      items:
                        additionalProperties: false
                        properties:
                          id:
                            maxLength: 256
                            minLength: 1
                            type: string
                          timestamp:
                            format: date-time
                            type: string
                          type:
                            description: >-
                              Values: `attribute_captured`: a contact attribute
                              was captured; `dm_failed`: a direct message
                              failed; `dm_sent`: a direct message was sent;
                              `first_contact`: the first contact activity was
                              recorded; `tag_applied`: a tag was added to the
                              contact.
                            enum:
                              - dm_sent
                              - dm_failed
                              - tag_applied
                              - attribute_captured
                              - first_contact
                            type: string
                        required:
                          - id
                          - type
                          - timestamp
                        type: object
                      maxItems: 50
                      type: array
                    next_cursor:
                      anyOf:
                        - maxLength: 1024
                          minLength: 1
                          type: string
                        - type: 'null'
                  required:
                    - items
                    - next_cursor
                  type: object
                updated_at:
                  format: date-time
                  type: string
                username:
                  anyOf:
                    - pattern: >-
                        ^(?=[a-z0-9._]{1,30}$)(?=[a-z0-9._]*[a-z0-9][a-z0-9._]*$)(?!\.)(?![a-z0-9._]*\.\.)(?![a-z0-9._]*\.$)[a-z0-9._]+$
                      type: string
                    - type: 'null'
                website:
                  anyOf:
                    - maxLength: 2048
                      minLength: 1
                      type: string
                    - type: 'null'
              required:
                - id
                - account_id
                - instagram_user_id
                - username
                - instagram_profile_url
                - send_instagram_dm_url
                - name
                - profile_picture_url
                - biography
                - website
                - followers_count
                - follows_count
                - media_count
                - account_type
                - is_verified
                - is_user_follow_business
                - email
                - phone
                - opt_out
                - opt_out_at
                - blocked
                - blocked_at
                - enrichment_status
                - first_seen_at
                - last_seen_at
                - last_enriched_at
                - last_enrichment_attempt_at
                - created_at
                - updated_at
                - tags
                - attributes
                - timeline
              type: object
          required:
            - contact
          type: object
      $id: https://levios.app/schemas/public-contact-detail-result-v1
      $schema: https://json-schema.org/draft/2019-09/schema#
      title: PublicContactDetailResult
      x-levios-max-serialized-bytes: 65536
      x-levios-schema-version: 1
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Levios API key sent as a Bearer token.

````

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