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

# API

> API reference for Twitter: every `twitter.api.*` operation with input and output types.

Every `twitter.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas.

<Info>
  **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling).
</Info>

## Tweets

### create

`tweets.create`

Post a new tweet

**Risk:** `write`

```ts theme={null}
await corsair.twitter.api.tweets.create({});
```

**Input**

| Name            | Type                                         | Required | Description                                      |
| --------------- | -------------------------------------------- | -------- | ------------------------------------------------ |
| `text`          | `string`                                     | Yes      | Tweet text content (max 280 weighted characters) |
| `quoteTweetId`  | `string`                                     | No       | ID of the tweet to quote                         |
| `mediaIds`      | `string[]`                                   | No       | Up to 4 media IDs to attach                      |
| `replySettings` | `following \| mentionedUsers \| subscribers` | No       | Restricts who can reply to this tweet            |

**Output**

| Name   | Type     | Required | Description |
| ------ | -------- | -------- | ----------- |
| `data` | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="data full type">
    ```ts theme={null}
    {
      id: string,
      text: string
    }
    ```
  </Accordion>
</AccordionGroup>

***

### createReply

`tweets.createReply`

Post a reply to an existing tweet

**Risk:** `write`

```ts theme={null}
await corsair.twitter.api.tweets.createReply({});
```

**Input**

| Name                  | Type       | Required | Description                                       |
| --------------------- | ---------- | -------- | ------------------------------------------------- |
| `text`                | `string`   | Yes      | Reply text content (max 280 weighted characters)  |
| `inReplyToTweetId`    | `string`   | Yes      | ID of the tweet to reply to                       |
| `excludeReplyUserIds` | `string[]` | No       | User IDs to exclude from @mentioning in the reply |

**Output**

| Name   | Type     | Required | Description |
| ------ | -------- | -------- | ----------- |
| `data` | `object` | No       | —           |

<AccordionGroup>
  <Accordion title="data full type">
    ```ts theme={null}
    {
      id: string,
      text: string
    }
    ```
  </Accordion>
</AccordionGroup>

***
