Skip to content

Share a track

Create a public share link for a track. Returns 201 Created with the share record, including the raw token shown once. Only the track's creator may share it.

POSThttps://api.aitronos.com/v1/music/{organization_id}/tracks/{track_id}/share

The raw token and its url are returned only on creation — only a hash is stored, so the token cannot be retrieved later. A non-owner receives 404. The request body is optional; defaults apply when omitted.

Path parameters

organization_id string required

The organization the track is scoped to. The caller must belong to it.

track_id string required

The track id to share (mtrack_-prefixed).

Request Body

visibility string optional · Defaults to link_only

Share visibility. One of link_only (only people with the link can open it) or public.

expires_in_days integer optional

Number of days until the link expires (minimum 1). Values above 90 are clamped to 90. Omit for a link that never expires.

Returns

A share link object.

id string · Share link id (mslink_-prefixed).

token string · The raw share token. Shown only once — only its hash is stored.

url string · Public URL that opens the share without signing in.

target_type string · track.

visibility string · link_only or public.

expires_at string · When the link expires (UTC), or null for never.

created_at string · When the link was created (UTC).

cURL
curl -X POST "https://api.aitronos.com/v1/music/org_abc123/tracks/mtrack_b4d9e1c6a72f/share" \
  -H "X-API-Key: $FREDDY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "visibility": "link_only", "expires_in_days": 30 }'

Response:

201 Created
{
  "id": "mslink_3a7f2c9e8b14",
  "token": "shr_9f3a2b7c1e4d6a8f0b2c4d6e8f1a3b5c",
  "url": "https://api.aitronos.com/v1/music/shared/shr_9f3a2b7c1e4d6a8f0b2c4d6e8f1a3b5c",
  "target_type": "track",
  "visibility": "link_only",
  "expires_at": "2026-07-28T10:30:00Z",
  "created_at": "2026-06-28T10:30:00Z"
}