> ## 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 |
| :- | :- | :- | :- |
| [`article_create_draft`](#article_create_draft) | `POST /2/articles/draft` | Standard | Create Draft Article |
| [`article_publish`](#article_publish) | `POST /2/articles/{article_id}/publish` | Standard | Publish Article |

## `article_create_draft`

POST `/2/articles/draft`

**Create Draft Article**

Creates a new Article draft that can later be published.

```ruby theme={null}
require "xdk"

client = Xdk::Client.new(access_token: ENV.fetch("X_ACCESS_TOKEN"))

response = client.articles.article_create_draft(
  body: { "title" => "example", "content_state" => { "blocks" => [{  }], "entities" => [{  }] } }
)
puts response
```

### Parameters

**body** `Hash` *required*

Create a draft Article.

**Returns:** `Hash`

***

## `article_publish`

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

**Publish Article**

Publishes a draft Article, making it publicly visible.

```ruby theme={null}
require "xdk"

client = Xdk::Client.new(access_token: ENV.fetch("X_ACCESS_TOKEN"))

response = client.articles.article_publish(article_id: "1895000000000000000")
puts response
```

### Parameters

**article\_id** `String` *required*

`article_id` (path parameter).

**Returns:** `Hash`

***
