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

# Ajouter un flux RSS

> Ajoutez un nouveau flux RSS pour la publication automatisée de nouveaux articles

export const PlansAvailable = ({plans = [], maxPackRequired}) => {
  let displayPlans = plans;
  if (plans && plans.length === 1) {
    const lowerCasePlan = plans[0].toLowerCase();
    if (lowerCasePlan === "business") {
      displayPlans = ["Launch", "Business", "Enterprise"];
    } else if (lowerCasePlan === "premium") {
      displayPlans = ["Premium", "Launch", "Business", "Enterprise"];
    }
  }
  return <Note>
Available on {displayPlans.length === 1 ? "the " : ""}
{displayPlans.join(", ").replace(/\b\w/g, l => l.toUpperCase())}{" "}
{displayPlans.length > 1 ? "plans" : "plan"}.

{maxPackRequired && <span onClick={() => window.open('https://www.ayrshare.com/docs/additional/maxpack', '_self')} className="flex items-center mt-2 cursor-pointer">
 <span className="px-1.5 py-0.5 rounded text-sm" style={{
    backgroundColor: '#C264B6',
    color: 'white',
    fontSize: '12px'
  }}>
   Max Pack required
 </span>
</span>}
</Note>;
};

export const HeaderAPI = ({noProfileKey, profileKeyRequired}) => <>
    <ParamField header="Authorization" type="string" required>
      <a href="/apis/overview#authorization">API Key</a> of the Primary Profile.
      <br />
      <br />
      Format: <code>Authorization: Bearer API_KEY</code>
    </ParamField>
    {!noProfileKey && (profileKeyRequired ? <ParamField header="Profile-Key" type="string" required>
          <a href="/apis/overview#profile-key-format">Profile Key</a> of a User Profile.
          <br />
          <br />
          Format: <code>Profile-Key: PROFILE_KEY</code>
        </ParamField> : <ParamField header="Profile-Key" type="string">
          <a href="/apis/overview#profile-key-format">Profile Key</a> of a User Profile.
          <br />
          <br />
          Format: <code>Profile-Key: PROFILE_KEY</code>
        </ParamField>)}
  </>;

<PlansAvailable plans={["premium"]} maxPackRequired={false} />

Ajoutez un nouveau flux RSS pour la publication automatisée de nouveaux articles. Les publications seront automatiquement envoyées à vos comptes sociaux associés : Facebook, LinkedIn et Telegram. Également Instagram et Pinterest si une image valide peut être trouvée dans l'article.

<Warning>
  **X/Twitter n'est plus pris en charge pour les flux RSS.** À compter du 31 mars 2026, X exige vos propres identifiants d'API pour chaque requête, ce qui est incompatible avec la publication automatisée par RSS. Utilisez plutôt les [publications planifiées](/apis/post/overview#schedule-posts) ou les appels API directs avec vos [identifiants BYO](/dashboard/connect-social-accounts/x-twitter-byo-keys).
</Warning>

## Paramètres d'en-tête

<HeaderAPI />

## Paramètres du corps

<ParamField body="url" type="string" required>
  URL du flux RSS à ajouter.
</ParamField>

<ParamField body="useFirstImage" type="boolean" default={false}>
  Essayer d'obtenir la première image ou l'image principale de l'article et l'ajouter à la publication.
</ParamField>

<ParamField body="autoHashtag" type="boolean" default={false}>
  Ajouter automatiquement jusqu'à 3 hashtags au texte de la publication en fonction des mots-clés les plus pertinents.
</ParamField>

<ParamField body="type" type="string" default="rss">
  Valeur : `rss`, `substack` ou `youtube`.
</ParamField>

<ParamField body="platforms" type="array">
  Plateformes de réseaux sociaux sur lesquelles publier l'article. Si non fourni, la valeur par défaut est toutes les plateformes connectées. Plateformes disponibles :

  ```json theme={"system"}
  {
    "platforms": ["facebook", "instagram", 
      "linkedin", "pinterest"]
  }
  ```
</ParamField>

<RequestExample>
  ```javascript cURL theme={"system"}
  curl \
  -H "Authorization: Bearer API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"url": "https://www.nytimes.com"}' \
  -X POST https://api.ayrshare.com/api/feed
  ```

  ```javascript JavaScript theme={"system"}
  const API_KEY = "API_KEY";
  const url = "https:///www.nytimes.com";

  fetch("https://api.ayrshare.com/api/feed", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
      Authorization: `Bearer ${API_KEY}`
    },
    body: JSON.stringify({ url })
  })
    .then((res) => res.json())
    .then((json) => console.log(json))
    .catch(console.error);
  ```

  ```python Python theme={"system"}
  import requests

  payload = {'url': 'https://www.nytimes.com'}
  headers = {'Content-Type': 'application/json',
          'Authorization': 'Bearer API_KEY'}

  r = requests.post('https://api.ayrshare.com/api/feed',
      json=payload,
      headers=headers)

  print(r.json())
  ```

  ```php PHP theme={"system"}
  $curl = curl_init();

  $data = array (
      'url' => 'https://www.nytimes.com'
  );

  curl_setopt_array($curl, array(
    CURLOPT_URL => 'https://api.ayrshare.com/api/feed',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => '',
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 0,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_POSTFIELDS => http_build_query($data),
    CURLOPT_HTTPHEADER => array(
      'Authorization: Bearer API_KEY'
    ),
  ));

  $response = curl_exec($curl);

  curl_close($curl);
  echo $response;
  ```
</RequestExample>

<ResponseExample>
  ```json 200: Success theme={"system"}
  {
    "status": "success",
    "id": "4HZhptaD5",
    "title": "Pulte's Money and Life Thoughts",
    "websiteLink": "https://pulte.substack.com",
    "rssURL": "https://pulte.substack.com/feed"
  }
  ```

  ```json 400: Feed Already Exists theme={"system"}
  {
    "action": "create",
    "status": "error",
    "code": 303,
    "message": "The feed https://ruthreichl.substack.com/feed already exists.",
    "id": "TDW3oMDoI"
  }
  ```

  ```json 400: Invalid URL theme={"system"}
  {
    "action": "create",
    "status": "error",
    "code": 130,
    "message": "Something is wrong with the RSS feed URL. Please verify it."
  }
  ```
</ResponseExample>
