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

# Get attachment external URL

> Returns an external viewing URL for a stored VK video attachment belonging to the API key company. Use a YoLead attachment ObjectId from a standard descriptor, including descriptors marked `accessMode: external`. Opaque IDs from VK provider-history descriptors are not accepted.

An active VK channel and usable provider access are required. This endpoint returns JSON, not file bytes or a redirect. It does not support other channels or attachment kinds. Do not assume that the returned provider URL remains valid indefinitely. Query parameters are not accepted.

Required API key scope: `read`.



## OpenAPI

````yaml /openapi/public-api-v1.json get /v1/attachments/{attachmentId}/external-url
openapi: 3.1.0
info:
  title: YoLead Public API
  version: 1.0.0
  description: >-
    Public REST API for YoLead integrations. Only endpoints mounted under /v1
    are included. Management endpoints used by the YoLead UI, including
    /integrations/*, are intentionally excluded.
servers:
  - url: https://api.yo-lead.com
    description: Production
security:
  - YoLeadPublicKey: []
    YoLeadTimestamp: []
    YoLeadSignature: []
tags:
  - name: Employees
    description: Employee data available to integrations.
  - name: Embed
    description: Iframe session creation for embedding YoLead UI.
  - name: Tickets
    description: Ticket history, status, and assignee operations.
  - name: Contacts
    description: Contacts available to the API key company.
  - name: Lists
    description: Contact lists available to the API key company.
  - name: Attachments
    description: External viewing links for supported attachments.
paths:
  /v1/attachments/{attachmentId}/external-url:
    get:
      tags:
        - Attachments
      summary: Get attachment external URL
      description: >-
        Returns an external viewing URL for a stored VK video attachment
        belonging to the API key company. Use a YoLead attachment ObjectId from
        a standard descriptor, including descriptors marked `accessMode:
        external`. Opaque IDs from VK provider-history descriptors are not
        accepted.


        An active VK channel and usable provider access are required. This
        endpoint returns JSON, not file bytes or a redirect. It does not support
        other channels or attachment kinds. Do not assume that the returned
        provider URL remains valid indefinitely. Query parameters are not
        accepted.


        Required API key scope: `read`.
      operationId: getAttachmentExternalUrl
      parameters:
        - name: attachmentId
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/ObjectId'
          description: YoLead attachment ObjectId from a standard attachment descriptor.
      responses:
        '200':
          description: External viewing URL.
          headers:
            Cache-Control:
              schema:
                type: string
                const: no-store
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AttachmentExternalUrlResponse'
              example:
                data:
                  url: https://vk.com/video-123_456
        '400':
          $ref: '#/components/responses/ValidationError'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          description: >-
            Attachment not found for the API key company (4041501), or
            attachment does not support external video viewing (4041502).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                code: 4041502
                message: Attachment file is unavailable
        '500':
          description: Unexpected error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                code: 5001504
                message: Internal server error
        '503':
          description: VK provider access is unavailable.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                code: 5031502
                message: Attachment provider is unavailable
components:
  schemas:
    ObjectId:
      type: string
      pattern: ^[0-9a-fA-F]{24}$
      description: MongoDB ObjectId represented as a 24-character hexadecimal string.
      example: 64f000000000000000000001
    AttachmentExternalUrlResponse:
      type: object
      additionalProperties: false
      required:
        - data
      properties:
        data:
          type: object
          additionalProperties: false
          required:
            - url
          properties:
            url:
              type: string
              format: uri
              description: External VK video viewing URL.
    ErrorResponse:
      type: object
      additionalProperties: false
      required:
        - code
        - message
      properties:
        code:
          type: integer
          example: 40001
        message:
          type: string
          example: Validation error
  responses:
    ValidationError:
      description: Validation or business-rule error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            code: 40001
            message: Validation error
    Unauthorized:
      description: Invalid API credentials, stale timestamp, or invalid request signature.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            code: 40121
            message: Invalid API credentials
    Forbidden:
      description: >-
        API key scope is not sufficient for this operation, or the required
        feature is unavailable on the company's current plan.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            insufficientScope:
              value:
                code: 40361
                message: API key scope is not sufficient
            apiAccessUnavailable:
              value:
                code: 40351
                message: API access is unavailable on your current plan
  securitySchemes:
    YoLeadPublicKey:
      type: apiKey
      in: header
      name: X-YoLead-Key
      description: Public API key generated in the YoLead UI.
    YoLeadTimestamp:
      type: apiKey
      in: header
      name: X-YoLead-Timestamp
      description: >-
        Unix timestamp in milliseconds. Requests must be signed within a
        5-minute window.
    YoLeadSignature:
      type: apiKey
      in: header
      name: X-YoLead-Signature
      description: >-
        Hex HMAC-SHA256 signature over `<timestamp>.<raw_body>` using the API
        secret.

````

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