LinkedMash Media API
Upload or re-host media for a LinkedIn post draft.
Upload or re-host media for a LinkedIn post draft.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/linkedmash-com:linkedmash-com-media-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: LinkedMash Media API
version: 1.0.0
description: The public LinkedMash API for retrieving saved LinkedIn posts, managing labels and drafts, scheduling content, and reading analytics.
license:
name: LinkedMash Terms of Service
url: https://www.linkedmash.com/terms
contact:
name: LinkedMash Support
email: support@linkedmash.com
url: https://www.linkedmash.com/api-docs/getting-started
servers:
- url: https://api.linkedmash.com
description: LinkedMash production API
tags:
- name: Media
description: Upload or re-host media for a LinkedIn post draft.
paths:
/v1/media/upload:
post:
tags:
- Media
summary: Upload Media
description: 'Re-host an image, video, or PDF for use in a post. Provide either url or file_base64, not both. Requires a paid Premium or Lifetime plan.
POST /v1/media/upload re-hosts an image, video or PDF on LinkedMash and returns a stable public URL to use as media_url on a draft or a schedule call. It takes either a remote url to fetch and copy, or file_base64 with a file_name for raw bytes — one or the other, not both.
Re-hosting is the recommended path even when you already have a URL. A scheduled post publishes hours or days after it is created, and an asset that has expired or moved by then publishes as a post with a broken attachment.'
operationId: uploadMedia
externalDocs:
description: Upload Media documentation
url: https://www.linkedmash.com/api-docs/upload-media
security:
- oauthClientCredentials:
- content:write
- bearerAuth: []
- apiKeyHeader: []
requestBody:
required: false
content:
application/json:
schema:
type: object
additionalProperties: false
properties:
url:
type: string
format: uri
example: https://example.com/assets/diagram.png
description: Remote http(s) URL to re-host. Provide either url or file_base64.
file_base64:
type: string
description: Base64-encoded file bytes — an alternative to url.
file_name:
type: string
description: Original file name.
mime_type:
type: string
example: image/png
description: MIME type of the file (e.g., 'image/png').
example:
url: https://example.com/assets/diagram.png
mime_type: image/png
responses:
'201':
description: Successful response.
headers:
RateLimit-Limit:
$ref: '#/components/headers/RateLimitLimit'
RateLimit-Remaining:
$ref: '#/components/headers/RateLimitRemaining'
RateLimit-Reset:
$ref: '#/components/headers/RateLimitReset'
X-RateLimit-Daily-Limit:
$ref: '#/components/headers/RateLimitDailyLimit'
X-RateLimit-Daily-Remaining:
$ref: '#/components/headers/RateLimitDailyRemaining'
X-RateLimit-Daily-Reset:
$ref: '#/components/headers/RateLimitDailyReset'
content:
application/json:
schema:
type: object
additionalProperties: false
required:
- status
- data
properties:
status:
type: boolean
data:
type: object
additionalProperties: false
required:
- url
- file_type
- file_name
- mime_type
properties:
url:
type: string
format: uri
file_type:
type: string
file_name:
type: string
mime_type:
type: string
example:
status: true
data:
url: https://media.linkedmash.com/uploads/9c1f0b2e/diagram.png
file_type: image
file_name: diagram.png
mime_type: image/png
'400':
description: Bad Request. Neither url nor file_base64 was given, the url was invalid or not http(s), the source could not be fetched, file_name was missing alongside file_base64, or the base64 payload could not be decoded.
headers:
RateLimit-Limit:
$ref: '#/components/headers/RateLimitLimit'
RateLimit-Remaining:
$ref: '#/components/headers/RateLimitRemaining'
RateLimit-Reset:
$ref: '#/components/headers/RateLimitReset'
X-RateLimit-Daily-Limit:
$ref: '#/components/headers/RateLimitDailyLimit'
X-RateLimit-Daily-Remaining:
$ref: '#/components/headers/RateLimitDailyRemaining'
X-RateLimit-Daily-Reset:
$ref: '#/components/headers/RateLimitDailyReset'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'401':
description: Unauthorized. The Authorization header is missing or the key is not a valid LinkedMash API key. Create or rotate keys on the API page in your LinkedMash settings.
headers:
RateLimit-Limit:
$ref: '#/components/headers/RateLimitLimit'
RateLimit-Remaining:
$ref: '#/components/headers/RateLimitRemaining'
RateLimit-Reset:
$ref: '#/components/headers/RateLimitReset'
X-RateLimit-Daily-Limit:
$ref: '#/components/headers/RateLimitDailyLimit'
X-RateLimit-Daily-Remaining:
$ref: '#/components/headers/RateLimitDailyRemaining'
X-RateLimit-Daily-Reset:
$ref: '#/components/headers/RateLimitDailyReset'
content:
application/json:
schema:
type: object
additionalProperties: false
required:
- status
- code
- error
properties:
status:
type: boolean
code:
type: string
error:
type: string
example:
status: false
code: UNAUTHORIZED
error: Unauthorized
'402':
description: Payment Required. Returned with code SUBSCRIPTION_REQUIRED. The content API requires a Premium or Lifetime plan; Reader and free accounts get this on every /v1/posts, /v1/queue, /v1/schedule, /v1/media and /v1/analytics call.
content:
application/json:
schema:
$ref: '#/components/schemas/PaymentRequiredResponse'
example:
status: false
code: SUBSCRIPTION_REQUIRED
error: The content API requires a Premium or Lifetime plan.
message: The content API requires a Premium or Lifetime plan.
upgrade_url: https://www.linkedmash.com/pricing
required_plan: creator
plan_name: Premium
price:
currency: usd
annual:
amount: 12000
interval: year
display: $120/yr
unlocks:
- bulk_actions
- labels
- vector_search
- ai_assistant
- export_unlimited
checkout_url: https://www.linkedmash.com/upgrade?from=api_subscription_required_creator
pricing_url: https://www.linkedmash.com/pricing.md
upgrade_source: api_subscription_required_creator
upgrade:
why: The content API requires a Premium or Lifetime plan.
unlocks:
- bulk_actions
- labels
- vector_search
- ai_assistant
- export_unlimited
url: https://www.linkedmash.com/upgrade?from=api_subscription_required_creator
headers:
RateLimit-Limit:
$ref: '#/components/headers/RateLimitLimit'
RateLimit-Remaining:
$ref: '#/components/headers/RateLimitRemaining'
RateLimit-Reset:
$ref: '#/components/headers/RateLimitReset'
X-RateLimit-Daily-Limit:
$ref: '#/components/headers/RateLimitDailyLimit'
X-RateLimit-Daily-Remaining:
$ref: '#/components/headers/RateLimitDailyRemaining'
X-RateLimit-Daily-Reset:
$ref: '#/components/headers/RateLimitDailyReset'
'500':
description: Server Error. Something failed on our side. The body carries message "Failed to upload media". Retry once; if it persists the request is not the problem.
headers:
RateLimit-Limit:
$ref: '#/components/headers/RateLimitLimit'
RateLimit-Remaining:
$ref: '#/components/headers/RateLimitRemaining'
RateLimit-Reset:
$ref: '#/components/headers/RateLimitReset'
X-RateLimit-Daily-Limit:
$ref: '#/components/headers/RateLimitDailyLimit'
X-RateLimit-Daily-Remaining:
$ref: '#/components/headers/RateLimitDailyRemaining'
X-RateLimit-Daily-Reset:
$ref: '#/components/headers/RateLimitDailyReset'
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
components:
schemas:
PaywallPrice:
type: object
properties:
amount:
type: integer
description: Price in minor units (cents).
interval:
type: string
enum:
- month
- year
display:
type: string
description: Human-readable price, e.g. "$14/mo".
PaymentRequiredResponse:
allOf:
- $ref: '#/components/schemas/ErrorResponse'
- type: object
description: 'Paywall detail carried on every 402. Additive: `status`, `code`, `error` and `upgrade_url` keep their previous meaning, so a client that ignores these fields behaves exactly as before.'
properties:
upgrade_url:
type: string
format: uri
description: Public pricing page. Always present; prefer `checkout_url`, which opens on the plan that lifts this block.
required_plan:
type: string
enum:
- reader
- creator
description: The plan that lifts this block and that `checkout_url` opens. Currently always `creator` (shown as Premium); `reader` is kept in the enum for older clients.
plan_name:
type: string
description: Display name of `required_plan`, e.g. "Premium".
unlocks:
type: array
items:
type: string
description: Stable capability ids that `required_plan` turns on, e.g. `vector_search`. Not marketing copy — safe to branch on.
price:
type: object
description: Price of `required_plan` in USD. /pricing localises currency, so treat this as the reference price rather than the amount that will be charged.
properties:
currency:
type: string
const: usd
monthly:
$ref: '#/components/schemas/PaywallPrice'
annual:
$ref: '#/components/schemas/PaywallPrice'
checkout_url:
type: string
format: uri
description: In-app upgrade URL that starts Stripe Checkout for `required_plan` (monthly) when opened by a signed-in human. Logged-out clicks fall back to /pricing. The API cannot mint a Stripe session for an API-key caller.
upgrade_source:
type: string
description: Identifier for the wall that was hit, carried as `?from=` on `checkout_url`.
upgrade:
type: object
description: Agent-facing upgrade guidance. Same facts as the flat paywall fields, nested so a model can surface why / what unlocks / where to go without parsing prose. Also present on 429 `FREE_TIER_DAILY_LIMIT`.
required:
- why
- unlocks
- url
properties:
why:
type: string
description: Human reason this request was refused.
unlocks:
type: array
items:
type: string
description: Stable capability ids a paid plan turns on.
url:
type: string
format: uri
description: https checkout URL for the plan that lifts this wall. Same value as `checkout_url`.
ErrorResponse:
type: object
description: LinkedMash API error envelope. 429 `FREE_TIER_DAILY_LIMIT` also includes the paywall `upgrade` object documented on PaymentRequiredResponse.
required:
- status
properties:
status:
type: boolean
const: false
code:
type: string
description: Stable machine-readable error code.
error:
type: string
description: Human-readable error message.
message:
type: string
description: Human-readable error message used by legacy endpoints.
anyOf:
- required:
- error
- required:
- message
headers:
RateLimitRemaining:
description: Requests remaining for the authenticated account in the current window.
schema:
type: integer
minimum: 0
RateLimitDailyRemaining:
description: Free-tier daily calls remaining in the current UTC day. Omitted for paid accounts.
schema:
type: integer
minimum: 0
RateLimitDailyLimit:
description: Free-tier daily API/MCP call quota for accounts without an active subscription. Omitted for paid accounts.
schema:
type: integer
example: 100
RateLimitDailyReset:
description: Unix timestamp of the next UTC midnight, when the free daily quota resets. Omitted for paid accounts.
schema:
type: integer
RateLimitReset:
description: Unix timestamp when the current fixed window resets.
schema:
type: integer
RateLimitLimit:
description: Maximum requests allowed in the current fixed window.
schema:
type: integer
example: 120
securitySchemes:
oauthClientCredentials:
type: oauth2
description: Short-lived, permission-scoped machine token using an existing LinkedMash API key id and secret as the confidential client credentials.
flows:
clientCredentials:
tokenUrl: https://api.linkedmash.com/auth/oauth/token
scopes:
library:read: Read saved posts, labels, authors, smart folders, memories, digests, and interests.
library:write: Manage labels, smart folders, memories, saved-post state, and interest corrections.
content:read: Read drafts, publishing queues, schedules, and media metadata.
content:write: Create, update, delete, schedule, and publish content or media.
analytics:read: Read account, post, and growth analytics.
exports:read: Read export job status.
exports:write: Create PDF, CSV, and JSON exports.
bearerAuth:
type: http
scheme: bearer
bearerFormat: LinkedMash API key
description: 'Pass a LinkedMash API key as `Authorization: Bearer <key>`.'
apiKeyHeader:
type: apiKey
in: header
name: linkedmash-api-key
description: Alternative header for clients that cannot set a Bearer authorization header.
externalDocs:
description: LinkedMash API documentation
url: https://www.linkedmash.com/api-docs/getting-started