> ## Documentation Index
> Fetch the complete documentation index at: https://docs.x.com/llms.txt
> Use this file to discover all available pages before exploring further.

# API Reference

> Client and method reference for the C# XDK (XDevPlatform.Xdk v0.1.2).

Client setup and method reference for `XDevPlatform.Xdk` `v0.1.2`.

> [card] [NuGet](https://www.nuget.org/packages/XDevPlatform.Xdk)
>
> `XDevPlatform.Xdk` `v0.1.2` · .NET 8.0+

> [card] [GitHub](https://github.com/xdevplatform/xdk-csharp)
>
> Source code and issues.

## Installation

```bash theme={null}
dotnet add package XDevPlatform.Xdk
```

## `XClient` Initialization

```csharp theme={null}
using System;
using Xdk;

using var client = new XClient(new XClientOptions
{
    BearerToken = Environment.GetEnvironmentVariable("X_BEARER_TOKEN"),
});
```

**BearerToken** `string?`

OAuth 2.0 Bearer Token for app-only endpoints.

**AccessToken** `string?`

OAuth 2.0 user-context access token.

**OAuth2** `OAuth2Pkce?`

`OAuth2Pkce` instance supporting PKCE code exchange and token refresh.

**OAuth1** `OAuth1?`

`OAuth1` instance for OAuth 1.0a HMAC-SHA1 signing.

**BaseUrl** `string` (default: [https://api.x.com](https://api.x.com))

Base URL for X API requests (`XClient` implements `IDisposable`).

## Clients

| Resource | Accessor | Client Class | Operations |
| :- | :- | :- | -: |
| [Account](https://docs.x.com/xdks/csharp/reference/clients/account.md) | `client.Account` | `AccountClient` | 2 |
| [Account Activity](https://docs.x.com/xdks/csharp/reference/clients/account-activity.md) | `client.AccountActivity` | `AccountActivityClient` | 5 |
| [Activity](https://docs.x.com/xdks/csharp/reference/clients/activity.md) | `client.Activity` | `ActivityClient` | 5 |
| [Articles](https://docs.x.com/xdks/csharp/reference/clients/articles.md) | `client.Articles` | `ArticlesClient` | 2 |
| [Bots](https://docs.x.com/xdks/csharp/reference/clients/bots.md) | `client.Bots` | `BotsClient` | 6 |
| [Broadcasts](https://docs.x.com/xdks/csharp/reference/clients/broadcasts.md) | `client.Broadcasts` | `BroadcastsClient` | 41 |
| [Calls](https://docs.x.com/xdks/csharp/reference/clients/calls.md) | `client.Calls` | `CallsClient` | 10 |
| [Chat](https://docs.x.com/xdks/csharp/reference/clients/chat.md) | `client.Chat` | `ChatClient` | 45 |
| [Communities](https://docs.x.com/xdks/csharp/reference/clients/communities.md) | `client.Communities` | `CommunitiesClient` | 2 |
| [Community Notes](https://docs.x.com/xdks/csharp/reference/clients/community-notes.md) | `client.CommunityNotes` | `CommunityNotesClient` | 5 |
| [Compliance](https://docs.x.com/xdks/csharp/reference/clients/compliance.md) | `client.Compliance` | `ComplianceClient` | 6 |
| [Connections](https://docs.x.com/xdks/csharp/reference/clients/connections.md) | `client.Connections` | `ConnectionsClient` | 4 |
| [Direct Messages](https://docs.x.com/xdks/csharp/reference/clients/direct-messages.md) | `client.DirectMessages` | `DirectMessagesClient` | 9 |
| [General](https://docs.x.com/xdks/csharp/reference/clients/general.md) | `client.General` | `GeneralClient` | 1 |
| [Lists](https://docs.x.com/xdks/csharp/reference/clients/lists.md) | `client.Lists` | `ListsClient` | 9 |
| [Media](https://docs.x.com/xdks/csharp/reference/clients/media.md) | `client.Media` | `MediaClient` | 19 |
| [News](https://docs.x.com/xdks/csharp/reference/clients/news.md) | `client.News` | `NewsClient` | 2 |
| [Posts](https://docs.x.com/xdks/csharp/reference/clients/posts.md) | `client.Posts` | `PostsClient` | 17 |
| [Spaces](https://docs.x.com/xdks/csharp/reference/clients/spaces.md) | `client.Spaces` | `SpacesClient` | 6 |
| [Stream](https://docs.x.com/xdks/csharp/reference/clients/stream.md) | `client.Stream` | `StreamClient` | 18 |
| [Trends](https://docs.x.com/xdks/csharp/reference/clients/trends.md) | `client.Trends` | `TrendsClient` | 3 |
| [Usage](https://docs.x.com/xdks/csharp/reference/clients/usage.md) | `client.Usage` | `UsageClient` | 2 |
| [Users](https://docs.x.com/xdks/csharp/reference/clients/users.md) | `client.Users` | `UsersClient` | 46 |
| [Webhooks](https://docs.x.com/xdks/csharp/reference/clients/webhooks.md) | `client.Webhooks` | `WebhooksClient` | 8 |
