# Use the studio API

Discover the installation contract and call the same operation exposed through MCP.

![Operation catalog](../media/api.webp)

On desktop, run `opensocial profile show` and copy the `origin` value into STUDIO in the example.

```sh
STUDIO=http://localhost:3000
curl -fsS "$STUDIO/api/v1/info"
curl -fsS "$STUDIO/api/v1/openapi.json"
curl -fsS -X POST "$STUDIO/api/v1/operations/accounts_list" \
  -H "Authorization: Bearer $OPENSOCIAL_TOKEN" \
  -H 'Content-Type: application/json' -d '{"verify":true}'
```

The REST example uses an already authorized delegation in the environment. Authenticated `GET /api/v1/catalog` describes every operation, scope, input and output. `POST /api/v1/operations/<name>` accepts the input object directly. In MCP use `tools/call` and read `structuredContent.result` for shared operations.

For a write, create a key for the intent and reuse it with identical arguments when retrying. Send `Idempotency-Key` in REST or `requestKey` in MCP arguments. For uploads, `media_begin` returns `id` and `uploadUrl`. PUT bytes with `Content-Type: application/octet-stream` to the returned URL and call `media_preview`. Retain IDs and keep temporary URLs and credentials private.

For pagination use `limit` and `offset` on supported operations. Inspect `code`, `message` and `operation` on failure. For HTTP 401 check the delegation. For 403 inspect role, scopes and authorized accounts. On version conflict reread the publication. Check an uncertain remote outcome at the provider before retrying.
