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

# Upload a reply photo from a file or URL

> Uploads a JPEG or PNG (up to 8 MB) for a DM photo, from a public HTTPS url or base64 data, and returns image.id for dm_image_id or a flow step's image_id. A photo sent as a card is cropped per channel: Instagram 1:1, Facebook 1.91:1. For one channel, upload in its ratio with channel set. For both, upload the Instagram crop, then the Facebook crop with parent_image_id set to the first image.id, and use the second id. A photo sent as a plain photo is uploaded once without channel. Unused uploads expire after 7 days.

Needs an API key with write access.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/workspaces/{workspace_id}/reply-images
openapi: 3.1.0
info:
  title: Replier API
  version: '1'
servers:
  - url: https://api.usereplier.com
security:
  - apiKey: []
paths:
  /v1/workspaces/{workspace_id}/reply-images:
    post:
      tags:
        - Messages
      summary: Upload a reply photo from a file or URL
      description: >-
        Uploads a JPEG or PNG (up to 8 MB) for a DM photo, from a public HTTPS
        url or base64 data, and returns image.id for dm_image_id or a flow
        step's image_id. A photo sent as a card is cropped per channel:
        Instagram 1:1, Facebook 1.91:1. For one channel, upload in its ratio
        with channel set. For both, upload the Instagram crop, then the Facebook
        crop with parent_image_id set to the first image.id, and use the second
        id. A photo sent as a plain photo is uploaded once without channel.
        Unused uploads expire after 7 days.


        Needs an API key with write access.
      operationId: upload_reply_image
      parameters:
        - name: workspace_id
          in: path
          required: true
          description: Workspace ID returned by `GET /v1/workspaces`
          schema:
            type: string
            format: uuid
            pattern: >-
              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
        - name: Idempotency-Key
          in: header
          required: false
          description: >-
            Send the same key when you retry, and the request runs once. Without
            one, every request runs.
          schema:
            type: string
            minLength: 1
            maxLength: 128
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                file:
                  description: >-
                    When available it is the cheapest path (Replier fetches the
                    download_url server-side; no shell, no base64).
                  type: object
                  properties:
                    download_url:
                      type: string
                      format: uri
                    file_id:
                      type: string
                      minLength: 1
                    mime_type:
                      type: string
                    file_name:
                      type: string
                  required:
                    - download_url
                    - file_id
                data:
                  description: >-
                    Base64 image bytes (raw base64 or a data:image/…;base64,…
                    URI). Large base64 payloads are expensive to serialize, so
                    exhaust the other paths first.
                  type: string
                  minLength: 1
                url:
                  description: >-
                    Public HTTPS URL of a JPEG or PNG image (≤ 8 MB) that
                    Replier will fetch. Provide exactly one of file, url, or
                    data.
                  type: string
                  format: uri
                channel:
                  description: >-
                    Marks this upload as one channel's pre-cropped card variant
                    inside a bundle. Instagram = 1:1 exactly, Facebook = 1.91:1
                    exactly (2% tolerance). Bytes MUST already match the ratio —
                    the server rejects mismatches. Omit for a photo sent with
                    display "photo", or for a card on a single channel whose
                    bytes already match that channel's ratio.
                  type: string
                  enum:
                    - instagram
                    - facebook
                parent_image_id:
                  description: >-
                    Chain this upload onto a prior channel upload so one
                    dm_image_id carries crops for both channels. Set to the
                    image.id returned by the first upload (usually the instagram
                    one). Omit on the first upload of a bundle.
                  type: string
                  format: uuid
                  pattern: >-
                    ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
      responses:
        '201':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  workspace:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
                        pattern: >-
                          ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                      name:
                        type: string
                      kind:
                        type: string
                        enum:
                          - personal
                          - agency
                      role:
                        type: string
                        enum:
                          - owner
                          - admin
                          - member
                    required:
                      - id
                      - name
                      - kind
                      - role
                  image:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
                        pattern: >-
                          ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                      url:
                        type: string
                        format: uri
                      content_type:
                        type: string
                        enum:
                          - image/jpeg
                          - image/png
                      bytes:
                        type: integer
                        exclusiveMinimum: 0
                        maximum: 9007199254740991
                    required:
                      - id
                      - url
                      - content_type
                      - bytes
                required:
                  - workspace
                  - image
        default:
          $ref: '#/components/responses/Error'
components:
  responses:
    Error:
      description: Refused
      content:
        application/json:
          schema:
            type: object
            required:
              - error
            properties:
              error:
                type: object
                required:
                  - code
                  - message
                properties:
                  code:
                    type: string
                    description: >-
                      Why the request was refused, such as AUTOMATION_NOT_FOUND
                      or VERSION_CONFLICT. Other fields beside it give details.
                  message:
                    type: string
                    description: The same reason, in English.
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: A Replier API key (rpl_...).

````

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