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

# Get an upload link

> See whether an upload link expired, how many files it took, and their media ids.

> [!NOTE]
>
> Needs `media:read`. See [Permissions](https://docs.postsyncer.com/essentials/authentication.md#permissions).

Reads a link made with [Create an upload link](https://docs.postsyncer.com/api-reference/media/upload-link.md), by its `id`. Call it when the person says the upload is done. The MCP tool `get-media-upload-link` does the same.

* `media` holds the files the link took that are still in the library, in the order they arrived. Put each `id` in a post's `content[].media`.
* `files_uploaded` counts every file the link took, including any deleted from the library since. So it can be more than the number of items in `media`. A link takes no more files once `files_uploaded` is `max_files`.
* `expired` is `true` once `expires_at` has passed. An expired link still reads here, with the files it took.
* An empty `media` with `files_uploaded` at 0 means no file has arrived yet: ask the person whether the upload finished.

This answer never has the link's `url` or `upload_url`: only the create answer gives them.

## Errors

| Status | `error` | When | Retry? |
| - | - | - | - |
| 401 | | No API key, or not a valid one. | No: fix the key. |
| 403 | | The key lacks `media:read`, or its user is inactive. | No: grant it in Settings → API. |
| 404 | | No upload link with that id in the workspaces the key can reach. | No. |
| 429 | | More than 60 requests a minute. | Yes, after `Retry-After` seconds. |

## Related

* [Create an upload link](https://docs.postsyncer.com/api-reference/media/upload-link.md): make a link.
* [Files from AI chats](https://docs.postsyncer.com/guides/files-from-ai-chats.md): how the files get to the link.
* [Get a media file](https://docs.postsyncer.com/api-reference/media/get.md): one file by its id.


## OpenAPI

````yaml GET /media/upload-links/{upload_link_id}
openapi: 3.0.3
info:
  title: PostSyncer API
  description: >-
    Post to 12 social networks from your code: posts, media, comments,
    analytics, webhooks and more.
  version: 1.0.0
servers:
  - url: https://postsyncer.com/api/v1
security:
  - bearerAuth: []
tags:
  - name: Workspaces
    description: The workspaces the key can reach.
  - name: Accounts
    description: Connected social accounts, links to connect more, and disconnecting them.
  - name: Posts
    description: Drafts, scheduled and published posts, approvals and a post's history.
  - name: Post settings
    description: A post's auto-plug, comment moderation and contact collection.
  - name: Media
    description: >-
      The media library: file uploads, URL imports, and reading videos and
      social posts' files.
  - name: Folders
    description: Folders that organise the media library.
  - name: Comments
    description: >-
      Comments on your posts: reading, replying, editing, hiding, deleting and
      syncing them.
  - name: Reviews
    description: Google Business Profile reviews and your replies to them.
  - name: Analytics
    description: Workspace, account and post performance.
  - name: Brand
    description: >-
      A workspace's brand: identity, voice, look, accounts, competitors,
      learnings and rules.
  - name: Labels
    description: Labels used to tag posts.
  - name: Campaigns
    description: Campaigns used to group posts.
  - name: Snippets
    description: Saved snippets and hashtag groups to drop into posts.
  - name: Webhooks
    description: Signed webhook endpoints that get your notification events.
paths:
  /media/upload-links/{upload_link_id}:
    get:
      tags:
        - Media
      summary: Get an upload link
      description: >-
        Needs `media:read`. Reads an upload link made with [Create an upload
        link](/api-reference/media/upload-link): whether it expired, how many
        files it took, and the files it took that are still in the library, in
        the order they arrived. Put each `media[].id` in a post's
        `content[].media`. It never gives the link's `url` or `upload_url`:
        those are only in the create answer. A link in a workspace the key can't
        reach is not found.
      operationId: getMediaUploadLink
      parameters:
        - name: upload_link_id
          in: path
          required: true
          description: The link's `id`, from the create answer.
          schema:
            type: integer
      responses:
        '200':
          description: The link.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MediaUploadLinkResponse'
              examples:
                default:
                  summary: Two files arrived
                  value:
                    upload_link:
                      id: 318
                      expires_at: '2030-03-15T10:00:00+00:00'
                      expired: false
                      max_files: 10
                      files_uploaded: 2
                      media:
                        - id: 9061
                          workspace_id: 12
                          folder_id: 41
                          name: spring-launch.mp4
                          url: >-
                            https://cdn.postsyncer.com/examples/spring-launch.mp4
                          thumb_url: >-
                            https://cdn.postsyncer.com/examples/spring-launch-thumb.jpg
                          mime_type: video/mp4
                          size: 248512000
                          is_processing: false
                          type: video
                          ai_generated_id: null
                          is_reference: false
                          progress: 100
                          alt: null
                          duration_seconds: 58.4
                        - id: 9062
                          workspace_id: 12
                          folder_id: 41
                          name: latte-art.jpg
                          url: https://cdn.postsyncer.com/examples/latte-art.jpg
                          thumb_url: >-
                            https://cdn.postsyncer.com/examples/latte-art-thumb.jpg
                          medium_url: >-
                            https://cdn.postsyncer.com/examples/latte-art-medium.jpg
                          mime_type: image/jpeg
                          size: 482113
                          is_processing: false
                          type: image
                          ai_generated_id: null
                          is_reference: false
                          progress: 100
                          alt: null
                          duration_seconds: null
                waiting:
                  summary: No file yet
                  value:
                    upload_link:
                      id: 318
                      expires_at: '2030-03-15T10:00:00+00:00'
                      expired: false
                      max_files: 10
                      files_uploaded: 0
                      media: []
                deleted_since:
                  summary: One file was deleted from the library since
                  value:
                    upload_link:
                      id: 318
                      expires_at: '2030-03-15T10:00:00+00:00'
                      expired: true
                      max_files: 10
                      files_uploaded: 2
                      media:
                        - id: 9062
                          workspace_id: 12
                          folder_id: 41
                          name: latte-art.jpg
                          url: https://cdn.postsyncer.com/examples/latte-art.jpg
                          thumb_url: >-
                            https://cdn.postsyncer.com/examples/latte-art-thumb.jpg
                          medium_url: >-
                            https://cdn.postsyncer.com/examples/latte-art-medium.jpg
                          mime_type: image/jpeg
                          size: 482113
                          is_processing: false
                          type: image
                          ai_generated_id: null
                          is_reference: false
                          progress: 100
                          alt: null
                          duration_seconds: null
        '401':
          $ref: '#/components/responses/Unauthorized401'
        '403':
          description: The key lacks `media:read`, or its user is inactive.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                missing_permission:
                  summary: The key lacks media:read
                  value:
                    message: >-
                      This API key does not have the "media:read" permission.
                      Edit the key in PostSyncer under Settings → API to grant
                      it.
                inactive_account:
                  summary: The key's user is inactive
                  value:
                    message: Your account is inactive.
        '404':
          $ref: '#/components/responses/NotFound404'
        '429':
          $ref: '#/components/responses/RateLimited429'
components:
  schemas:
    MediaUploadLinkResponse:
      type: object
      required:
        - upload_link
      properties:
        upload_link:
          type: object
          required:
            - id
            - expires_at
            - expired
            - max_files
            - files_uploaded
            - media
          properties:
            id:
              type: integer
              description: The link's id.
            expires_at:
              type: string
              format: date-time
              description: When the link stops (or stopped) taking files.
            expired:
              type: boolean
              description: >-
                True once `expires_at` has passed. An expired link still reads
                here.
            max_files:
              type: integer
              description: 'How many files the link takes: 10.'
            files_uploaded:
              type: integer
              description: >-
                How many files the link took, counting any deleted from the
                library since. When it is `max_files`, the link takes no more.
            media:
              type: array
              items:
                $ref: '#/components/schemas/APIMedia'
              description: >-
                The files the link took that are still in the library, in the
                order they arrived.
    Error:
      type: object
      description: >-
        An error answer. Every one has `message`, in plain words; some add an
        `error` code and fields of their own.
      required:
        - message
      properties:
        message:
          type: string
          description: What went wrong and what to do about it.
    APIMedia:
      type: object
      description: >-
        A file in the media library: what list, get and the uploads give, and
        what posts and comments hold.
      required:
        - id
        - workspace_id
        - folder_id
        - name
        - url
        - mime_type
        - size
        - is_processing
        - type
        - ai_generated_id
        - is_reference
        - progress
        - alt
        - duration_seconds
      properties:
        id:
          type: integer
          description: The file's id. Posts take it in `content[].media`.
        workspace_id:
          type: integer
        folder_id:
          type: integer
          nullable: true
          description: The folder it is in; null at the top of the library.
        name:
          type: string
          description: The file name.
        url:
          type: string
          format: uri
          description: The file itself, at a public link.
        thumb_url:
          type: string
          format: uri
          description: >-
            A picture's small copy (about 400 px on its long edge) for cards and
            lists, or a video's still. Left out until one is made: use `url`
            then. See [Picture
            copies](/api-reference/media/overview#picture-copies).
        medium_url:
          type: string
          format: uri
          description: >-
            A picture's medium copy (about 800 px on its long edge) for large
            tiles and previews. Left out until one is made, and for a picture no
            bigger than 800 px on its long edge, which needs none: use `url`
            then. Videos, GIFs and documents have none.
        mime_type:
          type: string
          nullable: true
          description: The file's type, like `image/jpeg`.
        size:
          type: integer
          nullable: true
          description: The size in bytes.
        is_processing:
          type: boolean
          description: >-
            True while the file is still being made (an AI video, for example).
            It can't go on a post or be deleted until it is ready.
        type:
          type: string
          nullable: true
          enum:
            - image
            - video
            - audio
            - document
            - null
          description: >-
            The kind of file, from `mime_type`: `document` is a PDF, Word or
            PowerPoint file. Null for any other type.
        ai_generated_id:
          type: integer
          nullable: true
          description: Set when PostSyncer's AI made the file; null for uploads.
        is_reference:
          type: boolean
          description: True for a reference picture kept for AI video, not for posting.
        progress:
          type: integer
          description: Always 100.
        alt:
          type: string
          nullable: true
          description: The alt text, when set.
        duration_seconds:
          type: number
          nullable: true
          description: >-
            A video's or sound's length in seconds, read when it was uploaded.
            Null for pictures and documents, and for files stored before lengths
            were read.
  responses:
    Unauthorized401:
      description: No API key, or not a valid one.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            unauthenticated:
              summary: No valid API key
              value:
                message: Unauthenticated.
    NotFound404:
      description: Nothing with that id in the workspaces the key can reach.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            not_found:
              summary: Not found
              value:
                message: Not found.
    RateLimited429:
      description: >-
        More than 60 requests in a minute from this key's user (the API and the
        MCP server share the count). Wait `Retry-After` seconds.
      headers:
        Retry-After:
          description: Seconds until requests are allowed again.
          schema:
            type: integer
        X-RateLimit-Limit:
          description: Requests allowed a minute.
          schema:
            type: integer
        X-RateLimit-Remaining:
          description: Requests left this minute.
          schema:
            type: integer
        X-RateLimit-Reset:
          description: When requests are allowed again, as a Unix timestamp.
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            too_many_attempts:
              summary: Too many requests
              value:
                message: Too Many Attempts.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````

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