---
title: Your First API Call
url: https://docs.kaltura.com/docs/getting-started/general/api-first-call
---

## Your First API Call

Generate a KS and list your content:

```bash
# Step 1: Generate a Kaltura Session
# (In production, use AppTokens instead — see AppTokens Guide)
curl -X POST "$KALTURA_SERVICE_URL/service/session/action/start" \
  -d "format=1" \
  -d "partnerId=$KALTURA_PARTNER_ID" \
  -d "secret=$KALTURA_ADMIN_SECRET" \
  -d "type=2" \
  -d "userId=$KALTURA_USER_ID"
# Response: the KS string — save it as $KALTURA_KS

# Step 2: List media entries
curl -X POST "$KALTURA_SERVICE_URL/service/media/action/list" \
  -d "ks=$KALTURA_KS" \
  -d "format=1" \
  -d "pager[pageSize]=5"
```

The response includes `objects` (array of entries) and `totalCount`:

```json
{
  "objects": [
    {
      "id": "1_abc12345",
      "name": "My Video",
      "mediaType": 1,
      "status": 2,
      "duration": 120,
      "objectType": "KalturaMediaEntry"
    }
  ],
  "totalCount": 42,
  "objectType": "KalturaMediaListResponse"
}
```
