> ## 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.

# ArticlesClient

> Methods for X API v2 Articles endpoints.

Access **Articles** endpoints via `client.articles()` (`ArticlesClient`).

## Methods

| Method | Endpoint | Behavior | Summary |
| :- | :- | :- | :- |
| [`articleCreateDraft`](#articlecreatedraft) | `POST /2/articles/draft` | Standard | Create Draft Article |
| [`articlePublish`](#articlepublish) | `POST /2/articles/{article_id}/publish` | Standard | Publish Article |

## `articleCreateDraft`

POST `/2/articles/draft`

**Create Draft Article**

Creates a new Article draft that can later be published.

```java theme={null}
import com.x.xdk.Schemas;
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .accessToken(System.getenv("X_ACCESS_TOKEN"))
    .build();

var response = client.articles().articleCreateDraft(new Schemas.ArticleCreateDraftRequest().title("example"));
System.out.println(response);
```

### Parameters

**body** `Schemas.ArticleCreateDraftRequest` *required*

Create a draft Article.

**Returns:** `Schemas.ArticleCreateDraftResponse`

***

## `articlePublish`

POST `/2/articles/{article_id}/publish`

**Publish Article**

Publishes a draft Article, making it publicly visible.

```java theme={null}
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .accessToken(System.getenv("X_ACCESS_TOKEN"))
    .build();

var response = client.articles().articlePublish("1895000000000000000");
System.out.println(response);
```

### Parameters

**articleId** `String` *required*

`article_id` (path parameter).

**Returns:** `Schemas.ArticlePublishResponse`

***
