---
title: "Migrate Media URLs (Batch)"
method: POST
path: "/media/migrate-url/batch"
tags: ["media"]
---

# Migrate Media URLs (Batch)

`POST /media/migrate-url/batch`

## Request

- Base URL: `https://api.periskope.app/v1`
- URL: `https://api.periskope.app/v1/media/migrate-url/batch`
- Auth: HTTP bearer

Converts up to `1000` legacy `storage.googleapis.com` attachment URLs (or existing Periskope media URLs) to the new Periskope media URL format in a single request.

Each URL succeeds or fails independently — `results[i]` corresponds to `urls[i]` in the request.

## Request body

- object
  - `urls` string[], required: The media URLs to migrate. Maximum 1000 URLs per request.
  - `access` 'private' | 'public': Access mode for the returned URLs. `private` returns tokenized links that expire; `public` returns bare links. If omitted, follows your organization's Media Privacy setting.
  - `expires_in_seconds` number: Validity of the returned links in seconds. Only valid for private links. Clamped between 60 seconds and 7 days. Defaults to your organization's configured link expiry.

## Response `200`

200 OK

- object
  - `results` object[]: One result per input URL, in the same order as the request.
    - `index` number: Index of the URL in the request `urls` array.
    - `success` boolean
    - `url` string: The migrated URL. Only present when `success` is `true`.
    - `error` string: Reason the URL could not be migrated. Only present when `success` is `false`.
  - `migrated_count` number: Number of URLs migrated successfully.
  - `failed_count` number: Number of URLs that failed to migrate.
  - `access` 'private' | 'public': The access mode applied to the returned URLs.
  - `expires_in_seconds` number: Validity of the returned links in seconds. Only present for private links.

## Changes

- **2026-11-03** `874b0dbfbf3e`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/periskope/apis/api-local/changes/media/migrate-url/batch/post.md)

---

[API](https://skmtc.dev/periskope/apis/api-local.md) - [All operations](https://skmtc.dev/periskope/apis/api-local/llms.txt) - [OpenAPI document](https://skmtc.dev/periskope/apis/api-local/revisions/874b0dbfbf3e?raw)
