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

# Download an image or template in a format

> A download URL for one format of an image or template (a PSD, an AI, an EPS...). It spends credits.



## OpenAPI

````yaml openapi/magnific-api-v2-stock-openapi.yaml GET /v2/stock/resources/{resource_id}/download/{resource_format}
openapi: 3.1.0
info:
  title: Magnific API v2 — Stock
  version: 2.0.0
  description: >-
    Search, read and download stock under `/v2/stock`: images and templates,
    icons and videos (same items, licences and billing as API v1), and music and
    sound effects (free, as on the web).
servers:
  - url: https://api.magnific.com
    description: Production V2
security:
  - magnificApiKey: []
  - bearerAuth: []
tags:
  - name: Videos
    description: >-
      Generate and edit videos. Add `?dry_run=true` to get the price of a
      request first.
paths:
  /v2/stock/resources/{resource_id}/download/{resource_format}:
    get:
      tags:
        - Resources
      summary: Download an image or template in a format
      description: >-
        Download links for the resource in one format. Charges the download as
        on /v1.


        A personal token needs `api:write`.
      operationId: stock_resources_resource_id_download_resource_format
      parameters:
        - description: Photo, video or PSD resource ID
          example: 30955
          in: path
          name: resource_id
          required: true
          schema:
            type: integer
        - description: Resource format
          in: path
          name: resource_format
          required: true
          schema:
            enum:
              - psd
              - ai
              - eps
              - atn
              - fonts
              - resources
              - png
              - jpg
              - 3d-render
              - svg
              - mockup
            example: svg
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    items:
                      $ref: '#/components/schemas/Stockdownload'
                    type: array
                required:
                  - data
        '400':
          description: >-
            `validation_failed`: a parameter is not valid (`details.errors` by
            field, e.g. `query`, `cursor`, `filters.color`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StockV2Error'
        '401':
          description: '`unauthenticated`: the token or API key is missing or not valid.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StockV2Error'
        '402':
          description: '`insufficient_credits`: not enough credits for the download.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StockV2Error'
        '403':
          description: >-
            `forbidden`, `upgrade_required` (a premium asset on a plan without
            premium), `restricted_author_content`, `magnific_api_disabled`,
            `key_not_supported` or `api_key_wallet_unavailable`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StockV2Error'
        '404':
          description: '`not_found`: no such asset.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StockV2Error'
        '422':
          description: >-
            `validation_failed`: the API key is not linked to an active
            subscription, or the tool is not available.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StockV2Error'
        '429':
          description: '`rate_limited`: too many requests or downloads.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StockV2Error'
        '500':
          description: '`internal_error`.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StockV2Error'
        '503':
          description: >-
            `service_unavailable`: the search engine or a dependency is down;
            retry later.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StockV2Error'
      security:
        - magnificApiKey: []
        - bearerAuth: []
components:
  schemas:
    Stockdownload:
      example:
        signed_url: >-
          https://img.b2bpic.net/premium-photo/close-up-cat-resting_1048944-9269194.jpg?t=st=1725276607~exp=1725280207~hmac=1538f1b294fc3a19a19e9f02ceeb6594a9a1e36a900de85d47bbd386e27dddbe
        filename: blackboard-template.zip
        url: https://downloadscdn5.magnific.com/d/1137445/blackboard-template.zip
      properties:
        filename:
          description: Filename of the resource
          example: blackboard-template.zip
          minLength: 1
          type: string
        url:
          example: https://downloadscdn5.magnific.com/d/1137445/blackboard-template.zip
          format: uri
          minLength: 1
          type: string
        signed_url:
          description: The signed URL of the resource preview
          example: >-
            https://img.b2bpic.net/premium-photo/close-up-cat-resting_1048944-9269194.jpg?t=st=1725276607~exp=1725280207~hmac=1538f1b294fc3a19a19e9f02ceeb6594a9a1e36a900de85d47bbd386e27dddbe
          format: uri
          type:
            - string
            - 'null'
      required:
        - filename
        - url
      type: object
    StockV2Error:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
          description: >-
            Stable, for code: `validation_failed`, `unauthenticated`,
            `insufficient_credits`, `forbidden`, `upgrade_required`,
            `not_found`, `rate_limited`, `internal_error`,
            `service_unavailable`...
          example: validation_failed
        message:
          type: string
          description: For people. Never the cause of a server error.
        details:
          type: object
          description: Absent on a server error.
          properties:
            errors:
              type: object
              description: Validation messages by field.
              additionalProperties:
                type: array
                items:
                  type: string
        request_id:
          type: string
  securitySchemes:
    magnificApiKey:
      type: apiKey
      in: header
      name: x-magnific-api-key
      description: >-
        Your Magnific API key. [Learn how to obtain an API
        key](https://docs.magnific.com/quickstart)
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        A personal access token, sent as `Authorization: Bearer <token>`. [How
        to get one](/api-reference/v2/overview#get-a-personal-access-token)

````

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