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

# Gérer les Publications

> Créer et supprimer des Publications pour le compte d'utilisateurs authentifiés

export const Button = ({href, children}) => {
  return <div className="not-prose group">
    <a href={href}>
      <button className="flex items-center space-x-2.5 py-1 px-4 bg-primary-dark dark:bg-white text-white dark:text-gray-950 rounded-full group-hover:opacity-[0.9] font-medium">
        <span>
          {children}
        </span>
        <svg width="3" height="24" viewBox="0 -9 3 24" class="h-6 rotate-0 overflow-visible"><path d="M0 0L3 3L0 6" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"></path></svg>
      </button>
    </a>
  </div>;
};

Les endpoints Manage Posts vous permettent de créer et de supprimer des Publications au nom d’utilisateurs authentifiés. Créez des applications qui publient du contenu, créent des fils de discussion ou gèrent les Publications des utilisateurs.

<div id="overview">
  ## Vue d’ensemble
</div>

<CardGroup cols={2}>
  <Card title="Créer une Publication" icon="pen">
    Publier une nouvelle Publication
  </Card>

  <Card title="Supprimer une Publication" icon="trash">
    Supprimer une Publication existante
  </Card>

  <Card title="Répondre" icon="reply">
    Répondre à une autre Publication
  </Card>

  <Card title="Citer" icon="quote-right">
    Citer une autre Publication
  </Card>
</CardGroup>

***

<div id="endpoints">
  ## Points de terminaison
</div>

| Méthode | Point de terminaison                           | Description                    |
| :------ | :--------------------------------------------- | :----------------------------- |
| POST    | [`/2/tweets`](/fr/x-api/posts/create-post)     | Créer une nouvelle Publication |
| DELETE  | [`/2/tweets/:id`](/fr/x-api/posts/delete-post) | Supprimer une Publication      |

***

<div id="creating-posts">
  ## Création de publications
</div>

<div id="basic-post">
  ### Publication simple
</div>

```bash theme={null}
curl -X POST "https://api.x.com/2/tweets" \
  -H "Authorization: Bearer $USER_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"text": "Hello from the API!"}'
```

<div id="reply-to-a-post">
  ### Répondre à une Publication
</div>

```bash theme={null}
curl -X POST "https://api.x.com/2/tweets" \
  -H "Authorization: Bearer $USER_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "This is a reply!",
    "reply": {
      "in_reply_to_tweet_id": "1234567890"
    }
  }'
```

<div id="quote-a-post">
  ### Citer une Publication
</div>

```bash theme={null}
curl -X POST "https://api.x.com/2/tweets" \
  -H "Authorization: Bearer $USER_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "Check this out!",
    "quote_tweet_id": "1234567890"
  }'
```

<div id="post-with-media">
  ### Publication avec média
</div>

```bash theme={null}
curl -X POST "https://api.x.com/2/tweets" \
  -H "Authorization: Bearer $USER_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "Photo of the day",
    "media": {
      "media_ids": ["1234567890123456789"]
    }
  }'
```

<Note>
  Chargez d'abord le média à l'aide du [Media Upload endpoint](/fr/x-api/media/quickstart/media-upload-chunked), puis faites référence au `media_id` dans votre Publication.
</Note>

<div id="post-with-poll">
  ### Publication contenant un sondage
</div>

```bash theme={null}
curl -X POST "https://api.x.com/2/tweets" \
  -H "Authorization: Bearer $USER_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "text": "What is your favorite color?",
    "poll": {
      "options": ["Red", "Blue", "Green", "Yellow"],
      "duration_minutes": 1440
    }
  }'
```

***

<div id="deleting-posts">
  ## Supprimer des publications
</div>

```bash theme={null}
curl -X DELETE "https://api.x.com/2/tweets/1234567890" \
  -H "Authorization: Bearer $USER_ACCESS_TOKEN"
```

<Warning>
  Vous ne pouvez supprimer que les Publications créées par l’utilisateur authentifié.
</Warning>

***

<div id="getting-started">
  ## Pour commencer
</div>

<Note>
  **Prérequis**

  * Un [compte développeur](https://developer.x.com/en/portal/petition/essential/basic-info) approuvé
  * Un [Project et une App](/fr/resources/fundamentals/developer-apps) dans la Console de développement
  * Des jetons d’accès utilisateur via [OAuth 2.0 PKCE](/fr/resources/fundamentals/authentication#oauth-2-0-authorization-code-flow-with-pkce-2) ou [OAuth à 3 volets](/fr/resources/fundamentals/authentication#obtaining-access-tokens-using-3-legged-oauth-flow)
</Note>

<CardGroup cols={2}>
  <Card title="Démarrage rapide" icon="rocket" href="/fr/x-api/posts/manage-tweets/quickstart">
    Créez votre première Publication
  </Card>

  <Card title="Guide d’intégration" icon="book" href="/fr/x-api/posts/manage-tweets/integrate">
    Concepts clés et bonnes pratiques
  </Card>

  <Card title="Téléversement de médias" icon="image" href="/fr/x-api/media/quickstart/media-upload-chunked">
    Téléversez des médias pour vos Publications
  </Card>

  <Card title="Référence de l’API" icon="code" href="/fr/x-api/posts/creation-of-a-post">
    Documentation complète de l’endpoint
  </Card>
</CardGroup>
