Creates a new post for a specified profile (gym or user).
| Permission | Description |
|---|---|
posts.create | Create posts for your own profiles |
| Name | Type | Required | Description | Example |
|---|---|---|---|---|
| profile_type | string | Yes | Type of the profile (gym or user) | "user" |
| profile_id | int | Yes | ID of the profile to post to | 42 |
| title | string | Yes | Title of the post (max 255 characters) | "My Workout" |
| content | string | Yes | Content of the post (max 255 characters) | "Did squats..." |
| is_draft | bool | No | Whether the post is a draft | false |
{
"profile_type": "user",
"profile_id": 42,
"title": "My Workout",
"content": "Did squats and deadlifts.",
"is_draft": false
}
Returns the created post resource.
{
"post": {
"id": 123,
"profile_type": "App\\Models\\User",
"profile_id": 42,
"title": "My Workout",
"content": "Did squats and deadlifts.",
"is_draft": false
}
}
For a full schema, see Post Resource.
| Status | Description | Reference |
|---|---|---|
| 422 | Validation error | Validation error |
| 401 | Unauthorized | Authentication error |
| 403 | Forbidden (no permission) | Permission error |