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

# Edit post

> Create posts for all supported platforms. It is possible to create customized posts per channel by using the same platform account IDs in a request and hitting the create post API multiple times with 

Create posts for all supported platforms. It is possible to create customized posts per channel by using the same platform account IDs in a request and hitting the create post API multiple times with different summaries and account IDs per platform.

The content and media limitations, as well as platform rate limiters corresponding to the respective platforms, are provided in the following reference link:

Link: [Platform Limitations](https://help.leadconnectorhq.com/support/solutions/articles/48001240003-social-planner-image-video-content-and-api-limitations "Social Planner Help")

```http theme={null}
PUT https://services.leadconnectorhq.com/social-media-posting/{locationId}/posts/{id}
```

## Autorización

<ParamField header="Authorization" type="string" required>
  Bearer token generado desde el portal Leadway. Ver [Autenticación](/authentication).
</ParamField>

<ParamField header="Version" type="string" required default="2021-07-28">
  Versión de la API.
</ParamField>

## Path parameters

<ParamField path="locationId" type="string" required default="ve9EPM428h8vShlRW1KT">
  Account Id
</ParamField>

<ParamField path="id" type="string" required default="65fac446d599990d1313c1dd">
  Post Id
</ParamField>

## Body

<ParamField body="accountIds" type="string[]">
  Account Ids
</ParamField>

<ParamField body="summary" type="string" default="Hello World">
  Post Content
  The limitations of content as per the platforms is provided through the reference link in API description
</ParamField>

<ParamField body="media" type="object[]">
  Post Media Data
  The limitations of media as per the platforms is provided through the reference link in API description

  <Expandable title="cada item">
    <ParamField body="url" type="string" required default="https://i0.wp.com/www.lifeofanarchitect.com/wp-content/uploads/2021/10/architectural-model-making-stairs.jpg" />

    <ParamField body="caption" type="string" default="Caption 1" />

    <ParamField body="type" type="string" default="video/mp4 or image/png" />

    <ParamField body="thumbnail" type="string" default="https://storage.googleapis.com/test/test/media/test.jpeg" />

    <ParamField body="defaultThumb" type="string" default="https://storage.googleapis.com/test/test/media/test.jpeg" />

    <ParamField body="id" type="string" default="Edf3323fsfsdsd" />
  </Expandable>
</ParamField>

<ParamField body="status" type="object" default="draft">
  Status must be one of the following values: in\_progress, draft, failed, published, scheduled, in\_review, notification\_sent, deleted
</ParamField>

<ParamField body="scheduleDate" type="string">
  Schedule Date
</ParamField>

<ParamField body="createdBy" type="string">
  Created By
</ParamField>

<ParamField body="followUpComment" type="string" default="First comment">
  Follow Up Comment on platform. It is not allowed on Tiktok and GMB accounts and there is a limit of 280 charecters for twitter account
</ParamField>

<ParamField body="ogTagsDetails" type="object">
  Og Tags Meta Data
</ParamField>

<ParamField body="type" type="object" required default="post">
  Post Type must be one of the following values: - post, story, reel
</ParamField>

<ParamField body="postApprovalDetails" type="object">
  Post Approval Details
</ParamField>

<ParamField body="scheduleTimeUpdated" type="boolean" default="True">
  if schedule datetime is updated
</ParamField>

<ParamField body="tags" type="string[]">
  Array of Tag Value
</ParamField>

<ParamField body="categoryId" type="string">
  Category Id
</ParamField>

<ParamField body="tiktokPostDetails" type="object">
  Tiktok Post Details
</ParamField>

<ParamField body="gmbPostDetails" type="object">
  GMB Post Details
</ParamField>

<ParamField body="userId" type="string" default="sdfdsfdsfEWEsdfsdsW32dd">
  User ID
</ParamField>

## Respuestas

<Accordion title="200 - Successful response">
  <ResponseField name="success" type="boolean" required default="True">
    Success or Failure
  </ResponseField>

  <ResponseField name="statusCode" type="number" required default="200">
    Status Code
  </ResponseField>

  <ResponseField name="message" type="string" required default="Updated Post">
    Message
  </ResponseField>

  ```json theme={null}
  {
    "success": true,
    "statusCode": 200,
    "message": "Updated Post"
  }
  ```
</Accordion>

<Accordion title="400 - Bad Request">
  ```json theme={null}
  {}
  ```
</Accordion>

<Accordion title="401 - Unauthorized">
  ```json theme={null}
  {}
  ```
</Accordion>

<Accordion title="422 - Unprocessable Entity">
  ```json theme={null}
  {}
  ```
</Accordion>

## Ejemplo

<CodeGroup>
  ```bash cURL theme={null}
  curl -X PUT 'https://services.leadconnectorhq.com/social-media-posting/YOUR_locationId/posts/YOUR_id' \
    -H 'Authorization: Bearer YOUR_TOKEN' \
    -H 'Version: 2021-07-28' \
    -H 'Content-Type: application/json' \
    -d '{
    "accountIds": [
      "aF3KhyL8JIuBwzK3m7Ly_iVrVJ2uoXNF0wzcBzgl5_12554616564525983496"
    ],
    "summary": "Hello World",
    "media": [
      {
        "url": "https://i0.wp.com/www.lifeofanarchitect.com/wp-content/uploads/2021/10/architectural-model-making-stairs.jpg",
        "caption": "Caption 1",
        "type": "video/mp4 or image/png",
        "thumbnail": "https://storage.googleapis.com/test/test/media/test.jpeg",
        "defaultThumb": "https://storage.googleapis.com/test/test/media/test.jpeg",
        "id": "Edf3323fsfsdsd"
      }
    ],
    "status": "draft",
    "scheduleDate": "string",
    "createdBy": "string",
    "followUpComment": "First comment",
    "type": "post",
    "scheduleTimeUpdated": true,
    "tags": [
      "Tag1"
    ],
    "categoryId": "string",
    "userId": "sdfdsfdsfEWEsdfsdsW32dd"
  }'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch('https://services.leadconnectorhq.com/social-media-posting/YOUR_locationId/posts/YOUR_id', {
    method: 'PUT',
    headers: {
      Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
      Version: '2021-07-28',
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({"accountIds": ["aF3KhyL8JIuBwzK3m7Ly_iVrVJ2uoXNF0wzcBzgl5_12554616564525983496"], "summary": "Hello World", "media": [{"url": "https://i0.wp.com/www.lifeofanarchitect.com/wp-content/uploads/2021/10/architectural-model-making-stairs.jpg", "caption": "Caption 1", "type": "video/mp4 or image/png", "thumbnail": "https://storage.googleapis.com/test/test/media/test.jpeg", "defaultThumb": "https://storage.googleapis.com/test/test/media/test.jpeg", "id": "Edf3323fsfsdsd"}], "status": "draft", "scheduleDate": "string", "createdBy": "string", "followUpComment": "First comment", "type": "post", "scheduleTimeUpdated": true, "tags": ["Tag1"], "categoryId": "string", "userId": "sdfdsfdsfEWEsdfsdsW32dd"}),
  });
  const data = await response.json();
  ```

  ```python Python theme={null}
  import os, requests
  response = requests.request(
      'PUT',
      'https://services.leadconnectorhq.com/social-media-posting/YOUR_locationId/posts/YOUR_id',
      headers={
          'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
          'Version': '2021-07-28',
          'Content-Type': 'application/json',
      },
      json={"accountIds": ["aF3KhyL8JIuBwzK3m7Ly_iVrVJ2uoXNF0wzcBzgl5_12554616564525983496"], "summary": "Hello World", "media": [{"url": "https://i0.wp.com/www.lifeofanarchitect.com/wp-content/uploads/2021/10/architectural-model-making-stairs.jpg", "caption": "Caption 1", "type": "video/mp4 or image/png", "thumbnail": "https://storage.googleapis.com/test/test/media/test.jpeg", "defaultThumb": "https://storage.googleapis.com/test/test/media/test.jpeg", "id": "Edf3323fsfsdsd"}], "status": "draft", "scheduleDate": "string", "createdBy": "string", "followUpComment": "First comment", "type": "post", "scheduleTimeUpdated": true, "tags": ["Tag1"], "categoryId": "string", "userId": "sdfdsfdsfEWEsdfsdsW32dd"},
  )
  data = response.json()
  ```

  ```php PHP theme={null}
  <?php
  $ch = curl_init('https://services.leadconnectorhq.com/social-media-posting/YOUR_locationId/posts/YOUR_id');
  curl_setopt_array($ch, [
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_CUSTOMREQUEST => 'PUT',
      CURLOPT_HTTPHEADER => [
          'Authorization: Bearer ' . getenv('LEADWAY_TOKEN'),
          'Version: 2021-07-28',
          'Content-Type: application/json',
      ],
      CURLOPT_POSTFIELDS => json_encode({'accountIds': ['aF3KhyL8JIuBwzK3m7Ly_iVrVJ2uoXNF0wzcBzgl5_12554616564525983496'], 'summary': 'Hello World', 'media': [{'url': 'https://i0.wp.com/www.lifeofanarchitect.com/wp-content/uploads/2021/10/architectural-model-making-stairs.jpg', 'caption': 'Caption 1', 'type': 'video/mp4 or image/png', 'thumbnail': 'https://storage.googleapis.com/test/test/media/test.jpeg', 'defaultThumb': 'https://storage.googleapis.com/test/test/media/test.jpeg', 'id': 'Edf3323fsfsdsd'}], 'status': 'draft', 'scheduleDate': 'string', 'createdBy': 'string', 'followUpComment': 'First comment', 'type': 'post', 'scheduleTimeUpdated': true, 'tags': ['Tag1'], 'categoryId': 'string', 'userId': 'sdfdsfdsfEWEsdfsdsW32dd'}),
  ]);
  $data = json_decode(curl_exec($ch), true);
  ```
</CodeGroup>
