{
    "openapi": "3.1.0",
    "info": {
        "title": "Tibbie",
        "version": "1.0",
        "description": "REST API for managing posts and connections on Tibbie."
    },
    "servers": [
        {
            "url": "https://tibbie.co/api/v1"
        }
    ],
    "tags": [
        {
            "name": "Authentication"
        },
        {
            "name": "User"
        },
        {
            "name": "Connections"
        },
        {
            "name": "Posts"
        },
        {
            "name": "Media"
        }
    ],
    "paths": {
        "/auth/device/code": {
            "post": {
                "operationId": "deviceCode.store",
                "summary": "Request a device code",
                "tags": [
                    "Authentication"
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "scopes": {
                                        "type": [
                                            "array",
                                            "null"
                                        ],
                                        "items": {
                                            "type": "string"
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "device_code": {
                                            "type": "string"
                                        },
                                        "user_code": {
                                            "type": "string"
                                        },
                                        "verification_uri": {
                                            "type": "string"
                                        },
                                        "verification_uri_complete": {
                                            "type": "string"
                                        },
                                        "expires_in": {
                                            "type": "integer",
                                            "const": 900
                                        },
                                        "interval": {
                                            "type": "integer",
                                            "const": 5
                                        }
                                    },
                                    "required": [
                                        "device_code",
                                        "user_code",
                                        "verification_uri",
                                        "verification_uri_complete",
                                        "expires_in",
                                        "interval"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    }
                }
            }
        },
        "/auth/device/token": {
            "post": {
                "operationId": "deviceCode.token",
                "summary": "Exchange a device code for an access token",
                "tags": [
                    "Authentication"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "device_code": {
                                        "type": "string"
                                    }
                                },
                                "required": [
                                    "device_code"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "access_token": {
                                            "type": "string"
                                        },
                                        "token_type": {
                                            "type": "string",
                                            "const": "Bearer"
                                        },
                                        "user": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "string"
                                                },
                                                "name": {
                                                    "type": "string"
                                                },
                                                "email": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "id",
                                                "name",
                                                "email"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "access_token",
                                        "token_type",
                                        "user"
                                    ]
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "type": "object",
                                            "properties": {
                                                "error": {
                                                    "type": "string",
                                                    "const": "authorization_pending"
                                                },
                                                "error_description": {
                                                    "type": "string",
                                                    "const": "The authorization request is still pending."
                                                }
                                            },
                                            "required": [
                                                "error",
                                                "error_description"
                                            ]
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "error": {
                                                    "type": "string",
                                                    "const": "access_denied"
                                                },
                                                "error_description": {
                                                    "type": "string",
                                                    "const": "The user denied the authorization request."
                                                }
                                            },
                                            "required": [
                                                "error",
                                                "error_description"
                                            ]
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "error": {
                                                    "type": "string",
                                                    "const": "expired_token"
                                                },
                                                "error_description": {
                                                    "type": "string",
                                                    "const": "The device code has expired. Please restart the authorization process."
                                                }
                                            },
                                            "required": [
                                                "error",
                                                "error_description"
                                            ]
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "error": {
                                                    "type": "string",
                                                    "const": "invalid_device_code"
                                                },
                                                "error_description": {
                                                    "type": "string",
                                                    "const": "The device code is invalid or has expired."
                                                }
                                            },
                                            "required": [
                                                "error",
                                                "error_description"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    }
                }
            }
        },
        "/connections/connect/{platform}": {
            "post": {
                "operationId": "connectionOAuth.store",
                "summary": "Initiate a connection via OAuth",
                "tags": [
                    "Connections"
                ],
                "parameters": [
                    {
                        "name": "platform",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "state_token": {
                                            "type": "string"
                                        },
                                        "authorization_url": {
                                            "type": "string"
                                        },
                                        "expires_in": {
                                            "type": "integer",
                                            "const": 600
                                        },
                                        "poll_url": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "state_token",
                                        "authorization_url",
                                        "expires_in",
                                        "poll_url"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "error": {
                                            "type": "string",
                                            "const": "unsupported_platform"
                                        },
                                        "error_description": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "error",
                                        "error_description"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/connections/connect/{platform}/status/{stateToken}": {
            "get": {
                "operationId": "connectionOAuth.status",
                "summary": "Poll OAuth connection status",
                "tags": [
                    "Connections"
                ],
                "parameters": [
                    {
                        "name": "platform",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "stateToken",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "type": "object",
                                            "properties": {
                                                "status": {
                                                    "type": "string",
                                                    "const": "pending"
                                                },
                                                "expires_in": {
                                                    "type": "integer"
                                                }
                                            },
                                            "required": [
                                                "status",
                                                "expires_in"
                                            ]
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "status": {
                                                    "type": "string",
                                                    "const": "failed"
                                                }
                                            },
                                            "required": [
                                                "status"
                                            ]
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "status": {
                                                    "type": "string",
                                                    "const": "completed"
                                                },
                                                "connection": {
                                                    "type": [
                                                        "object",
                                                        "null"
                                                    ],
                                                    "properties": {
                                                        "id": {
                                                            "type": "integer"
                                                        },
                                                        "provider": {
                                                            "type": "string"
                                                        },
                                                        "username": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "display_name": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "avatar": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "needs_reconnection": {
                                                            "type": "boolean"
                                                        },
                                                        "created_at": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ],
                                                            "format": "date-time"
                                                        }
                                                    },
                                                    "required": [
                                                        "id",
                                                        "provider",
                                                        "username",
                                                        "display_name",
                                                        "avatar",
                                                        "needs_reconnection",
                                                        "created_at"
                                                    ]
                                                }
                                            },
                                            "required": [
                                                "status",
                                                "connection"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "410": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "error": {
                                            "type": "string",
                                            "const": "expired"
                                        },
                                        "error_description": {
                                            "type": "string",
                                            "const": "This connection request has expired. Please initiate a new one."
                                        }
                                    },
                                    "required": [
                                        "error",
                                        "error_description"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "error": {
                                            "type": "string",
                                            "const": "not_found"
                                        },
                                        "error_description": {
                                            "type": "string",
                                            "const": "Connection request not found."
                                        }
                                    },
                                    "required": [
                                        "error",
                                        "error_description"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/connections": {
            "get": {
                "operationId": "connection.index",
                "summary": "List all connections",
                "tags": [
                    "Connections"
                ],
                "parameters": [
                    {
                        "name": "provider",
                        "in": "query",
                        "schema": {
                            "type": [
                                "string",
                                "null"
                            ]
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "schema": {
                            "type": [
                                "string",
                                "null"
                            ],
                            "enum": [
                                "active",
                                "needs_reconnection"
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "string"
                                        }
                                    },
                                    "required": [
                                        "data"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/connections/{connection}": {
            "get": {
                "operationId": "connection.show",
                "summary": "Get a connection",
                "tags": [
                    "Connections"
                ],
                "parameters": [
                    {
                        "name": "connection",
                        "in": "path",
                        "required": true,
                        "description": "The connection ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "id": {
                                            "type": "integer"
                                        },
                                        "provider": {
                                            "type": "string"
                                        },
                                        "username": {
                                            "type": [
                                                "string",
                                                "null"
                                            ]
                                        },
                                        "display_name": {
                                            "type": [
                                                "string",
                                                "null"
                                            ]
                                        },
                                        "avatar": {
                                            "type": [
                                                "string",
                                                "null"
                                            ]
                                        },
                                        "needs_reconnection": {
                                            "type": "boolean"
                                        },
                                        "created_at": {
                                            "type": [
                                                "string",
                                                "null"
                                            ],
                                            "format": "date-time"
                                        },
                                        "meta": {
                                            "type": "array",
                                            "items": {}
                                        }
                                    },
                                    "required": [
                                        "id",
                                        "provider",
                                        "username",
                                        "display_name",
                                        "avatar",
                                        "needs_reconnection",
                                        "created_at",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            },
            "delete": {
                "operationId": "connection.destroy",
                "summary": "Disconnect an account",
                "tags": [
                    "Connections"
                ],
                "parameters": [
                    {
                        "name": "connection",
                        "in": "path",
                        "required": true,
                        "description": "The connection ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No content"
                    },
                    "422": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "error": {
                                            "type": "string",
                                            "const": "has_pending_posts"
                                        },
                                        "error_description": {
                                            "type": "string",
                                            "const": "This account has pending posts. Cancel or publish them first."
                                        }
                                    },
                                    "required": [
                                        "error",
                                        "error_description"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/media": {
            "post": {
                "operationId": "media.store",
                "description": "Returns a presigned upload URL for direct upload to storage, or fetches a file\nfrom the provided source URL. Supports images and videos.",
                "summary": "Request a media upload URL",
                "tags": [
                    "Media"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "mime_type": {
                                        "type": "string",
                                        "enum": [
                                            "image/jpeg",
                                            "image/png",
                                            "image/gif",
                                            "image/webp",
                                            "video/mp4",
                                            "video/quicktime"
                                        ]
                                    },
                                    "filename": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 255
                                    },
                                    "source_url": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "format": "uri",
                                        "maxLength": 2048
                                    }
                                },
                                "required": [
                                    "mime_type"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "type": "object",
                                            "properties": {
                                                "upload_url": {
                                                    "type": "string"
                                                },
                                                "upload_headers": {
                                                    "type": "string"
                                                },
                                                "path": {
                                                    "type": "string"
                                                },
                                                "expires_in": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "upload_url",
                                                "upload_headers",
                                                "path",
                                                "expires_in"
                                            ]
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "path": {
                                                    "type": "string"
                                                },
                                                "url": {
                                                    "type": "string"
                                                },
                                                "mime_type": {
                                                    "type": "string"
                                                },
                                                "size": {
                                                    "type": "integer"
                                                }
                                            },
                                            "required": [
                                                "path",
                                                "url",
                                                "mime_type",
                                                "size"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/posts": {
            "get": {
                "operationId": "post.index",
                "summary": "List all posts",
                "tags": [
                    "Posts"
                ],
                "parameters": [
                    {
                        "name": "status",
                        "in": "query",
                        "schema": {
                            "type": [
                                "string",
                                "null"
                            ],
                            "enum": [
                                "draft",
                                "scheduled",
                                "publishing",
                                "published",
                                "failed"
                            ]
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "schema": {
                            "type": [
                                "integer",
                                "null"
                            ],
                            "minimum": 1,
                            "maximum": 100
                        }
                    },
                    {
                        "name": "connection_id",
                        "in": "query",
                        "schema": {
                            "type": [
                                "integer",
                                "null"
                            ]
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "schema": {
                            "type": [
                                "string",
                                "null"
                            ],
                            "enum": [
                                "created_at",
                                "scheduled_at"
                            ]
                        }
                    },
                    {
                        "name": "order",
                        "in": "query",
                        "schema": {
                            "type": [
                                "string",
                                "null"
                            ],
                            "enum": [
                                "asc",
                                "desc"
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "content": {
                                                        "type": "string"
                                                    },
                                                    "status": {
                                                        "type": "string"
                                                    },
                                                    "scheduled_at": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ],
                                                        "format": "date-time"
                                                    },
                                                    "created_at": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ],
                                                        "format": "date-time"
                                                    },
                                                    "updated_at": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ],
                                                        "format": "date-time"
                                                    },
                                                    "creator": {
                                                        "type": [
                                                            "object",
                                                            "null"
                                                        ],
                                                        "properties": {
                                                            "id": {
                                                                "type": "integer"
                                                            },
                                                            "name": {
                                                                "type": "string"
                                                            }
                                                        },
                                                        "required": [
                                                            "id",
                                                            "name"
                                                        ]
                                                    },
                                                    "platforms": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "object",
                                                            "properties": {
                                                                "id": {
                                                                    "type": "integer"
                                                                },
                                                                "connected_account_id": {
                                                                    "type": "integer"
                                                                },
                                                                "provider": {
                                                                    "type": [
                                                                        "string",
                                                                        "null"
                                                                    ]
                                                                },
                                                                "username": {
                                                                    "type": [
                                                                        "string",
                                                                        "null"
                                                                    ]
                                                                },
                                                                "content": {
                                                                    "type": [
                                                                        "string",
                                                                        "null"
                                                                    ]
                                                                },
                                                                "status": {
                                                                    "type": "string"
                                                                },
                                                                "published_at": {
                                                                    "type": [
                                                                        "string",
                                                                        "null"
                                                                    ],
                                                                    "format": "date-time"
                                                                },
                                                                "platform_post_id": {
                                                                    "type": [
                                                                        "string",
                                                                        "null"
                                                                    ]
                                                                },
                                                                "error_message": {
                                                                    "type": [
                                                                        "string",
                                                                        "null"
                                                                    ]
                                                                }
                                                            },
                                                            "required": [
                                                                "id",
                                                                "connected_account_id",
                                                                "provider",
                                                                "username",
                                                                "content",
                                                                "status",
                                                                "published_at",
                                                                "platform_post_id",
                                                                "error_message"
                                                            ]
                                                        }
                                                    },
                                                    "media": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "object",
                                                            "properties": {
                                                                "id": {
                                                                    "type": "integer"
                                                                },
                                                                "url": {
                                                                    "type": "string"
                                                                },
                                                                "file_type": {
                                                                    "type": "string"
                                                                },
                                                                "mime_type": {
                                                                    "type": "string"
                                                                }
                                                            },
                                                            "required": [
                                                                "id",
                                                                "url",
                                                                "file_type",
                                                                "mime_type"
                                                            ]
                                                        }
                                                    }
                                                },
                                                "required": [
                                                    "id",
                                                    "content",
                                                    "status",
                                                    "scheduled_at",
                                                    "created_at",
                                                    "updated_at",
                                                    "creator",
                                                    "platforms",
                                                    "media"
                                                ]
                                            }
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "current_page": {
                                                    "type": "integer"
                                                },
                                                "last_page": {
                                                    "type": "integer"
                                                },
                                                "per_page": {
                                                    "type": "integer"
                                                },
                                                "total": {
                                                    "type": "integer"
                                                }
                                            },
                                            "required": [
                                                "current_page",
                                                "last_page",
                                                "per_page",
                                                "total"
                                            ]
                                        }
                                    },
                                    "required": [
                                        "data",
                                        "meta"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            },
            "post": {
                "operationId": "post.store",
                "summary": "Create a post",
                "tags": [
                    "Posts"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "content": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 10000
                                    },
                                    "scheduled_at": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "format": "date-time"
                                    },
                                    "media": {
                                        "type": [
                                            "array",
                                            "null"
                                        ],
                                        "items": {
                                            "type": "string"
                                        },
                                        "maxItems": 4
                                    },
                                    "platforms": {
                                        "type": "array",
                                        "items": {
                                            "type": "object",
                                            "properties": {
                                                "connected_account_id": {
                                                    "type": "integer"
                                                },
                                                "content": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "maxLength": 10000
                                                }
                                            },
                                            "required": [
                                                "connected_account_id"
                                            ]
                                        },
                                        "minItems": 1
                                    }
                                },
                                "required": [
                                    "platforms"
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "id": {
                                            "type": "integer"
                                        },
                                        "content": {
                                            "type": "string"
                                        },
                                        "status": {
                                            "type": "string"
                                        },
                                        "scheduled_at": {
                                            "type": [
                                                "string",
                                                "null"
                                            ],
                                            "format": "date-time"
                                        },
                                        "created_at": {
                                            "type": [
                                                "string",
                                                "null"
                                            ],
                                            "format": "date-time"
                                        },
                                        "updated_at": {
                                            "type": [
                                                "string",
                                                "null"
                                            ],
                                            "format": "date-time"
                                        },
                                        "creator": {
                                            "type": [
                                                "object",
                                                "null"
                                            ],
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "name": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "id",
                                                "name"
                                            ]
                                        },
                                        "platforms": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "connected_account_id": {
                                                        "type": "integer"
                                                    },
                                                    "provider": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "username": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "content": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "status": {
                                                        "type": "string"
                                                    },
                                                    "published_at": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ],
                                                        "format": "date-time"
                                                    },
                                                    "platform_post_id": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "error_message": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    }
                                                },
                                                "required": [
                                                    "id",
                                                    "connected_account_id",
                                                    "provider",
                                                    "username",
                                                    "content",
                                                    "status",
                                                    "published_at",
                                                    "platform_post_id",
                                                    "error_message"
                                                ]
                                            }
                                        },
                                        "media": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "url": {
                                                        "type": "string"
                                                    },
                                                    "file_type": {
                                                        "type": "string"
                                                    },
                                                    "mime_type": {
                                                        "type": "string"
                                                    }
                                                },
                                                "required": [
                                                    "id",
                                                    "url",
                                                    "file_type",
                                                    "mime_type"
                                                ]
                                            }
                                        }
                                    },
                                    "required": [
                                        "id",
                                        "content",
                                        "status",
                                        "scheduled_at",
                                        "created_at",
                                        "updated_at",
                                        "creator",
                                        "platforms",
                                        "media"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/posts/{post}": {
            "get": {
                "operationId": "post.show",
                "summary": "Get a post",
                "tags": [
                    "Posts"
                ],
                "parameters": [
                    {
                        "name": "post",
                        "in": "path",
                        "required": true,
                        "description": "The post ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "id": {
                                            "type": "integer"
                                        },
                                        "content": {
                                            "type": "string"
                                        },
                                        "status": {
                                            "type": "string"
                                        },
                                        "scheduled_at": {
                                            "type": [
                                                "string",
                                                "null"
                                            ],
                                            "format": "date-time"
                                        },
                                        "created_at": {
                                            "type": [
                                                "string",
                                                "null"
                                            ],
                                            "format": "date-time"
                                        },
                                        "updated_at": {
                                            "type": [
                                                "string",
                                                "null"
                                            ],
                                            "format": "date-time"
                                        },
                                        "creator": {
                                            "type": [
                                                "object",
                                                "null"
                                            ],
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "name": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "id",
                                                "name"
                                            ]
                                        },
                                        "platforms": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "connected_account_id": {
                                                        "type": "integer"
                                                    },
                                                    "provider": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "username": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "content": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "status": {
                                                        "type": "string"
                                                    },
                                                    "published_at": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ],
                                                        "format": "date-time"
                                                    },
                                                    "platform_post_id": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "error_message": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    }
                                                },
                                                "required": [
                                                    "id",
                                                    "connected_account_id",
                                                    "provider",
                                                    "username",
                                                    "content",
                                                    "status",
                                                    "published_at",
                                                    "platform_post_id",
                                                    "error_message"
                                                ]
                                            }
                                        },
                                        "media": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "url": {
                                                        "type": "string"
                                                    },
                                                    "file_type": {
                                                        "type": "string"
                                                    },
                                                    "mime_type": {
                                                        "type": "string"
                                                    }
                                                },
                                                "required": [
                                                    "id",
                                                    "url",
                                                    "file_type",
                                                    "mime_type"
                                                ]
                                            }
                                        }
                                    },
                                    "required": [
                                        "id",
                                        "content",
                                        "status",
                                        "scheduled_at",
                                        "created_at",
                                        "updated_at",
                                        "creator",
                                        "platforms",
                                        "media"
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            },
            "patch": {
                "operationId": "post.update",
                "summary": "Update a post",
                "tags": [
                    "Posts"
                ],
                "parameters": [
                    {
                        "name": "post",
                        "in": "path",
                        "required": true,
                        "description": "The post ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "content": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 10000
                                    },
                                    "scheduled_at": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "format": "date-time"
                                    },
                                    "media": {
                                        "type": [
                                            "array",
                                            "null"
                                        ],
                                        "items": {
                                            "type": "string"
                                        },
                                        "maxItems": 4
                                    },
                                    "platforms": {
                                        "type": [
                                            "array",
                                            "null"
                                        ],
                                        "items": {
                                            "type": "object",
                                            "properties": {
                                                "connected_account_id": {
                                                    "type": "integer"
                                                },
                                                "content": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "maxLength": 10000
                                                }
                                            },
                                            "required": [
                                                "connected_account_id"
                                            ]
                                        },
                                        "minItems": 1
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "id": {
                                            "type": "integer"
                                        },
                                        "content": {
                                            "type": "string"
                                        },
                                        "status": {
                                            "type": "string"
                                        },
                                        "scheduled_at": {
                                            "type": [
                                                "string",
                                                "null"
                                            ],
                                            "format": "date-time"
                                        },
                                        "created_at": {
                                            "type": [
                                                "string",
                                                "null"
                                            ],
                                            "format": "date-time"
                                        },
                                        "updated_at": {
                                            "type": [
                                                "string",
                                                "null"
                                            ],
                                            "format": "date-time"
                                        },
                                        "creator": {
                                            "type": [
                                                "object",
                                                "null"
                                            ],
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "name": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "id",
                                                "name"
                                            ]
                                        },
                                        "platforms": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "connected_account_id": {
                                                        "type": "integer"
                                                    },
                                                    "provider": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "username": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "content": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "status": {
                                                        "type": "string"
                                                    },
                                                    "published_at": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ],
                                                        "format": "date-time"
                                                    },
                                                    "platform_post_id": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "error_message": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    }
                                                },
                                                "required": [
                                                    "id",
                                                    "connected_account_id",
                                                    "provider",
                                                    "username",
                                                    "content",
                                                    "status",
                                                    "published_at",
                                                    "platform_post_id",
                                                    "error_message"
                                                ]
                                            }
                                        },
                                        "media": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "url": {
                                                        "type": "string"
                                                    },
                                                    "file_type": {
                                                        "type": "string"
                                                    },
                                                    "mime_type": {
                                                        "type": "string"
                                                    }
                                                },
                                                "required": [
                                                    "id",
                                                    "url",
                                                    "file_type",
                                                    "mime_type"
                                                ]
                                            }
                                        }
                                    },
                                    "required": [
                                        "id",
                                        "content",
                                        "status",
                                        "scheduled_at",
                                        "created_at",
                                        "updated_at",
                                        "creator",
                                        "platforms",
                                        "media"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/ValidationException"
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            },
            "delete": {
                "operationId": "post.destroy",
                "summary": "Delete a post",
                "tags": [
                    "Posts"
                ],
                "parameters": [
                    {
                        "name": "post",
                        "in": "path",
                        "required": true,
                        "description": "The post ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "204": {
                        "description": "No content"
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/posts/{post}/publish": {
            "post": {
                "operationId": "post.publish",
                "summary": "Publish a post",
                "tags": [
                    "Posts"
                ],
                "parameters": [
                    {
                        "name": "post",
                        "in": "path",
                        "required": true,
                        "description": "The post ID",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "id": {
                                            "type": "integer"
                                        },
                                        "content": {
                                            "type": "string"
                                        },
                                        "status": {
                                            "type": "string"
                                        },
                                        "scheduled_at": {
                                            "type": [
                                                "string",
                                                "null"
                                            ],
                                            "format": "date-time"
                                        },
                                        "created_at": {
                                            "type": [
                                                "string",
                                                "null"
                                            ],
                                            "format": "date-time"
                                        },
                                        "updated_at": {
                                            "type": [
                                                "string",
                                                "null"
                                            ],
                                            "format": "date-time"
                                        },
                                        "creator": {
                                            "type": [
                                                "object",
                                                "null"
                                            ],
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "name": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "id",
                                                "name"
                                            ]
                                        },
                                        "platforms": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "connected_account_id": {
                                                        "type": "integer"
                                                    },
                                                    "provider": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "username": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "content": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "status": {
                                                        "type": "string"
                                                    },
                                                    "published_at": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ],
                                                        "format": "date-time"
                                                    },
                                                    "platform_post_id": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "error_message": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    }
                                                },
                                                "required": [
                                                    "id",
                                                    "connected_account_id",
                                                    "provider",
                                                    "username",
                                                    "content",
                                                    "status",
                                                    "published_at",
                                                    "platform_post_id",
                                                    "error_message"
                                                ]
                                            }
                                        },
                                        "media": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "url": {
                                                        "type": "string"
                                                    },
                                                    "file_type": {
                                                        "type": "string"
                                                    },
                                                    "mime_type": {
                                                        "type": "string"
                                                    }
                                                },
                                                "required": [
                                                    "id",
                                                    "url",
                                                    "file_type",
                                                    "mime_type"
                                                ]
                                            }
                                        }
                                    },
                                    "required": [
                                        "id",
                                        "content",
                                        "status",
                                        "scheduled_at",
                                        "created_at",
                                        "updated_at",
                                        "creator",
                                        "platforms",
                                        "media"
                                    ]
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "anyOf": [
                                        {
                                            "type": "object",
                                            "properties": {
                                                "error": {
                                                    "type": "string"
                                                },
                                                "error_description": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "error",
                                                "error_description"
                                            ]
                                        },
                                        {
                                            "type": "object",
                                            "properties": {
                                                "error": {
                                                    "type": "string",
                                                    "const": "cannot_publish"
                                                },
                                                "error_description": {
                                                    "type": "string",
                                                    "const": "This post cannot be published."
                                                }
                                            },
                                            "required": [
                                                "error",
                                                "error_description"
                                            ]
                                        }
                                    ]
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/ModelNotFoundException"
                    },
                    "403": {
                        "$ref": "#/components/responses/AuthorizationException"
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        },
        "/user": {
            "get": {
                "operationId": "user.show",
                "summary": "Get the authenticated user",
                "tags": [
                    "User"
                ],
                "responses": {
                    "200": {
                        "description": "",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "id": {
                                            "type": "integer"
                                        },
                                        "name": {
                                            "type": "string"
                                        },
                                        "email": {
                                            "type": "string"
                                        },
                                        "avatar": {
                                            "type": "string"
                                        },
                                        "email_verified_at": {
                                            "type": [
                                                "string",
                                                "null"
                                            ],
                                            "format": "date-time"
                                        },
                                        "created_at": {
                                            "type": [
                                                "string",
                                                "null"
                                            ],
                                            "format": "date-time"
                                        }
                                    },
                                    "required": [
                                        "id",
                                        "name",
                                        "email",
                                        "avatar",
                                        "email_verified_at",
                                        "created_at"
                                    ]
                                }
                            }
                        }
                    },
                    "401": {
                        "$ref": "#/components/responses/AuthenticationException"
                    }
                }
            }
        }
    },
    "security": [
        {
            "bearerAuth": []
        }
    ],
    "components": {
        "securitySchemes": {
            "bearerAuth": {
                "type": "http",
                "scheme": "bearer"
            }
        },
        "responses": {
            "ValidationException": {
                "description": "Validation error",
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object",
                            "properties": {
                                "message": {
                                    "type": "string",
                                    "description": "Errors overview."
                                },
                                "errors": {
                                    "type": "object",
                                    "description": "A detailed description of each field that failed validation.",
                                    "additionalProperties": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        }
                                    }
                                }
                            },
                            "required": [
                                "message",
                                "errors"
                            ]
                        }
                    }
                }
            },
            "AuthenticationException": {
                "description": "Unauthenticated",
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object",
                            "properties": {
                                "message": {
                                    "type": "string",
                                    "description": "Error overview."
                                }
                            },
                            "required": [
                                "message"
                            ]
                        }
                    }
                }
            },
            "ModelNotFoundException": {
                "description": "Not found",
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object",
                            "properties": {
                                "message": {
                                    "type": "string",
                                    "description": "Error overview."
                                }
                            },
                            "required": [
                                "message"
                            ]
                        }
                    }
                }
            },
            "AuthorizationException": {
                "description": "Authorization error",
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object",
                            "properties": {
                                "message": {
                                    "type": "string",
                                    "description": "Error overview."
                                }
                            },
                            "required": [
                                "message"
                            ]
                        }
                    }
                }
            }
        }
    }
}