# Acquire or resume a registered player session

Source: https://recoupable.dev/docs/api-reference/complete/players/post-players-public-id-session

Internal transport for the trusted Recoup browser player. Without provider, returns only public release settings. With provider, validates parent and creates or resumes a signed, provider-bound listening session. No owner, fan profile or email is exposed. The embedding website should use returned embed URLs rather than calling this API or handling credentials.

## POST /api/players/public/{id}/session

Full OpenAPI specification: https://recoupable.dev/docs/spec/players.json

## Authentication

This operation's specification permits a request without authentication.

[Authentication guide](https://recoupable.dev/docs/authentication)

## Operation and referenced schemas

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Recoup API - Release Players",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://api.recoupable.dev"
    }
  ],
  "paths": {
    "/api/players/public/{id}/session": {
      "post": {
        "summary": "Acquire or resume a registered player session",
        "description": "Internal transport for the trusted Recoup browser player. Without provider, returns only public release settings. With provider, validates parent and creates or resumes a signed, provider-bound listening session. No owner, fan profile or email is exposed. The embedding website should use returned embed URLs rather than calling this API or handling credentials.",
        "security": [],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "PublicPlayerConfig fields returned by the release player service.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicPlayerConfig"
                }
              }
            }
          },
          "400": {
            "description": "Invalid input",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlayerError"
                }
              }
            }
          },
          "401": {
            "description": "Missing/invalid authentication or failed provider authorization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlayerError"
                }
              }
            }
          },
          "403": {
            "description": "Workspace, origin, or session access denied",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlayerError"
                }
              }
            }
          },
          "404": {
            "description": "Player not available",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlayerError"
                }
              }
            }
          },
          "429": {
            "description": "Request rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlayerError"
                }
              }
            }
          },
          "503": {
            "description": "Feature/configuration temporarily unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlayerError"
                }
              }
            }
          }
        },
        "operationId": "acquirePlayerSession",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "provider": {
                    "type": "string",
                    "enum": [
                      "spotify",
                      "apple_music"
                    ]
                  },
                  "parent": {
                    "type": "string",
                    "minLength": 1
                  },
                  "flow": {
                    "type": "string"
                  },
                  "source": {
                    "type": "string",
                    "maxLength": 100
                  },
                  "medium": {
                    "type": "string",
                    "maxLength": 100
                  },
                  "campaign": {
                    "type": "string",
                    "maxLength": 100
                  },
                  "content": {
                    "type": "string",
                    "maxLength": 100
                  }
                },
                "required": [
                  "provider",
                  "parent"
                ],
                "additionalProperties": false
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "PublicPlayerConfig": {
        "type": "object",
        "properties": {
          "playerId": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "artwork": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "spotifyUrl": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "appleUrl": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "revision": {
            "type": "integer",
            "minimum": 1
          },
          "provider": {
            "type": "string",
            "enum": [
              "spotify",
              "apple_music"
            ]
          },
          "release": {
            "type": "string",
            "format": "uri"
          },
          "sessionId": {
            "type": "string",
            "format": "uuid"
          },
          "flow": {
            "type": "string",
            "description": "Short-lived signed player capability; only the trusted Recoup player should handle this."
          },
          "spotify": {
            "type": "object",
            "properties": {
              "configured": {
                "type": "boolean"
              },
              "clientId": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "redirectUri": {
                "type": "string",
                "format": "uri"
              },
              "scopes": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": [
              "configured",
              "clientId",
              "redirectUri",
              "scopes"
            ]
          },
          "freePlayback": {
            "type": "string",
            "enum": [
              "spotify",
              "audio"
            ],
            "default": "spotify",
            "description": "Release-owner choice for verified Spotify Free accounts. spotify opens the configured Spotify release; audio plays a workspace-owned uploaded file. Premium continues using Spotify streaming."
          },
          "audioUrl": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "description": "Included only in provider-session responses. Configured uploaded audio is provided for Spotify sessions in audio mode; otherwise null. Not included in chooser metadata."
          }
        },
        "required": [
          "playerId",
          "name",
          "spotifyUrl",
          "appleUrl",
          "revision",
          "freePlayback"
        ]
      },
      "PlayerError": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          },
          "status": {
            "type": "string"
          }
        },
        "required": [
          "error"
        ]
      }
    }
  }
}
```
