# Get Membership - View a Single Subscription via API

> Retrieve a single membership by ID for a Telegram or Discord subscription bot project.

Source: https://docs.botsubscription.com/api/memberships/get/

Fetch a single membership record by its ID, including the plan, start and end dates, and—for recurring memberships—the underlying subscription status.

<ApiEndpoint method="GET" endpoint="/v2/projects/{project_id}/memberships/{membership_id}" />

<ApiAuthorization type="Bearer API Key" />

**API key scope:** `memberships:read` (required for restricted keys).

<ApiSection title="Path Parameters">
  <ApiParameter name="project_id" type="string" required description="The unique identifier of the project." />
  <ApiParameter name="membership_id" type="string" required description="The unique identifier of the membership." />
</ApiSection>

<ApiSamplePane>

<ApiRequestSample title="Request">

```bash
curl -X GET "https://api.botsubscription.com/v2/projects/YOUR_PROJECT_ID/memberships/bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

```javascript
const project_id = 'YOUR_PROJECT_ID';
const membership_id = 'bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb';
const response = await fetch(`https://api.botsubscription.com/v2/projects/${project_id}/memberships/${membership_id}`, {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY'
  }
});
const data = await response.json();
```

```python
import requests

project_id = 'YOUR_PROJECT_ID'
membership_id = 'bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb'
response = requests.get(
    f'https://api.botsubscription.com/v2/projects/{project_id}/memberships/{membership_id}',
    headers={'Authorization': 'Bearer YOUR_API_KEY'}
)
data = response.json()
```

```php
$project_id = 'YOUR_PROJECT_ID';
$membership_id = 'bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.botsubscription.com/v2/projects/{$project_id}/memberships/{$membership_id}");
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer YOUR_API_KEY']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
```

</ApiRequestSample>

<ApiResponseTabs>
  <ApiResponse status={200} description="Success">

```json
{
  "ok": true,
  "request_id": "11111111-1111-1111-1111-111111111111",
  "method": "GET",
  "path": "/v2/projects/11111111-1111-4111-8111-111111111111/memberships/bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb",
  "code": 200,
  "data": {
    "user_id": "123456789012345678",
    "plan_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa",
    "membership_id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb",
    "payment_request_id": "cccccccc-cccc-cccc-cccc-cccccccccccc",
    "membership_start_date": "2025-12-29T10:32:27.560Z",
    "membership_end_date": "2026-01-12T10:32:27.560Z",
    "user_name": {
      "first_name": "John",
      "username": "johndoe"
    },
    "plan_name": "Silver",
    "plan_duration": "1 day",
    "subscription_id": null,
    "subscription_status": null,
    "access_token_id": null
  }
}
```

  </ApiResponse>
  <ApiResponse status={200} description="Membership without a finite end date">

```json
{
  "ok": true,
  "request_id": "11111111-1111-1111-1111-111111111111",
  "method": "GET",
  "path": "/v2/projects/11111111-1111-4111-8111-111111111111/memberships/bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb",
  "code": 200,
  "data": {
    "user_id": "123456789012345678",
    "plan_id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa",
    "membership_id": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb",
    "membership_start_date": "2025-12-29T10:32:27.560Z",
    "payment_request_id": null,
    "membership_end_date": null
  }
}
```

  </ApiResponse>
  <ApiResponse status={401} description="Not authorized to view this membership">

```json
{
  "ok": false,
  "request_id": "11111111-1111-1111-1111-111111111111",
  "method": "GET",
  "path": "/v2/projects/11111111-1111-4111-8111-111111111111/memberships/bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb",
  "code": 401,
  "error": {
    "error_code": "UNAUTHORIZED",
    "message": "You are not authorized to view this membership"
  }
}
```

  </ApiResponse>
  <ApiResponse status={404} description="Membership not found (admin callers only)">

```json
{
  "ok": false,
  "request_id": "11111111-1111-1111-1111-111111111111",
  "method": "GET",
  "path": "/v2/projects/11111111-1111-4111-8111-111111111111/memberships/bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb",
  "code": 404,
  "error": {
    "error_code": "NOT_FOUND",
    "message": "Membership not found"
  }
}
```

  </ApiResponse>
</ApiResponseTabs>

</ApiSamplePane>
