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

# Beitrag aktualisieren

> Metadaten eines geplanten Beitrags aktualisieren

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>)}
  </>;

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>;
};

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

Aktualisieren Sie das `scheduleDate` eines Beitrags, den `approval`-Status eines Beitrags, `notes` oder die `visibility` eines veröffentlichten YouTube-Videos.

<ul class="custom-bullets">
  <li>
    Der Beitrag muss ursprünglich ein `scheduleDate` besitzen und einen `status` von „pending" haben. Der `status`
    lässt sich über die Endpunkte /history oder GET /post prüfen.
  </li>

  <li>Das YouTube-Video muss erfolgreich veröffentlicht worden sein, um die Sichtbarkeit zu ändern.</li>

  <li>
    Der [Freigabe-Workflow](/apis/post/post#approval-workflow) erfordert, dass sich der Beitrag aktuell im Status
    „awaiting approval" befindet.
  </li>
</ul>

Weitere Parameter können nicht aktualisiert werden. Sie müssen den Beitrag löschen und neu erstellen.

## Header-Parameter

<HeaderAPI noProfileKey={false} />

## Body-Parameter

<ParamField path="id" type="string" required>
  Ayrshare-Post-ID des zu aktualisierenden Beitrags. Die Ayrshare-Post-ID wird von [/post](/apis/post/post) zurückgegeben.
</ParamField>

<ParamField path="approved" type="boolean" default={false}>
  Der ursprüngliche Beitrag erfordert eine Freigabe und hat den Status „awaiting approval". Setzen Sie auf `true`, um
  den Beitrag zu genehmigen und zu veröffentlichen.
</ParamField>

<ParamField path="disableComments" type="boolean" default={false}>
  Kommentare zu einem Beitrag aktivieren oder deaktivieren. Der Wert `true` deaktiviert Kommentare. Der Wert `false` aktiviert Kommentare.

  Unterstützte Plattformen: Instagram und LinkedIn.

  <ul className="custom-bullets">
    <li>Aktivieren oder Deaktivieren ist sowohl bei geplanten als auch bei veröffentlichten Beiträgen möglich.</li>
    <li>Das Deaktivieren von Kommentaren bei einem veröffentlichten Beitrag löscht keine vorhandenen Kommentare.</li>
    <li>Das Deaktivieren von LinkedIn-Kommentaren löscht alle vorhandenen Kommentare im Thread.</li>
    <li>Instagram-Kommentare werden nicht gelöscht.</li>
    <li>TikTok-Kommentare können nach der Veröffentlichung nicht mehr geändert werden.</li>
  </ul>
</ParamField>

<ParamField path="notes" type="string">
  Setzen Sie Notizen zu einem Beitrag, die über den [/history](/apis/history)-Endpunkt abgerufen werden können. Notizen
  dienen nur als Referenz und wirken sich nicht auf den Beitrag aus.
</ParamField>

<ParamField path="scheduleDate" type="string">
  Das `datetime`, für das ein zukünftiger Beitrag geplant werden soll. Akzeptiert eine UTC-Datum/-Uhrzeit.

  Verwenden Sie z. B. das Format `YYYY-MM-DDThh:mm:ssZ` und senden Sie `2026-07-08T12:30:00Z`.
  Weitere Beispiele finden Sie unter [utctime](https://www.utctime.net/).

  <Warning>Liegt das Datum/die Uhrzeit in der Vergangenheit, wird der Beitrag sofort gesendet.</Warning>
</ParamField>

<ParamField path="scheduledPause" type="boolean" default={false}>
  Pausieren Sie einen geplanten Beitrag oder heben Sie die Pause auf. Wird die Pause aufgehoben und das `scheduleDate` liegt in der Vergangenheit,
  wird der Beitrag sofort veröffentlicht. Ziehen Sie in Erwägung, das `scheduleDate` vor dem Aufheben der Pause zu aktualisieren.
</ParamField>

<ParamField path="youTubeOptions" type="object">
  Aktualisieren Sie die Sichtbarkeit des YouTube-Videos mit dem Feld `visibility` und den Werten `unlisted`, `private` oder `public`.

  Aktualisieren Sie `description`, `title` oder `categoryId`. Sind ursprünglich keine `description` oder `categoryId` gesetzt, gelten die Standardwerte `""` bzw. `24` (Entertainment).
</ParamField>

<RequestExample>
  ```bash cURL theme={"system"}
  curl \
  -H "Authorization: Bearer API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"id": "s8k2jsk0pl", "scheduleDate": "2023-07-08T12:30:00Z", scheduledPause: true}' \
  -X PATCH https://api.ayrshare.com/api/post
  ```

  ```javascript JavaScript theme={"system"}
  const API_KEY = "API_KEY";

  fetch("https://api.ayrshare.com/api/post", {
        method: "PATCH",
        headers: {
          "Content-Type": "application/json",
          "Authorization": `Bearer ${API_KEY}`
        },
        body: JSON.stringify({
          id: "s8k2jsk0pl", // required
          scheduleDate: "2023-07-08T12:30:00Z",
          scheduledPause: true
        }),
      })
        .then((res) => res.json())
        .then((json) => console.log(json))
        .catch(console.error);
  ```

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

  payload = {'id': 's8k2jsk0pl',
          'scheduleDate': '2023-07-08T12:30:00Z'}
  headers = {'Content-Type': 'application/json',
          'Authorization': 'Bearer API_KEY'}

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

  print(r.json())
  ```

  ```php PHP theme={"system"}
  <?php

  $apiUrl = 'https://api.ayrshare.com/api/post';
  $apiKey = 'API_KEY';  // Replace 'API_KEY' with your actual API key

  $headers = [
      'Content-Type: application/json',
      'Authorization: Bearer ' . $apiKey,
  ];

  $data = json_encode([
      'id' => 's8k2jsk0pl',  // Replace with your actual post ID
      'scheduleDate' => '2023-07-08T12:30:00Z'
  ]);

  $curl = curl_init($apiUrl);
  curl_setopt_array($curl, [
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_CUSTOMREQUEST => 'PUT',
      CURLOPT_HTTPHEADER => $headers,
      CURLOPT_POSTFIELDS => $data
  ]);

  $response = curl_exec($curl);

  if ($response === false) {
      echo 'Curl error: ' . curl_error($curl);
  } else {
      echo json_encode(json_decode($response), JSON_PRETTY_PRINT);
  }

  curl_close($curl);
  ```

  ```csharp C# theme={"system"}
  using System;
  using System.Net.Http;
  using System.Text;
  using System.Threading.Tasks;

  namespace PostUpdatePOSTRequest_csharp
  {
      class PostUpdate
      {
          static async Task Main(string[] args)
          {
              string API_KEY = "API_KEY";
              string url = "https://api.ayrshare.com/api/post";

              using (var httpClient = new HttpClient())
              {
                  try
                  {
                      httpClient.DefaultRequestHeaders.Add("Authorization", "Bearer " + API_KEY);

                      string json = "{\"id\":\"s8k2jsk0pl\"," +
                                  "\"scheduleDate\":\"2023-07-08T12:30:00Z\"}";

                      var content = new StringContent(json, Encoding.UTF8, "application/json");

                      var response = await httpClient.PatchAsync(url, content);
                      var responseBody = await response.Content.ReadAsStringAsync();

                      response.EnsureSuccessStatusCode();
                      Console.WriteLine(responseBody);
                  }
                  catch (HttpRequestException ex)
                  {
                      Console.WriteLine("Error: " + ex.Message);
                      if (ex.InnerException != null)
                      {
                          Console.WriteLine("Error details: " + ex.InnerException.Message);
                      }
                  }
              }
          }
      }
  }
  ```

  ```go Go theme={"system"}
  package main

  import (
  	"bytes"
  	"encoding/json"
  	"log"
  	"net/http"
  )

  func main() {
  	message := map[string]interface{}{
  		"id": "s8k2jsk0pl",
  		"scheduleDate": "2023-07-08T12:30:00Z"
  	}

  	bytesRepresentation, err := json.Marshal(message)
  	if err != nil {
  		log.Fatalln(err)
  	}

  	req, _ := http.NewRequest("PATCH", "https://api.ayrshare.com/api/post",
  		bytes.NewBuffer(bytesRepresentation))

  	req.Header.Add("Content-Type", "application/json; charset=UTF-8")
  	req.Header.Add("Authorization", "Bearer API_KEY")

  	res, err := http.DefaultClient.Do(req)
  	if err != nil {
  		log.Fatal("Error:", err)
  	}

  	res.Body.Close()
  }
  ```
</RequestExample>

<ResponseExample>
  ```json 200: Success theme={"system"}
  {
      "status": "success",
      "id": "ZSU1tnnuykDy25wA6kvX", // Ayrshare Post ID
      "scheduleDate": "2025-07-08T12:30:00Z",
      "scheduledPaused": true
  }
  ```

  ```json 400: ID Not Found theme={"system"}
  {
      "action": "update",
      "status": "error",
      "code": 305,
      "message": "Error updating post. Post ID not found."
  }on
  ```

  ```json 400: Invalid scheduleDate theme={"system"}
  {
    "action": "post",
    "status": "error",
    "code": 104,
    "message": "Invalid schedule date format for scheduleDate. .../ayrshare.com/rest-api/endpoints/post#send-a-post"
  }
  ```
</ResponseExample>
