# Create a post (/zh/growsocmed/docs/api-reference/posts/create-post)

Create a post for one or more accounts, now or scheduled. Every account is checked first; one invalid account rejects the whole post.

POST /posts

```json
{
  "tags": [
    "Posts"
  ],
  "summary": "Create a post",
  "parameters": [
    {
      "schema": {
        "type": "string",
        "maxLength": 200
      },
      "required": false,
      "name": "idempotency-key",
      "in": "header"
    }
  ],
  "requestBody": {
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "properties": {
            "text": {
              "type": "string",
              "maxLength": 70000,
              "default": ""
            },
            "media_ids": {
              "type": "array",
              "items": {
                "type": "string",
                "format": "uuid"
              },
              "maxItems": 20,
              "default": []
            },
            "targets": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "account_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "text": {
                    "type": "string",
                    "maxLength": 70000
                  },
                  "media_ids": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "maxItems": 20
                  },
                  "options": {
                    "type": "object",
                    "additionalProperties": {}
                  }
                },
                "required": [
                  "account_id"
                ]
              },
              "minItems": 1,
              "maxItems": 50
            },
            "scheduled_at": {
              "type": "string",
              "format": "date-time"
            },
            "idea_id": {
              "type": "string",
              "format": "uuid"
            }
          },
          "required": [
            "targets"
          ]
        }
      }
    }
  },
  "responses": {
    "201": {
      "description": "Created",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "post": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string"
                  },
                  "text": {
                    "type": "string"
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "scheduled",
                      "publishing",
                      "published",
                      "partial",
                      "failed",
                      "canceled"
                    ]
                  },
                  "source": {
                    "type": "string"
                  },
                  "scheduled_at": {
                    "type": "string"
                  },
                  "created_at": {
                    "type": "string"
                  },
                  "created_by": {
                    "type": [
                      "object",
                      "null"
                    ],
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "id",
                      "name"
                    ]
                  },
                  "media": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "type": {
                          "type": "string",
                          "enum": [
                            "image",
                            "video",
                            "document"
                          ]
                        },
                        "url": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "id",
                        "type",
                        "url"
                      ]
                    }
                  },
                  "targets": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "account_id": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "platform": {
                          "type": "string"
                        },
                        "username": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "display_name": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "avatar_url": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "status": {
                          "type": "string",
                          "enum": [
                            "pending",
                            "publishing",
                            "published",
                            "failed",
                            "canceled"
                          ]
                        },
                        "text": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "media_ids": {
                          "type": [
                            "array",
                            "null"
                          ],
                          "items": {
                            "type": "string"
                          }
                        },
                        "permalink": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "error_code": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "error_message": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "published_at": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "options": {
                          "type": "object",
                          "additionalProperties": {}
                        }
                      },
                      "required": [
                        "id",
                        "account_id",
                        "platform",
                        "username",
                        "display_name",
                        "avatar_url",
                        "status",
                        "text",
                        "media_ids",
                        "permalink",
                        "error_code",
                        "error_message",
                        "published_at",
                        "options"
                      ]
                    }
                  }
                },
                "required": [
                  "id",
                  "text",
                  "status",
                  "source",
                  "scheduled_at",
                  "created_at",
                  "created_by",
                  "media",
                  "targets"
                ]
              },
              "replayed": {
                "type": "boolean"
              }
            },
            "required": [
              "post",
              "replayed"
            ]
          }
        }
      }
    }
  },
  "operationId": "create-post",
  "description": "Create a post for one or more accounts, now or scheduled. Every account is checked first; one invalid account rejects the whole post."
}
```