# Create a post (/reference/posts/create-post)

OpenAPI operation (components in https://api.tebar.app/v1/openapi.json):

```json
[
  {
    "operationId": "createPost",
    "tags": [
      "Posts"
    ],
    "summary": "Create a post",
    "description": "Publishes now, schedules (scheduled_at), or saves a draft. Each target can have its own content, media_ids, and platform options (targets[].options, see the *Options schemas). Validated against every target platform before anything is saved.\n\nRequires the write scope.",
    "parameters": [
      {
        "name": "Idempotency-Key",
        "in": "header",
        "required": false,
        "description": "1-128 characters of [A-Za-z0-9_-]. The same key and body returns the first response (200, Idempotent-Replayed: true); a different body returns 409 idempotency_conflict.",
        "schema": {
          "type": "string"
        }
      },
      {
        "$ref": "#/components/parameters/TebarProfile"
      }
    ],
    "requestBody": {
      "required": true,
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/CreatePostRequest"
          }
        }
      }
    },
    "responses": {
      "200": {
        "description": "Replayed by Idempotency-Key.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Post"
            }
          }
        }
      },
      "201": {
        "description": "The post.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Post"
            }
          }
        }
      },
      "400": {
        "$ref": "#/components/responses/BadRequest"
      },
      "401": {
        "$ref": "#/components/responses/Unauthorized"
      },
      "403": {
        "$ref": "#/components/responses/Forbidden"
      },
      "429": {
        "$ref": "#/components/responses/RateLimited"
      }
    }
  }
]
```