{"openapi":"3.1.0","info":{"title":"Swell Customer API","version":"1.0.0","description":"Programmatically manage Swell workspaces, connected accounts, posts, tracked links, and analytics with workspace-scoped API keys."},"servers":[{"url":"https://api.growonswell.com/v1"}],"paths":{"/v1/workspace":{"get":{"tags":["Customer API"],"summary":"Get the current workspace","description":"Returns the workspace identity associated with the API key.","operationId":"customer_api_workspace_v1_workspace_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiWorkspaceOut"}}}},"401":{"description":"API key is missing, malformed, revoked, or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicApiError"}}}},"402":{"description":"The API key owner must select a plan before making API calls.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicApiError"}}}},"403":{"description":"The API key lacks the required scope or workspace access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicApiError"}}}},"429":{"description":"The API key exceeded its request rate limit.","headers":{"Retry-After":{"description":"Seconds until the current rate-limit window resets.","schema":{"type":"integer"}},"X-RateLimit-Limit":{"description":"Allowed requests in the current window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests remaining in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix timestamp when the current window resets.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicApiError"}}}}},"security":[{"SwellApiKey":[]}]}},"/v1/social-accounts":{"get":{"tags":["Customer API"],"summary":"List connected social accounts","description":"Returns social accounts that can be referenced by post and tracked-link API calls.","operationId":"customer_api_social_accounts_v1_social_accounts_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/SocialAccountOut"},"type":"array","title":"Response Customer Api Social Accounts V1 Social Accounts Get"}}}},"401":{"description":"API key is missing, malformed, revoked, or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicApiError"}}}},"402":{"description":"The API key owner must select a plan before making API calls.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicApiError"}}}},"403":{"description":"The API key lacks the required scope or workspace access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicApiError"}}}},"429":{"description":"The API key exceeded its request rate limit.","headers":{"Retry-After":{"description":"Seconds until the current rate-limit window resets.","schema":{"type":"integer"}},"X-RateLimit-Limit":{"description":"Allowed requests in the current window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests remaining in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix timestamp when the current window resets.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicApiError"}}}}},"security":[{"SwellApiKey":[]}]}},"/v1/media":{"get":{"tags":["Customer API"],"summary":"List media assets","description":"Returns recent workspace media assets that can be referenced by post API calls.","operationId":"customer_api_media_v1_media_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":100,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/MediaAssetOut"},"title":"Response Customer Api Media V1 Media Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"API key is missing, malformed, revoked, or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicApiError"}}}},"402":{"description":"The API key owner must select a plan before making API calls.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicApiError"}}}},"403":{"description":"The API key lacks the required scope or workspace access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicApiError"}}}},"429":{"description":"The API key exceeded its request rate limit.","headers":{"Retry-After":{"description":"Seconds until the current rate-limit window resets.","schema":{"type":"integer"}},"X-RateLimit-Limit":{"description":"Allowed requests in the current window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests remaining in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix timestamp when the current window resets.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicApiError"}}}}},"security":[{"SwellApiKey":[]}]},"post":{"tags":["Customer API"],"summary":"Upload media","description":"Uploads a JPG, PNG, MP4, or MOV asset that can be attached to posts.","operationId":"customer_api_upload_media_v1_media_post","requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_customer_api_upload_media_v1_media_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MediaAssetOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"API key is missing, malformed, revoked, or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicApiError"}}}},"402":{"description":"The API key owner must select a plan before making API calls.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicApiError"}}}},"403":{"description":"The API key lacks the required scope or workspace access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicApiError"}}}},"429":{"description":"The API key exceeded its request rate limit.","headers":{"Retry-After":{"description":"Seconds until the current rate-limit window resets.","schema":{"type":"integer"}},"X-RateLimit-Limit":{"description":"Allowed requests in the current window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests remaining in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix timestamp when the current window resets.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicApiError"}}}}},"security":[{"SwellApiKey":[]}]}},"/v1/media/{media_id}/file":{"get":{"tags":["Customer API"],"summary":"Download media","description":"Downloads a workspace media file by ID.","operationId":"customer_api_media_file_v1_media__media_id__file_get","parameters":[{"name":"media_id","in":"path","required":true,"schema":{"type":"integer","title":"Media Id"}}],"responses":{"200":{"description":"Media file bytes.","content":{"application/json":{"schema":{}},"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"API key is missing, malformed, revoked, or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicApiError"}}}},"402":{"description":"The API key owner must select a plan before making API calls.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicApiError"}}}},"403":{"description":"The API key lacks the required scope or workspace access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicApiError"}}}},"429":{"description":"The API key exceeded its request rate limit.","headers":{"Retry-After":{"description":"Seconds until the current rate-limit window resets.","schema":{"type":"integer"}},"X-RateLimit-Limit":{"description":"Allowed requests in the current window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests remaining in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix timestamp when the current window resets.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicApiError"}}}}},"security":[{"SwellApiKey":[]}]}},"/v1/posts":{"get":{"tags":["Customer API"],"summary":"List posts","description":"Returns recent workspace posts, optionally filtered by status.","operationId":"customer_api_posts_v1_posts_get","parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":100,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PostOut"},"title":"Response Customer Api Posts V1 Posts Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"API key is missing, malformed, revoked, or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicApiError"}}}},"402":{"description":"The API key owner must select a plan before making API calls.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicApiError"}}}},"403":{"description":"The API key lacks the required scope or workspace access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicApiError"}}}},"429":{"description":"The API key exceeded its request rate limit.","headers":{"Retry-After":{"description":"Seconds until the current rate-limit window resets.","schema":{"type":"integer"}},"X-RateLimit-Limit":{"description":"Allowed requests in the current window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests remaining in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix timestamp when the current window resets.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicApiError"}}}}},"security":[{"SwellApiKey":[]}]},"post":{"tags":["Customer API"],"summary":"Create a post","description":"Creates a draft post using the same validation and response model as the Swell app composer.","operationId":"customer_api_create_post_v1_posts_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"API key is missing, malformed, revoked, or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicApiError"}}}},"402":{"description":"The API key owner must select a plan before making API calls.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicApiError"}}}},"403":{"description":"The API key lacks the required scope or workspace access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicApiError"}}}},"429":{"description":"The API key exceeded its request rate limit.","headers":{"Retry-After":{"description":"Seconds until the current rate-limit window resets.","schema":{"type":"integer"}},"X-RateLimit-Limit":{"description":"Allowed requests in the current window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests remaining in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix timestamp when the current window resets.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicApiError"}}}}},"security":[{"SwellApiKey":[]}]}},"/v1/posts/{post_id}":{"get":{"tags":["Customer API"],"summary":"Get a post","description":"Returns a single workspace post by ID.","operationId":"customer_api_post_v1_posts__post_id__get","parameters":[{"name":"post_id","in":"path","required":true,"schema":{"type":"integer","title":"Post Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"API key is missing, malformed, revoked, or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicApiError"}}}},"402":{"description":"The API key owner must select a plan before making API calls.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicApiError"}}}},"403":{"description":"The API key lacks the required scope or workspace access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicApiError"}}}},"429":{"description":"The API key exceeded its request rate limit.","headers":{"Retry-After":{"description":"Seconds until the current rate-limit window resets.","schema":{"type":"integer"}},"X-RateLimit-Limit":{"description":"Allowed requests in the current window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests remaining in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix timestamp when the current window resets.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicApiError"}}}}},"security":[{"SwellApiKey":[]}]},"patch":{"tags":["Customer API"],"summary":"Update a post","description":"Updates an editable draft or scheduled post.","operationId":"customer_api_update_post_v1_posts__post_id__patch","parameters":[{"name":"post_id","in":"path","required":true,"schema":{"type":"integer","title":"Post Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"API key is missing, malformed, revoked, or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicApiError"}}}},"402":{"description":"The API key owner must select a plan before making API calls.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicApiError"}}}},"403":{"description":"The API key lacks the required scope or workspace access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicApiError"}}}},"429":{"description":"The API key exceeded its request rate limit.","headers":{"Retry-After":{"description":"Seconds until the current rate-limit window resets.","schema":{"type":"integer"}},"X-RateLimit-Limit":{"description":"Allowed requests in the current window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests remaining in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix timestamp when the current window resets.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicApiError"}}}}},"security":[{"SwellApiKey":[]}]}},"/v1/posts/{post_id}/schedule":{"post":{"tags":["Customer API"],"summary":"Schedule a post","description":"Schedules a draft or failed post for future publishing after the same readiness checks used by the app.","operationId":"customer_api_schedule_post_v1_posts__post_id__schedule_post","parameters":[{"name":"post_id","in":"path","required":true,"schema":{"type":"integer","title":"Post Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduleRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"API key is missing, malformed, revoked, or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicApiError"}}}},"402":{"description":"The API key owner must select a plan before making API calls.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicApiError"}}}},"403":{"description":"The API key lacks the required scope or workspace access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicApiError"}}}},"429":{"description":"The API key exceeded its request rate limit.","headers":{"Retry-After":{"description":"Seconds until the current rate-limit window resets.","schema":{"type":"integer"}},"X-RateLimit-Limit":{"description":"Allowed requests in the current window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests remaining in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix timestamp when the current window resets.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicApiError"}}}}},"security":[{"SwellApiKey":[]}]}},"/v1/posts/{post_id}/reschedule":{"post":{"tags":["Customer API"],"summary":"Reschedule a post","description":"Moves a scheduled or failed post to a new future publish time.","operationId":"customer_api_reschedule_post_v1_posts__post_id__reschedule_post","parameters":[{"name":"post_id","in":"path","required":true,"schema":{"type":"integer","title":"Post Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduleRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"API key is missing, malformed, revoked, or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicApiError"}}}},"402":{"description":"The API key owner must select a plan before making API calls.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicApiError"}}}},"403":{"description":"The API key lacks the required scope or workspace access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicApiError"}}}},"429":{"description":"The API key exceeded its request rate limit.","headers":{"Retry-After":{"description":"Seconds until the current rate-limit window resets.","schema":{"type":"integer"}},"X-RateLimit-Limit":{"description":"Allowed requests in the current window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests remaining in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix timestamp when the current window resets.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicApiError"}}}}},"security":[{"SwellApiKey":[]}]}},"/v1/posts/{post_id}/unschedule":{"post":{"tags":["Customer API"],"summary":"Unschedule a post","description":"Clears a scheduled post and returns it to draft status.","operationId":"customer_api_unschedule_post_v1_posts__post_id__unschedule_post","parameters":[{"name":"post_id","in":"path","required":true,"schema":{"type":"integer","title":"Post Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"API key is missing, malformed, revoked, or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicApiError"}}}},"402":{"description":"The API key owner must select a plan before making API calls.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicApiError"}}}},"403":{"description":"The API key lacks the required scope or workspace access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicApiError"}}}},"429":{"description":"The API key exceeded its request rate limit.","headers":{"Retry-After":{"description":"Seconds until the current rate-limit window resets.","schema":{"type":"integer"}},"X-RateLimit-Limit":{"description":"Allowed requests in the current window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests remaining in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix timestamp when the current window resets.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicApiError"}}}}},"security":[{"SwellApiKey":[]}]}},"/v1/posts/{post_id}/archive":{"post":{"tags":["Customer API"],"summary":"Archive a post","description":"Archives a draft, scheduled, or failed post.","operationId":"customer_api_archive_post_v1_posts__post_id__archive_post","parameters":[{"name":"post_id","in":"path","required":true,"schema":{"type":"integer","title":"Post Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"API key is missing, malformed, revoked, or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicApiError"}}}},"402":{"description":"The API key owner must select a plan before making API calls.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicApiError"}}}},"403":{"description":"The API key lacks the required scope or workspace access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicApiError"}}}},"429":{"description":"The API key exceeded its request rate limit.","headers":{"Retry-After":{"description":"Seconds until the current rate-limit window resets.","schema":{"type":"integer"}},"X-RateLimit-Limit":{"description":"Allowed requests in the current window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests remaining in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix timestamp when the current window resets.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicApiError"}}}}},"security":[{"SwellApiKey":[]}]}},"/v1/links":{"get":{"tags":["Customer API"],"summary":"List tracked links","description":"Returns tracked links for the workspace.","operationId":"customer_api_links_v1_links_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/TrackedLinkOut"},"type":"array","title":"Response Customer Api Links V1 Links Get"}}}},"401":{"description":"API key is missing, malformed, revoked, or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicApiError"}}}},"402":{"description":"The API key owner must select a plan before making API calls.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicApiError"}}}},"403":{"description":"The API key lacks the required scope or workspace access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicApiError"}}}},"429":{"description":"The API key exceeded its request rate limit.","headers":{"Retry-After":{"description":"Seconds until the current rate-limit window resets.","schema":{"type":"integer"}},"X-RateLimit-Limit":{"description":"Allowed requests in the current window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests remaining in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix timestamp when the current window resets.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicApiError"}}}}},"security":[{"SwellApiKey":[]}]},"post":{"tags":["Customer API"],"summary":"Create a tracked link","description":"Creates a tracked campaign link with UTM attribution parameters.","operationId":"customer_api_create_link_v1_links_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrackedLinkCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrackedLinkOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"API key is missing, malformed, revoked, or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicApiError"}}}},"402":{"description":"The API key owner must select a plan before making API calls.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicApiError"}}}},"403":{"description":"The API key lacks the required scope or workspace access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicApiError"}}}},"429":{"description":"The API key exceeded its request rate limit.","headers":{"Retry-After":{"description":"Seconds until the current rate-limit window resets.","schema":{"type":"integer"}},"X-RateLimit-Limit":{"description":"Allowed requests in the current window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests remaining in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix timestamp when the current window resets.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicApiError"}}}}},"security":[{"SwellApiKey":[]}]}},"/v1/analytics/overview":{"get":{"tags":["Customer API"],"summary":"Get analytics overview","description":"Returns web analytics, conversion, revenue, source, page, and performance metrics for a time window.","operationId":"customer_api_analytics_overview_v1_analytics_overview_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":365,"minimum":1,"default":30,"title":"Days"}},{"name":"hours","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":744,"minimum":1},{"type":"null"}],"title":"Hours"}},{"name":"start","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start"}},{"name":"end","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrowthOverviewOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}},"401":{"description":"API key is missing, malformed, revoked, or invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicApiError"}}}},"402":{"description":"The API key owner must select a plan before making API calls.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicApiError"}}}},"403":{"description":"The API key lacks the required scope or workspace access.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicApiError"}}}},"429":{"description":"The API key exceeded its request rate limit.","headers":{"Retry-After":{"description":"Seconds until the current rate-limit window resets.","schema":{"type":"integer"}},"X-RateLimit-Limit":{"description":"Allowed requests in the current window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests remaining in the current window.","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix timestamp when the current window resets.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicApiError"}}}}},"security":[{"SwellApiKey":[]}]}}},"components":{"securitySchemes":{"SwellApiKey":{"type":"http","scheme":"bearer","bearerFormat":"Swell API key","description":"Create API keys from Account Settings in the Swell app."}},"schemas":{"ApiWorkspaceOut":{"properties":{"id":{"type":"integer","title":"Id"},"name":{"type":"string","title":"Name"},"slug":{"type":"string","title":"Slug"},"timezone":{"type":"string","title":"Timezone"},"plan_key":{"type":"string","title":"Plan Key"}},"type":"object","required":["id","name","slug","timezone","plan_key"],"title":"ApiWorkspaceOut"},"Body_customer_api_upload_media_v1_media_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"},"alt_text":{"type":"string","title":"Alt Text","default":""}},"type":"object","required":["file"],"title":"Body_customer_api_upload_media_v1_media_post"},"GrowthBreakdownOut":{"properties":{"key":{"type":"string","title":"Key"},"label":{"type":"string","title":"Label"},"visitors":{"type":"integer","title":"Visitors"},"pageviews":{"type":"integer","title":"Pageviews"},"sessions":{"type":"integer","title":"Sessions"},"conversions":{"type":"integer","title":"Conversions"},"revenue_cents":{"type":"integer","title":"Revenue Cents"}},"type":"object","required":["key","label","visitors","pageviews","sessions","conversions","revenue_cents"],"title":"GrowthBreakdownOut"},"GrowthEventOut":{"properties":{"id":{"type":"integer","title":"Id"},"contact_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Contact Id"},"session_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Session Id"},"anonymous_id":{"type":"string","title":"Anonymous Id"},"event_type":{"type":"string","title":"Event Type"},"event_name":{"type":"string","title":"Event Name"},"url":{"type":"string","title":"Url"},"path":{"type":"string","title":"Path"},"title":{"type":"string","title":"Title"},"referrer":{"type":"string","title":"Referrer"},"source":{"type":"string","title":"Source"},"medium":{"type":"string","title":"Medium"},"campaign":{"type":"string","title":"Campaign"},"content":{"type":"string","title":"Content"},"value_cents":{"type":"integer","title":"Value Cents"},"currency":{"type":"string","title":"Currency"},"properties":{"additionalProperties":true,"type":"object","title":"Properties"},"occurred_at":{"type":"string","format":"date-time","title":"Occurred At"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","contact_id","session_id","anonymous_id","event_type","event_name","url","path","title","referrer","source","medium","campaign","content","value_cents","currency","properties","occurred_at","created_at"],"title":"GrowthEventOut"},"GrowthOverviewOut":{"properties":{"metrics":{"additionalProperties":true,"type":"object","title":"Metrics"},"top_sources":{"items":{"$ref":"#/components/schemas/GrowthSourceOut"},"type":"array","title":"Top Sources"},"top_pages":{"items":{"$ref":"#/components/schemas/GrowthTopPageOut"},"type":"array","title":"Top Pages"},"traffic_series":{"items":{"$ref":"#/components/schemas/GrowthTrafficPointOut"},"type":"array","title":"Traffic Series"},"devices":{"items":{"$ref":"#/components/schemas/GrowthBreakdownOut"},"type":"array","title":"Devices"},"browsers":{"items":{"$ref":"#/components/schemas/GrowthBreakdownOut"},"type":"array","title":"Browsers"},"countries":{"items":{"$ref":"#/components/schemas/GrowthBreakdownOut"},"type":"array","title":"Countries"},"web_vitals":{"items":{"$ref":"#/components/schemas/GrowthWebVitalMetricOut"},"type":"array","title":"Web Vitals"},"web_vital_pages":{"items":{"$ref":"#/components/schemas/GrowthWebVitalPageOut"},"type":"array","title":"Web Vital Pages"},"web_vital_series":{"items":{"$ref":"#/components/schemas/GrowthWebVitalSeriesPointOut"},"type":"array","title":"Web Vital Series"},"recent_events":{"items":{"$ref":"#/components/schemas/GrowthEventOut"},"type":"array","title":"Recent Events"},"recommendations":{"items":{"$ref":"#/components/schemas/GrowthRecommendationOut"},"type":"array","title":"Recommendations"},"snippet":{"$ref":"#/components/schemas/GrowthSnippetOut"}},"type":"object","required":["metrics","top_sources","top_pages","recent_events","recommendations","snippet"],"title":"GrowthOverviewOut"},"GrowthRecommendationOut":{"properties":{"title":{"type":"string","title":"Title"},"detail":{"type":"string","title":"Detail"},"priority":{"type":"string","title":"Priority"}},"type":"object","required":["title","detail","priority"],"title":"GrowthRecommendationOut"},"GrowthSnippetOut":{"properties":{"workspace_id":{"type":"integer","title":"Workspace Id"},"workspace_slug":{"type":"string","title":"Workspace Slug"},"tracking_key":{"type":"string","title":"Tracking Key"},"script_url":{"type":"string","title":"Script Url"},"snippet":{"type":"string","title":"Snippet"}},"type":"object","required":["workspace_id","workspace_slug","tracking_key","script_url","snippet"],"title":"GrowthSnippetOut"},"GrowthSourceOut":{"properties":{"source":{"type":"string","title":"Source"},"medium":{"type":"string","title":"Medium"},"visitors":{"type":"integer","title":"Visitors"},"pageviews":{"type":"integer","title":"Pageviews","default":0},"sessions":{"type":"integer","title":"Sessions","default":0},"events":{"type":"integer","title":"Events"},"conversions":{"type":"integer","title":"Conversions"},"revenue_cents":{"type":"integer","title":"Revenue Cents"}},"type":"object","required":["source","medium","visitors","events","conversions","revenue_cents"],"title":"GrowthSourceOut"},"GrowthTopPageOut":{"properties":{"path":{"type":"string","title":"Path"},"title":{"type":"string","title":"Title"},"visitors":{"type":"integer","title":"Visitors","default":0},"sessions":{"type":"integer","title":"Sessions","default":0},"pageviews":{"type":"integer","title":"Pageviews"},"bounce_rate":{"type":"number","title":"Bounce Rate","default":0.0},"conversions":{"type":"integer","title":"Conversions"},"revenue_cents":{"type":"integer","title":"Revenue Cents"}},"type":"object","required":["path","title","pageviews","conversions","revenue_cents"],"title":"GrowthTopPageOut"},"GrowthTrafficPointOut":{"properties":{"label":{"type":"string","title":"Label"},"start":{"type":"string","format":"date-time","title":"Start"},"end":{"type":"string","format":"date-time","title":"End"},"visitors":{"type":"integer","title":"Visitors"},"pageviews":{"type":"integer","title":"Pageviews"},"sessions":{"type":"integer","title":"Sessions"},"conversions":{"type":"integer","title":"Conversions"},"revenue_cents":{"type":"integer","title":"Revenue Cents"}},"type":"object","required":["label","start","end","visitors","pageviews","sessions","conversions","revenue_cents"],"title":"GrowthTrafficPointOut"},"GrowthWebVitalMetricOut":{"properties":{"metric":{"type":"string","title":"Metric"},"label":{"type":"string","title":"Label"},"unit":{"type":"string","title":"Unit"},"count":{"type":"integer","title":"Count"},"latest":{"type":"number","title":"Latest"},"average":{"type":"number","title":"Average"},"p75":{"type":"number","title":"P75"},"p90":{"type":"number","title":"P90"},"p99":{"type":"number","title":"P99"},"good_threshold":{"type":"number","title":"Good Threshold"},"poor_threshold":{"type":"number","title":"Poor Threshold"},"rating":{"type":"string","title":"Rating"}},"type":"object","required":["metric","label","unit","count","latest","average","p75","p90","p99","good_threshold","poor_threshold","rating"],"title":"GrowthWebVitalMetricOut"},"GrowthWebVitalPageOut":{"properties":{"path":{"type":"string","title":"Path"},"pageviews":{"type":"integer","title":"Pageviews"},"samples":{"type":"integer","title":"Samples"},"good":{"type":"integer","title":"Good"},"needs_improvement":{"type":"integer","title":"Needs Improvement"},"poor":{"type":"integer","title":"Poor"},"worst_metric":{"type":"string","title":"Worst Metric"},"p90":{"type":"number","title":"P90"},"rating":{"type":"string","title":"Rating"},"metric_p90s":{"additionalProperties":{"type":"number"},"type":"object","title":"Metric P90S"},"metric_ratings":{"additionalProperties":{"type":"string"},"type":"object","title":"Metric Ratings"}},"type":"object","required":["path","pageviews","samples","good","needs_improvement","poor","worst_metric","p90","rating"],"title":"GrowthWebVitalPageOut"},"GrowthWebVitalSeriesPointOut":{"properties":{"label":{"type":"string","title":"Label"},"start":{"type":"string","format":"date-time","title":"Start"},"end":{"type":"string","format":"date-time","title":"End"},"values":{"additionalProperties":{"type":"number"},"type":"object","title":"Values"},"counts":{"additionalProperties":{"type":"integer"},"type":"object","title":"Counts"}},"type":"object","required":["label","start","end"],"title":"GrowthWebVitalSeriesPointOut"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"MediaAssetOut":{"properties":{"id":{"type":"integer","title":"Id"},"filename":{"type":"string","title":"Filename"},"original_filename":{"type":"string","title":"Original Filename"},"content_type":{"type":"string","title":"Content Type"},"size_bytes":{"type":"integer","title":"Size Bytes"},"alt_text":{"type":"string","title":"Alt Text"},"usage_count":{"type":"integer","title":"Usage Count","default":0},"used_post_titles":{"items":{"type":"string"},"type":"array","title":"Used Post Titles"},"last_used_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Used At"},"url":{"type":"string","title":"Url"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","filename","original_filename","content_type","size_bytes","alt_text","url","created_at"],"title":"MediaAssetOut"},"PostCreate":{"properties":{"title":{"type":"string","maxLength":180,"minLength":1,"title":"Title"},"base_caption":{"type":"string","maxLength":2200,"minLength":1,"title":"Base Caption"},"scheduled_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Scheduled At"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags"},"media_ids":{"items":{"type":"integer"},"type":"array","title":"Media Ids"},"social_account_ids":{"items":{"type":"integer"},"type":"array","title":"Social Account Ids"},"platform_captions":{"additionalProperties":{"type":"string"},"type":"object","title":"Platform Captions"}},"type":"object","required":["title","base_caption"],"title":"PostCreate"},"PostOut":{"properties":{"id":{"type":"integer","title":"Id"},"title":{"type":"string","title":"Title"},"base_caption":{"type":"string","title":"Base Caption"},"scheduled_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Scheduled At"},"status":{"type":"string","title":"Status"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags"},"media_ids":{"items":{"type":"integer"},"type":"array","title":"Media Ids"},"targets":{"items":{"$ref":"#/components/schemas/PostTargetOut"},"type":"array","title":"Targets"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","title","base_caption","scheduled_at","status","tags","media_ids","targets","created_at","updated_at"],"title":"PostOut"},"PostTargetOut":{"properties":{"id":{"type":"integer","title":"Id"},"social_account_id":{"type":"integer","title":"Social Account Id"},"platform":{"type":"string","title":"Platform"},"caption_override":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Caption Override"},"status":{"type":"string","title":"Status"},"publish_result":{"additionalProperties":true,"type":"object","title":"Publish Result"}},"type":"object","required":["id","social_account_id","platform","caption_override","status","publish_result"],"title":"PostTargetOut"},"PostUpdate":{"properties":{"title":{"anyOf":[{"type":"string","maxLength":180,"minLength":1},{"type":"null"}],"title":"Title"},"base_caption":{"anyOf":[{"type":"string","maxLength":2200,"minLength":1},{"type":"null"}],"title":"Base Caption"},"scheduled_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Scheduled At"},"tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Tags"},"media_ids":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"Media Ids"},"social_account_ids":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"Social Account Ids"},"platform_captions":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Platform Captions"}},"type":"object","title":"PostUpdate"},"PublicApiError":{"title":"PublicApiError","type":"object","properties":{"detail":{"title":"Detail","type":"string"}},"required":["detail"]},"ScheduleRequest":{"properties":{"scheduled_at":{"type":"string","format":"date-time","title":"Scheduled At"}},"type":"object","required":["scheduled_at"],"title":"ScheduleRequest"},"SocialAccountOut":{"properties":{"id":{"type":"integer","title":"Id"},"platform":{"type":"string","title":"Platform"},"handle":{"type":"string","title":"Handle"},"display_name":{"type":"string","title":"Display Name"},"status":{"type":"string","title":"Status"},"external_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Id"},"connection_type":{"type":"string","title":"Connection Type","default":"simulated"},"health_status":{"type":"string","title":"Health Status","default":"ok"},"health_message":{"type":"string","title":"Health Message","default":""},"provider_metadata":{"additionalProperties":true,"type":"object","title":"Provider Metadata"}},"type":"object","required":["id","platform","handle","display_name","status"],"title":"SocialAccountOut"},"TrackedLinkCreate":{"properties":{"label":{"type":"string","maxLength":160,"minLength":1,"title":"Label"},"destination_url":{"type":"string","maxLength":2048,"minLength":8,"title":"Destination Url"},"post_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Post Id"},"social_account_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Social Account Id"},"utm_source":{"type":"string","maxLength":120,"title":"Utm Source","default":"swell"},"utm_medium":{"type":"string","maxLength":120,"title":"Utm Medium","default":"social"},"utm_campaign":{"type":"string","maxLength":120,"title":"Utm Campaign","default":""},"utm_content":{"type":"string","maxLength":120,"title":"Utm Content","default":""}},"additionalProperties":false,"type":"object","required":["label","destination_url"],"title":"TrackedLinkCreate"},"TrackedLinkOut":{"properties":{"id":{"type":"integer","title":"Id"},"label":{"type":"string","title":"Label"},"destination_url":{"type":"string","title":"Destination Url"},"tracking_url":{"type":"string","title":"Tracking Url"},"post_url":{"type":"string","title":"Post Url"},"post_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Post Id"},"social_account_id":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Social Account Id"},"attribution_key":{"type":"string","title":"Attribution Key"},"utm_source":{"type":"string","title":"Utm Source"},"utm_medium":{"type":"string","title":"Utm Medium"},"utm_campaign":{"type":"string","title":"Utm Campaign"},"utm_content":{"type":"string","title":"Utm Content"},"tracking_params":{"additionalProperties":true,"type":"object","title":"Tracking Params"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","label","destination_url","tracking_url","post_url","attribution_key","utm_source","utm_medium","utm_campaign","utm_content","created_at","updated_at"],"title":"TrackedLinkOut"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}