From 0ffedf2326e00da492d0e7758ad24dee1493d029 Mon Sep 17 00:00:00 2001 From: Sweets Sweetman Date: Sun, 25 Oct 2026 12:11:31 -0500 Subject: [PATCH 1/6] docs: GET /api/posts/{id}/stats (Get Post Stats) (app#2351) Publication copy of recoupable/marketing#238 (7bdf704). Co-Authored-By: Claude Opus 5.5 --- SOURCE-PROVENANCE.json | 13 +- api-reference/openapi/social.json | 235 +++++++++++++++++++++ api-reference/publishing/stats.mdx | 4 + docs.json | 1 + llms-full.txt | 325 +++++++++++++++++++++++++++++ 5 files changed, 574 insertions(+), 4 deletions(-) create mode 100644 api-reference/publishing/stats.mdx diff --git a/SOURCE-PROVENANCE.json b/SOURCE-PROVENANCE.json index 6d7ee41a..98fdcbe9 100644 --- a/SOURCE-PROVENANCE.json +++ b/SOURCE-PROVENANCE.json @@ -1,6 +1,6 @@ { "repository": "recoupable/marketing", - "commit": "c52d2a5bf5670109da6350f01aede45957c1b978", + "commit": "7bdf704ab0d3944135ac909f7e34c5c088541fd8", "sourceDirectory": "content/docs/source", "files": [ { @@ -536,7 +536,7 @@ { "path": "api-reference/openapi/social.json", "sourcePath": "content/docs/source/api-reference/openapi/social.json", - "sha256": "49c837327886827b5bc33ae4daac76f12473ecf4a6f75cc073656e9247ba73ca" + "sha256": "7a539baed0c3186f7cc87ba995301e4c647aa25b7c1eb7b11a33ff660935bb29" }, { "path": "api-reference/openapi/templates.json", @@ -688,6 +688,11 @@ "sourcePath": "content/docs/source/api-reference/publishing/list.mdx", "sha256": "3857ddd70fe560668d6adeffedfb8ec90af507aa82485ad196c9307430e50d5c" }, + { + "path": "api-reference/publishing/stats.mdx", + "sourcePath": "content/docs/source/api-reference/publishing/stats.mdx", + "sha256": "aa96e321fb771d912501a6608b7eed60adc58d191e2bad1c33ea4f5ea25eaca4" + }, { "path": "api-reference/pulses/list.mdx", "sourcePath": "content/docs/source/api-reference/pulses/list.mdx", @@ -1166,7 +1171,7 @@ { "path": "llms-full.txt", "sourcePath": "content/docs/source/llms-full.txt", - "sha256": "590a6dd9a2e10b44a981f322a1047fd336906a3de0e2680ec0f35ce10b6baeb1" + "sha256": "969e8f807bb9a18333f498ad8a93e7e16dbb96b787896e4d035522994cca5945" }, { "path": "llms.txt", @@ -1229,7 +1234,7 @@ "sha256": "df08b22bdc866daaf6adfbdfaafac47859f1281449841990d0e2af499a1e2d7d" } ], - "navigationSha256": "f6aa36d99ea011ba47a7ea23874c76c1037c349cbe2bb70f5a505f9cebfc4621", + "navigationSha256": "06d8646887b528e6cb886f22eac6cf86906539d56b462980b654f55aa77821ef", "hostSpecific": [ "docs.json theme, colors, navbar, footer, logo and host settings" ], diff --git a/api-reference/openapi/social.json b/api-reference/openapi/social.json index 40090002..3b9cd3d9 100644 --- a/api-reference/openapi/social.json +++ b/api-reference/openapi/social.json @@ -1749,6 +1749,126 @@ } } } + }, + "/api/posts/{id}/stats": { + "get": { + "operationId": "getPostsByIdStats", + "summary": "Get post stats", + "x-recoup-availability": "pending", + "description": "Pending API release. The platform's own analytics for one post published with [Create Post](/api-reference/publishing/create), read live through the same connection that published it. Currently LinkedIn company-page posts only; other platforms and LinkedIn personal (member) posts return 422. Each call is a fresh read and `as_of` records when it happened. Reads cost no credits.", + "security": [ + { + "apiKeyAuth": [] + }, + { + "bearerAuth": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + }, + "description": "The post's id, from [Create Post](/api-reference/publishing/create)." + } + ], + "responses": { + "200": { + "description": "The post's current stats.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PostStatsResponse" + } + } + } + }, + "400": { + "description": "`id` is not a valid uuid.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PostErrorResponse" + } + } + } + }, + "401": { + "description": "Unauthorized.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PostErrorResponse" + } + } + } + }, + "403": { + "description": "Access denied to this post's account.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PostErrorResponse" + } + } + } + }, + "404": { + "description": "No post with that id.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PostErrorResponse" + } + } + } + }, + "409": { + "description": "The post cannot be read yet. Either it is not published (its status is not `posted` or it has no `post_url`; error `Post is not published yet, so it has no stats`), or the platform is not connected for the post's account (error `linkedin is not connected for this account`). This is checked before 422, so an unpublished post on any platform returns 409.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PostErrorResponse" + } + } + } + }, + "422": { + "description": "Stats are not supported for this post. Only LinkedIn company-page posts are supported today. Errors: `Stats are not available for posts yet` (any other platform), `Stats are available for LinkedIn company-page posts only` (a LinkedIn personal post), `post_url does not name a LinkedIn post`.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PostErrorResponse" + } + } + } + }, + "502": { + "description": "The platform rejected the stats read, for example because the connection lacks analytics access (error `LinkedIn rejected the stats read for this post`).", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PostErrorResponse" + } + } + } + }, + "500": { + "description": "Internal server error.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PostErrorResponse" + } + } + } + } + } + } } }, "components": { @@ -3839,6 +3959,121 @@ } } }, + "PostStats": { + "type": "object", + "required": [ + "post_id", + "platform", + "post_url", + "impressions", + "unique_impressions", + "clicks", + "likes", + "comments", + "shares", + "engagement", + "as_of" + ], + "properties": { + "post_id": { + "type": "string", + "format": "uuid", + "description": "The post's id.", + "example": "3f8e2c1a-5b7d-4e9f-a1c2-6d4b8e0f2a91" + }, + "platform": { + "type": "string", + "description": "The platform the post was published to.", + "example": "linkedin" + }, + "post_url": { + "type": "string", + "description": "The live post's URL.", + "example": "https://www.linkedin.com/feed/update/urn:li:share:7389012345678901248" + }, + "impressions": { + "type": [ + "integer", + "null" + ], + "description": "Times the post was shown. `null` when the platform does not report it.", + "example": 412 + }, + "unique_impressions": { + "type": [ + "integer", + "null" + ], + "description": "Distinct members the post was shown to. `null` when the platform does not report it.", + "example": 287 + }, + "clicks": { + "type": [ + "integer", + "null" + ], + "description": "Clicks on the post's content, company name or logo. `null` when the platform does not report it.", + "example": 19 + }, + "likes": { + "type": [ + "integer", + "null" + ], + "description": "Likes (reactions). `null` when the platform does not report it.", + "example": 14 + }, + "comments": { + "type": [ + "integer", + "null" + ], + "description": "Comments. `null` when the platform does not report it.", + "example": 3 + }, + "shares": { + "type": [ + "integer", + "null" + ], + "description": "Reposts. `null` when the platform does not report it.", + "example": 2 + }, + "engagement": { + "type": [ + "number", + "null" + ], + "description": "LinkedIn's engagement rate for the post, from 0 to 1. `null` when the platform does not report it.", + "example": 0.0922 + }, + "as_of": { + "type": "string", + "format": "date-time", + "description": "Server time of the read.", + "example": "2026-10-25T18:04:12Z" + } + } + }, + "PostStatsResponse": { + "type": "object", + "required": [ + "status", + "stats" + ], + "properties": { + "status": { + "type": "string", + "enum": [ + "success" + ], + "description": "Status of the request" + }, + "stats": { + "$ref": "#/components/schemas/PostStats" + } + } + }, "PostListResponse": { "type": "object", "properties": { diff --git a/api-reference/publishing/stats.mdx b/api-reference/publishing/stats.mdx new file mode 100644 index 00000000..54629f0a --- /dev/null +++ b/api-reference/publishing/stats.mdx @@ -0,0 +1,4 @@ +--- +title: 'Get Post Stats' +openapi: "/api-reference/openapi/social.json GET /api/posts/{id}/stats" +--- diff --git a/docs.json b/docs.json index 4eb81e10..8d51f11a 100644 --- a/docs.json +++ b/docs.json @@ -478,6 +478,7 @@ "api-reference/publishing/create", "api-reference/publishing/list", "api-reference/publishing/get", + "api-reference/publishing/stats", "api-reference/publishing/cancel" ] } diff --git a/llms-full.txt b/llms-full.txt index fcd72f16..12a1d51d 100644 --- a/llms-full.txt +++ b/llms-full.txt @@ -64464,6 +64464,331 @@ This operation requires one of the security alternatives in the specification be ``` +# Get Post Stats + +Source: https://recoupable.dev/docs/api-reference/publishing/stats + +Get post stats + +## GET /api/posts/{id}/stats + +Full OpenAPI specification: https://recoupable.dev/docs/spec/social.json + +## Authentication + +This operation requires one of the security alternatives in the specification below. Security scheme definitions are included where present in the published specification. + +[Authentication guide](https://recoupable.dev/docs/authentication) + +## Operation and referenced schemas + +```json +{ + "openapi": "3.1.0", + "info": { + "title": "Recoup API - Social", + "description": "API documentation for the Recoup platform - an AI agent platform for the music industry", + "license": { + "name": "MIT" + }, + "version": "1.0.0" + }, + "servers": [ + { + "url": "https://api.recoupable.dev" + } + ], + "paths": { + "/api/posts/{id}/stats": { + "get": { + "operationId": "getPostsByIdStats", + "summary": "Get post stats", + "x-recoup-availability": "pending", + "description": "Pending API release. The platform's own analytics for one post published with [Create Post](https://recoupable.dev/docs/api-reference/publishing/create), read live through the same connection that published it. Currently LinkedIn company-page posts only; other platforms and LinkedIn personal (member) posts return 422. Each call is a fresh read and `as_of` records when it happened. Reads cost no credits.", + "security": [ + { + "apiKeyAuth": [] + }, + { + "bearerAuth": [] + } + ], + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + }, + "description": "The post's id, from [Create Post](https://recoupable.dev/docs/api-reference/publishing/create)." + } + ], + "responses": { + "200": { + "description": "The post's current stats.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PostStatsResponse" + } + } + } + }, + "400": { + "description": "`id` is not a valid uuid.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PostErrorResponse" + } + } + } + }, + "401": { + "description": "Unauthorized.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PostErrorResponse" + } + } + } + }, + "403": { + "description": "Access denied to this post's account.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PostErrorResponse" + } + } + } + }, + "404": { + "description": "No post with that id.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PostErrorResponse" + } + } + } + }, + "409": { + "description": "The post cannot be read yet. Either it is not published (its status is not `posted` or it has no `post_url`; error `Post is not published yet, so it has no stats`), or the platform is not connected for the post's account (error `linkedin is not connected for this account`). This is checked before 422, so an unpublished post on any platform returns 409.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PostErrorResponse" + } + } + } + }, + "422": { + "description": "Stats are not supported for this post. Only LinkedIn company-page posts are supported today. Errors: `Stats are not available for posts yet` (any other platform), `Stats are available for LinkedIn company-page posts only` (a LinkedIn personal post), `post_url does not name a LinkedIn post`.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PostErrorResponse" + } + } + } + }, + "500": { + "description": "Internal server error.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PostErrorResponse" + } + } + } + }, + "502": { + "description": "The platform rejected the stats read, for example because the connection lacks analytics access (error `LinkedIn rejected the stats read for this post`).", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PostErrorResponse" + } + } + } + } + } + } + } + }, + "components": { + "schemas": { + "PostStatsResponse": { + "type": "object", + "required": [ + "status", + "stats" + ], + "properties": { + "status": { + "type": "string", + "enum": [ + "success" + ], + "description": "Status of the request" + }, + "stats": { + "$ref": "#/components/schemas/PostStats" + } + } + }, + "PostErrorResponse": { + "type": "object", + "required": [ + "status", + "error" + ], + "properties": { + "status": { + "type": "string", + "enum": [ + "error" + ], + "description": "Always `error`" + }, + "missing_fields": { + "type": "array", + "description": "JSON path segments to the first field that failed validation, e.g. `[\"description\"]`", + "items": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "integer" + } + ] + } + }, + "error": { + "type": "string", + "description": "Human-readable error message" + } + } + }, + "PostStats": { + "type": "object", + "required": [ + "post_id", + "platform", + "post_url", + "impressions", + "unique_impressions", + "clicks", + "likes", + "comments", + "shares", + "engagement", + "as_of" + ], + "properties": { + "post_id": { + "type": "string", + "format": "uuid", + "description": "The post's id.", + "example": "3f8e2c1a-5b7d-4e9f-a1c2-6d4b8e0f2a91" + }, + "platform": { + "type": "string", + "description": "The platform the post was published to.", + "example": "linkedin" + }, + "post_url": { + "type": "string", + "description": "The live post's URL.", + "example": "https://www.linkedin.com/feed/update/urn:li:share:7389012345678901248" + }, + "impressions": { + "type": [ + "integer", + "null" + ], + "description": "Times the post was shown. `null` when the platform does not report it.", + "example": 412 + }, + "unique_impressions": { + "type": [ + "integer", + "null" + ], + "description": "Distinct members the post was shown to. `null` when the platform does not report it.", + "example": 287 + }, + "clicks": { + "type": [ + "integer", + "null" + ], + "description": "Clicks on the post's content, company name or logo. `null` when the platform does not report it.", + "example": 19 + }, + "likes": { + "type": [ + "integer", + "null" + ], + "description": "Likes (reactions). `null` when the platform does not report it.", + "example": 14 + }, + "comments": { + "type": [ + "integer", + "null" + ], + "description": "Comments. `null` when the platform does not report it.", + "example": 3 + }, + "shares": { + "type": [ + "integer", + "null" + ], + "description": "Reposts. `null` when the platform does not report it.", + "example": 2 + }, + "engagement": { + "type": [ + "number", + "null" + ], + "description": "LinkedIn's engagement rate for the post, from 0 to 1. `null` when the platform does not report it.", + "example": 0.0922 + }, + "as_of": { + "type": "string", + "format": "date-time", + "description": "Server time of the read.", + "example": "2026-10-25T18:04:12Z" + } + } + } + }, + "securitySchemes": { + "apiKeyAuth": { + "type": "apiKey", + "in": "header", + "name": "x-api-key", + "description": "Your Recoup API key. [Learn more](https://recoupable.dev/docs/quickstart#api-keys)." + }, + "bearerAuth": { + "type": "http", + "scheme": "bearer" + } + } + } +} +``` + + # Cancel Post Source: https://recoupable.dev/docs/api-reference/publishing/cancel From cfcbf044eea047bdf8d44d1a6ee9dcb817aee726 Mon Sep 17 00:00:00 2001 From: Sweets Sweetman Date: Sun, 25 Oct 2026 12:15:13 -0500 Subject: [PATCH 2/6] docs: re-sync Get Post Stats publication from marketing#238 Co-Authored-By: Claude Opus 5.5 --- SOURCE-PROVENANCE.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SOURCE-PROVENANCE.json b/SOURCE-PROVENANCE.json index 98fdcbe9..fb8ea0c7 100644 --- a/SOURCE-PROVENANCE.json +++ b/SOURCE-PROVENANCE.json @@ -1,6 +1,6 @@ { "repository": "recoupable/marketing", - "commit": "7bdf704ab0d3944135ac909f7e34c5c088541fd8", + "commit": "5f859db352790cb8ab518b01aa5e8dc0f2183b1c", "sourceDirectory": "content/docs/source", "files": [ { From 5f16b3789b1363dbc74351daf62cf7dfc85e7068 Mon Sep 17 00:00:00 2001 From: Sweets Sweetman Date: Sun, 25 Oct 2026 12:24:40 -0500 Subject: [PATCH 3/6] docs: re-sync Get Post Stats publication from marketing#238 Co-Authored-By: Claude Opus 5.5 --- SOURCE-PROVENANCE.json | 6 +++--- api-reference/publishing/stats.mdx | 4 ++++ llms-full.txt | 4 ++++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/SOURCE-PROVENANCE.json b/SOURCE-PROVENANCE.json index fb8ea0c7..d6acf1f0 100644 --- a/SOURCE-PROVENANCE.json +++ b/SOURCE-PROVENANCE.json @@ -1,6 +1,6 @@ { "repository": "recoupable/marketing", - "commit": "5f859db352790cb8ab518b01aa5e8dc0f2183b1c", + "commit": "b72c2e826c6e3555cad9ddba72dff42134fe571c", "sourceDirectory": "content/docs/source", "files": [ { @@ -691,7 +691,7 @@ { "path": "api-reference/publishing/stats.mdx", "sourcePath": "content/docs/source/api-reference/publishing/stats.mdx", - "sha256": "aa96e321fb771d912501a6608b7eed60adc58d191e2bad1c33ea4f5ea25eaca4" + "sha256": "89b68eaa4ec17166fe99bb15afc2dbd6d40523f99817f5481b5120e358ceb596" }, { "path": "api-reference/pulses/list.mdx", @@ -1171,7 +1171,7 @@ { "path": "llms-full.txt", "sourcePath": "content/docs/source/llms-full.txt", - "sha256": "969e8f807bb9a18333f498ad8a93e7e16dbb96b787896e4d035522994cca5945" + "sha256": "74e5d70968370c38f5080d76bd8d9d25108bc7d8906d1e3742b786a8bfb2597b" }, { "path": "llms.txt", diff --git a/api-reference/publishing/stats.mdx b/api-reference/publishing/stats.mdx index 54629f0a..39bd4c20 100644 --- a/api-reference/publishing/stats.mdx +++ b/api-reference/publishing/stats.mdx @@ -2,3 +2,7 @@ title: 'Get Post Stats' openapi: "/api-reference/openapi/social.json GET /api/posts/{id}/stats" --- + +## Data coverage + +LinkedIn reports organic activity only, within a rolling 12-month window; a post older than 12 months returns what LinkedIn still holds. diff --git a/llms-full.txt b/llms-full.txt index 12a1d51d..9f926597 100644 --- a/llms-full.txt +++ b/llms-full.txt @@ -64470,6 +64470,10 @@ Source: https://recoupable.dev/docs/api-reference/publishing/stats Get post stats +## Data coverage + +LinkedIn reports organic activity only, within a rolling 12-month window; a post older than 12 months returns what LinkedIn still holds. + ## GET /api/posts/{id}/stats Full OpenAPI specification: https://recoupable.dev/docs/spec/social.json From 854ef8cf6a5cb66b15f2aa135e28ebf2d4998c71 Mon Sep 17 00:00:00 2001 From: Sweets Sweetman Date: Sun, 25 Oct 2026 12:41:56 -0500 Subject: [PATCH 4/6] docs: re-sync Get Post Stats publication from marketing#238 (pricing + 402) Co-Authored-By: Claude Opus 5.5 --- SOURCE-PROVENANCE.json | 6 ++--- api-reference/openapi/social.json | 12 ++++++++- llms-full.txt | 43 ++++++++++++++++++++++++++++++- 3 files changed, 56 insertions(+), 5 deletions(-) diff --git a/SOURCE-PROVENANCE.json b/SOURCE-PROVENANCE.json index d6acf1f0..e3cfbce3 100644 --- a/SOURCE-PROVENANCE.json +++ b/SOURCE-PROVENANCE.json @@ -1,6 +1,6 @@ { "repository": "recoupable/marketing", - "commit": "b72c2e826c6e3555cad9ddba72dff42134fe571c", + "commit": "d519a95ec533f181644c4fea80f76cb98bafc816", "sourceDirectory": "content/docs/source", "files": [ { @@ -536,7 +536,7 @@ { "path": "api-reference/openapi/social.json", "sourcePath": "content/docs/source/api-reference/openapi/social.json", - "sha256": "7a539baed0c3186f7cc87ba995301e4c647aa25b7c1eb7b11a33ff660935bb29" + "sha256": "dfda1239843c4e110d24e4ca05c45a9e7124513415f53ea241a8a8c008cf6bd7" }, { "path": "api-reference/openapi/templates.json", @@ -1171,7 +1171,7 @@ { "path": "llms-full.txt", "sourcePath": "content/docs/source/llms-full.txt", - "sha256": "74e5d70968370c38f5080d76bd8d9d25108bc7d8906d1e3742b786a8bfb2597b" + "sha256": "3b75c4ddb284674d74ad14ed9d77f9617aea355643e4c1090cc1baec683578c0" }, { "path": "llms.txt", diff --git a/api-reference/openapi/social.json b/api-reference/openapi/social.json index 3b9cd3d9..8f86e4b4 100644 --- a/api-reference/openapi/social.json +++ b/api-reference/openapi/social.json @@ -1755,7 +1755,7 @@ "operationId": "getPostsByIdStats", "summary": "Get post stats", "x-recoup-availability": "pending", - "description": "Pending API release. The platform's own analytics for one post published with [Create Post](/api-reference/publishing/create), read live through the same connection that published it. Currently LinkedIn company-page posts only; other platforms and LinkedIn personal (member) posts return 422. Each call is a fresh read and `as_of` records when it happened. Reads cost no credits.", + "description": "Pending API release. The platform's own analytics for one post published with [Create Post](/api-reference/publishing/create), read live through the same connection that published it. Currently LinkedIn company-page posts only; other platforms and LinkedIn personal (member) posts return 422. Each call is a fresh read and `as_of` records when it happened. Each successful read costs $0.001 (1,000 credits), charged to the caller after LinkedIn returns the numbers. Credits are checked first; a request that fails (4xx/5xx) is not charged.", "security": [ { "apiKeyAuth": [] @@ -1807,6 +1807,16 @@ } } }, + "402": { + "description": "Insufficient credits: the account has less than the $0.001 a read costs. Returned after the 400/401/403/404/409/422 checks and before LinkedIn is called, so nothing is read and nothing is charged.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SocialInsufficientCreditsResponse" + } + } + } + }, "403": { "description": "Access denied to this post's account.", "content": { diff --git a/llms-full.txt b/llms-full.txt index 9f926597..e950985d 100644 --- a/llms-full.txt +++ b/llms-full.txt @@ -64508,7 +64508,7 @@ This operation requires one of the security alternatives in the specification be "operationId": "getPostsByIdStats", "summary": "Get post stats", "x-recoup-availability": "pending", - "description": "Pending API release. The platform's own analytics for one post published with [Create Post](https://recoupable.dev/docs/api-reference/publishing/create), read live through the same connection that published it. Currently LinkedIn company-page posts only; other platforms and LinkedIn personal (member) posts return 422. Each call is a fresh read and `as_of` records when it happened. Reads cost no credits.", + "description": "Pending API release. The platform's own analytics for one post published with [Create Post](https://recoupable.dev/docs/api-reference/publishing/create), read live through the same connection that published it. Currently LinkedIn company-page posts only; other platforms and LinkedIn personal (member) posts return 422. Each call is a fresh read and `as_of` records when it happened. Each successful read costs $0.001 (1,000 credits), charged to the caller after LinkedIn returns the numbers. Credits are checked first; a request that fails (4xx/5xx) is not charged.", "security": [ { "apiKeyAuth": [] @@ -64560,6 +64560,16 @@ This operation requires one of the security alternatives in the specification be } } }, + "402": { + "description": "Insufficient credits: the account has less than the $0.001 a read costs. Returned after the 400/401/403/404/409/422 checks and before LinkedIn is called, so nothing is read and nothing is charged.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SocialInsufficientCreditsResponse" + } + } + } + }, "403": { "description": "Access denied to this post's account.", "content": { @@ -64679,6 +64689,37 @@ This operation requires one of the security alternatives in the specification be } } }, + "SocialInsufficientCreditsResponse": { + "type": "object", + "description": "Returned (402) when the account lacks credits for the request. Nothing is charged and no Stripe object is created. Credits must be bought explicitly via [`POST /api/credits/sessions`](https://recoupable.dev/docs/api-reference/credits/sessions-create). Examples: a scrape of one profile with posts=20 requires $0.25; one post through Create Post requires $0.01.", + "properties": { + "error": { + "type": "string", + "enum": [ + "insufficient_credits" + ] + }, + "remaining_credits": { + "type": "integer", + "example": 0 + }, + "required_credits": { + "type": "integer", + "example": 250000 + }, + "billingUrl": { + "type": "string", + "description": "Static link to the Recoup app, where a human can save a card and buy credits. It is a constant, not a freshly minted Stripe Checkout Session, so a credit-gated endpoint that keeps returning 402 creates nothing. To buy credits programmatically, call [`POST /api/credits/sessions`](https://recoupable.dev/docs/api-reference/credits/sessions-create).", + "example": "https://app.recoupable.dev" + } + }, + "required": [ + "error", + "remaining_credits", + "required_credits", + "billingUrl" + ] + }, "PostStats": { "type": "object", "required": [ From 5a14afa60b02fb3676cf3531f4235738c62774f6 Mon Sep 17 00:00:00 2001 From: Sweets Sweetman Date: Sun, 25 Oct 2026 12:45:44 -0500 Subject: [PATCH 5/6] docs: re-sync Get Post Stats publication from marketing#238 Co-Authored-By: Claude Opus 5.5 --- SOURCE-PROVENANCE.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SOURCE-PROVENANCE.json b/SOURCE-PROVENANCE.json index e3cfbce3..d8056ab4 100644 --- a/SOURCE-PROVENANCE.json +++ b/SOURCE-PROVENANCE.json @@ -1,6 +1,6 @@ { "repository": "recoupable/marketing", - "commit": "d519a95ec533f181644c4fea80f76cb98bafc816", + "commit": "4e5ceb09dad06d422a205a0b2b516253e3034fdd", "sourceDirectory": "content/docs/source", "files": [ { From f43e1b42310a89086dbc6e1c7cfab47d06af1792 Mon Sep 17 00:00:00 2001 From: Sweets Sweetman Date: Sun, 25 Oct 2026 13:05:34 -0500 Subject: [PATCH 6/6] docs: pin Get Post Stats publication to merged marketing a6fd468 (marketing#238) Co-Authored-By: Claude Opus 5.5 --- SOURCE-PROVENANCE.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SOURCE-PROVENANCE.json b/SOURCE-PROVENANCE.json index d8056ab4..2d2cb4e5 100644 --- a/SOURCE-PROVENANCE.json +++ b/SOURCE-PROVENANCE.json @@ -1,6 +1,6 @@ { "repository": "recoupable/marketing", - "commit": "4e5ceb09dad06d422a205a0b2b516253e3034fdd", + "commit": "a6fd468f8bd2c2de8472c0ee6c13cf4bd550e5a0", "sourceDirectory": "content/docs/source", "files": [ {