# Create post

## Create a scheduled or a draft post

> Returns an id of the post

```json
{"openapi":"3.1.0","info":{"title":"Ocoya API","version":"1.1.0"},"servers":[{"url":"https://app.ocoya.com/api/_public/v1"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-Key"}}},"paths":{"/post":{"post":{"summary":"Create a scheduled or a draft post","description":"Returns an id of the post","parameters":[{"in":"query","name":"workspaceId","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"oneOf":[{"type":"object","required":["caption","mediaUrls"],"properties":{"caption":{"type":"string"},"mediaUrls":{"type":"array"},"socialProfileIds":{"type":"array"},"scheduledAt":{"type":"string"}}},{"type":"object","required":["caption"],"properties":{"caption":{"type":"string"},"socialProfileIds":{"type":"array"},"scheduledAt":{"type":"string"}}},{"type":"object","required":["mediaUrls"],"properties":{"mediaUrls":{"type":"array"},"socialProfileIds":{"type":"array"},"scheduledAt":{"type":"string"}}}]}}}},"responses":{"201":{"description":"Created"},"500":{"description":"Unknown error"}}}}}}
```

### Body parameters explained

<table data-full-width="true"><thead><tr><th width="179">Parameter</th><th width="125">Type</th><th width="197">Required</th><th>Information</th></tr></thead><tbody><tr><td>caption</td><td>string</td><td>yes (if mediaUrls not provided)</td><td>Up to 10,000 characters</td></tr><tr><td>mediaUrls</td><td>array of strings</td><td>yes (if caption not provided)</td><td>URL list of the media (must follow <a href="../../fundamentals/limitations/url-file-limitations">URL file limitations</a>)</td></tr><tr><td>socialProfileIds</td><td>array of strings</td><td>no</td><td>If no ids provided, creates post as a draft</td></tr><tr><td>scheduledAt</td><td>string</td><td>no</td><td>Date of the schedule (must follow <a href="../../fundamentals/limitations/date-limitations">Date limitations</a>)</td></tr></tbody></table>

### Sample response

{% code lineNumbers="true" fullWidth="true" expandable="true" %}

```json
{
    "postGroupId": "clg07n1us0002998kbzmp7zc7",
}
```

{% endcode %}

### Response parameters

<table data-full-width="true"><thead><tr><th width="184">Parameter</th><th width="125">Type</th><th>Description</th></tr></thead><tbody><tr><td>postGroupId</td><td>string</td><td>Id of the created post</td></tr></tbody></table>
