`https://lumail.io/api/v1/subscribers/{subscriber}`

Retrieves a specific subscriber by ID or email address with their associated tags and custom fields.

## Response

- **Success (200 OK)** - Returns the subscriber object with their data.
- **Error (404 Not Found)** - Returned if the subscriber does not exist.

## Response Fields

| Field                    | Type           | Description                                                           |
| ------------------------ | -------------- | --------------------------------------------------------------------- |
| `success`                | boolean        | Indicates if the operation was successful                             |
| `subscriber`             | object         | The subscriber object with all its properties                         |
| `subscriber.id`          | string         | Unique identifier for the subscriber                                  |
| `subscriber.email`       | string         | Email address of the subscriber                                       |
| `subscriber.name`        | string or null | Name of the subscriber (if provided)                                  |
| `subscriber.phone`       | string or null | Phone number of the subscriber (if provided)                          |
| `subscriber.status`      | string         | Current status of the subscriber (e.g., "SUBSCRIBED", "UNSUBSCRIBED") |
| `subscriber.tags`        | array          | Array of tag objects associated with the subscriber                   |
| `subscriber.tags[].id`   | string         | Unique identifier for the tag                                         |
| `subscriber.tags[].name` | string         | Name of the tag                                                       |
| `subscriber.fields`      | object         | Custom field values associated with this subscriber                   |

## Request Schema

No request body is required for this endpoint. Use either the subscriber's unique ID or email address in the URL path.

## Usage Example

Use this API endpoint to retrieve detailed information about a specific subscriber, which can help you:

- Display subscriber profile information in your application
- Check a subscriber's current subscription status
- View which tags have been assigned to a subscriber
- Access custom field values for personalization
- Verify subscriber information before making updates


## API Reference
**Method:** GET
**Endpoint:** /api/v1/subscribers/{subscriber}

### SDK
```ts
import { Lumail } from "lumail";
const lumail = new Lumail({ apiKey: "YOUR_API_TOKEN" });

// Get by subscriber ID
const { subscriber } = await lumail.subscribers.get("sub_TTYPR5tWDh");

// Or by email
const { subscriber: sub } = await lumail.subscribers.get("subscriber@example.com");
console.log(sub);
```

### cURL
```bash
curl -X GET https://lumail.io/api/v1/subscribers/sub_TTYPR5tWDh \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json"

# Or using email
curl -X GET https://lumail.io/api/v1/subscribers/subscriber@example.com \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json"
```

### JavaScript
```javascript
// Using subscriber ID
const response = await fetch('https://lumail.io/api/v1/subscribers/sub_TTYPR5tWDh', {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer YOUR_API_TOKEN',
    'Content-Type': 'application/json',
  },
});

const data = await response.json();
console.log(data);

// Or using email
const responseByEmail = await fetch('https://lumail.io/api/v1/subscribers/subscriber@example.com', {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer YOUR_API_TOKEN',
    'Content-Type': 'application/json',
  },
});

const dataByEmail = await responseByEmail.json();
console.log(dataByEmail);
```

### Python
```python
import requests

# Using subscriber ID
url = "https://lumail.io/api/v1/subscribers/sub_TTYPR5tWDh"
headers = {
    "Authorization": "Bearer YOUR_API_TOKEN",
    "Content-Type": "application/json"
}

response = requests.get(url, headers=headers)
data = response.json()
print(data)

# Or using email
url_email = "https://lumail.io/api/v1/subscribers/subscriber@example.com"
response_email = requests.get(url_email, headers=headers)
data_email = response_email.json()
print(data_email)
```

### Success Response
```json
{
  "success": true,
  "subscriber": {
    "id": "sub_TTYPR5tWDh",
    "email": "subscriber@example.com",
    "name": "John Doe",
    "phone": "+1234567890",
    "status": "SUBSCRIBED",
    "tags": [
      {
        "id": "tag_JqaddtEx7z",
        "name": "newsletter"
      },
      {
        "id": "tag_rdEPhyjnfA",
        "name": "promotional"
      }
    ],
    "fields": {
      "city": "New York",
      "company": "Acme Inc"
    }
  }
}
```

### Error Response
```json
{
  "message": "Subscriber not found"
}
```
