@postpeer/node 0.6.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -101
- package/README.md +91 -317
- package/dist/index.cjs +1709 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +3484 -0
- package/dist/index.d.ts +3484 -0
- package/dist/index.js +1690 -0
- package/dist/index.js.map +1 -0
- package/package.json +59 -131
- package/api-promise.d.mts +0 -2
- package/api-promise.d.mts.map +0 -1
- package/api-promise.d.ts +0 -2
- package/api-promise.d.ts.map +0 -1
- package/api-promise.js +0 -6
- package/api-promise.js.map +0 -1
- package/api-promise.mjs +0 -2
- package/api-promise.mjs.map +0 -1
- package/client.d.mts +0 -190
- package/client.d.mts.map +0 -1
- package/client.d.ts +0 -190
- package/client.d.ts.map +0 -1
- package/client.js +0 -485
- package/client.js.map +0 -1
- package/client.mjs +0 -481
- package/client.mjs.map +0 -1
- package/core/api-promise.d.mts +0 -46
- package/core/api-promise.d.mts.map +0 -1
- package/core/api-promise.d.ts +0 -46
- package/core/api-promise.d.ts.map +0 -1
- package/core/api-promise.js +0 -74
- package/core/api-promise.js.map +0 -1
- package/core/api-promise.mjs +0 -70
- package/core/api-promise.mjs.map +0 -1
- package/core/error.d.mts +0 -46
- package/core/error.d.mts.map +0 -1
- package/core/error.d.ts +0 -46
- package/core/error.d.ts.map +0 -1
- package/core/error.js +0 -113
- package/core/error.js.map +0 -1
- package/core/error.mjs +0 -97
- package/core/error.mjs.map +0 -1
- package/core/resource.d.mts +0 -6
- package/core/resource.d.mts.map +0 -1
- package/core/resource.d.ts +0 -6
- package/core/resource.d.ts.map +0 -1
- package/core/resource.js +0 -11
- package/core/resource.js.map +0 -1
- package/core/resource.mjs +0 -7
- package/core/resource.mjs.map +0 -1
- package/core/uploads.d.mts +0 -3
- package/core/uploads.d.mts.map +0 -1
- package/core/uploads.d.ts +0 -3
- package/core/uploads.d.ts.map +0 -1
- package/core/uploads.js +0 -6
- package/core/uploads.js.map +0 -1
- package/core/uploads.mjs +0 -2
- package/core/uploads.mjs.map +0 -1
- package/error.d.mts +0 -2
- package/error.d.mts.map +0 -1
- package/error.d.ts +0 -2
- package/error.d.ts.map +0 -1
- package/error.js +0 -6
- package/error.js.map +0 -1
- package/error.mjs +0 -2
- package/error.mjs.map +0 -1
- package/index.d.mts +0 -6
- package/index.d.mts.map +0 -1
- package/index.d.ts +0 -6
- package/index.d.ts.map +0 -1
- package/index.js +0 -30
- package/index.js.map +0 -1
- package/index.mjs +0 -7
- package/index.mjs.map +0 -1
- package/internal/builtin-types.d.mts +0 -73
- package/internal/builtin-types.d.mts.map +0 -1
- package/internal/builtin-types.d.ts +0 -73
- package/internal/builtin-types.d.ts.map +0 -1
- package/internal/builtin-types.js +0 -4
- package/internal/builtin-types.js.map +0 -1
- package/internal/builtin-types.mjs +0 -3
- package/internal/builtin-types.mjs.map +0 -1
- package/internal/detect-platform.d.mts +0 -15
- package/internal/detect-platform.d.mts.map +0 -1
- package/internal/detect-platform.d.ts +0 -15
- package/internal/detect-platform.d.ts.map +0 -1
- package/internal/detect-platform.js +0 -162
- package/internal/detect-platform.js.map +0 -1
- package/internal/detect-platform.mjs +0 -157
- package/internal/detect-platform.mjs.map +0 -1
- package/internal/errors.d.mts +0 -3
- package/internal/errors.d.mts.map +0 -1
- package/internal/errors.d.ts +0 -3
- package/internal/errors.d.ts.map +0 -1
- package/internal/errors.js +0 -41
- package/internal/errors.js.map +0 -1
- package/internal/errors.mjs +0 -36
- package/internal/errors.mjs.map +0 -1
- package/internal/headers.d.mts +0 -20
- package/internal/headers.d.mts.map +0 -1
- package/internal/headers.d.ts +0 -20
- package/internal/headers.d.ts.map +0 -1
- package/internal/headers.js +0 -79
- package/internal/headers.js.map +0 -1
- package/internal/headers.mjs +0 -74
- package/internal/headers.mjs.map +0 -1
- package/internal/parse.d.mts +0 -12
- package/internal/parse.d.mts.map +0 -1
- package/internal/parse.d.ts +0 -12
- package/internal/parse.d.ts.map +0 -1
- package/internal/parse.js +0 -40
- package/internal/parse.js.map +0 -1
- package/internal/parse.mjs +0 -37
- package/internal/parse.mjs.map +0 -1
- package/internal/qs/formats.d.mts +0 -7
- package/internal/qs/formats.d.mts.map +0 -1
- package/internal/qs/formats.d.ts +0 -7
- package/internal/qs/formats.d.ts.map +0 -1
- package/internal/qs/formats.js +0 -13
- package/internal/qs/formats.js.map +0 -1
- package/internal/qs/formats.mjs +0 -9
- package/internal/qs/formats.mjs.map +0 -1
- package/internal/qs/index.d.mts +0 -10
- package/internal/qs/index.d.mts.map +0 -1
- package/internal/qs/index.d.ts +0 -10
- package/internal/qs/index.d.ts.map +0 -1
- package/internal/qs/index.js +0 -14
- package/internal/qs/index.js.map +0 -1
- package/internal/qs/index.mjs +0 -10
- package/internal/qs/index.mjs.map +0 -1
- package/internal/qs/stringify.d.mts +0 -3
- package/internal/qs/stringify.d.mts.map +0 -1
- package/internal/qs/stringify.d.ts +0 -3
- package/internal/qs/stringify.d.ts.map +0 -1
- package/internal/qs/stringify.js +0 -277
- package/internal/qs/stringify.js.map +0 -1
- package/internal/qs/stringify.mjs +0 -274
- package/internal/qs/stringify.mjs.map +0 -1
- package/internal/qs/types.d.mts +0 -57
- package/internal/qs/types.d.mts.map +0 -1
- package/internal/qs/types.d.ts +0 -57
- package/internal/qs/types.d.ts.map +0 -1
- package/internal/qs/types.js +0 -3
- package/internal/qs/types.js.map +0 -1
- package/internal/qs/types.mjs +0 -2
- package/internal/qs/types.mjs.map +0 -1
- package/internal/qs/utils.d.mts +0 -15
- package/internal/qs/utils.d.mts.map +0 -1
- package/internal/qs/utils.d.ts +0 -15
- package/internal/qs/utils.d.ts.map +0 -1
- package/internal/qs/utils.js +0 -230
- package/internal/qs/utils.js.map +0 -1
- package/internal/qs/utils.mjs +0 -217
- package/internal/qs/utils.mjs.map +0 -1
- package/internal/request-options.d.mts +0 -75
- package/internal/request-options.d.mts.map +0 -1
- package/internal/request-options.d.ts +0 -75
- package/internal/request-options.d.ts.map +0 -1
- package/internal/request-options.js +0 -14
- package/internal/request-options.js.map +0 -1
- package/internal/request-options.mjs +0 -10
- package/internal/request-options.mjs.map +0 -1
- package/internal/shim-types.d.mts +0 -17
- package/internal/shim-types.d.mts.map +0 -1
- package/internal/shim-types.d.ts +0 -17
- package/internal/shim-types.d.ts.map +0 -1
- package/internal/shim-types.js +0 -4
- package/internal/shim-types.js.map +0 -1
- package/internal/shim-types.mjs +0 -3
- package/internal/shim-types.mjs.map +0 -1
- package/internal/shims.d.mts +0 -20
- package/internal/shims.d.mts.map +0 -1
- package/internal/shims.d.ts +0 -20
- package/internal/shims.d.ts.map +0 -1
- package/internal/shims.js +0 -92
- package/internal/shims.js.map +0 -1
- package/internal/shims.mjs +0 -85
- package/internal/shims.mjs.map +0 -1
- package/internal/to-file.d.mts +0 -45
- package/internal/to-file.d.mts.map +0 -1
- package/internal/to-file.d.ts +0 -45
- package/internal/to-file.d.ts.map +0 -1
- package/internal/to-file.js +0 -91
- package/internal/to-file.js.map +0 -1
- package/internal/to-file.mjs +0 -88
- package/internal/to-file.mjs.map +0 -1
- package/internal/tslib.js +0 -81
- package/internal/tslib.mjs +0 -17
- package/internal/types.d.mts +0 -69
- package/internal/types.d.mts.map +0 -1
- package/internal/types.d.ts +0 -69
- package/internal/types.d.ts.map +0 -1
- package/internal/types.js +0 -4
- package/internal/types.js.map +0 -1
- package/internal/types.mjs +0 -3
- package/internal/types.mjs.map +0 -1
- package/internal/uploads.d.mts +0 -42
- package/internal/uploads.d.mts.map +0 -1
- package/internal/uploads.d.ts +0 -42
- package/internal/uploads.d.ts.map +0 -1
- package/internal/uploads.js +0 -141
- package/internal/uploads.js.map +0 -1
- package/internal/uploads.mjs +0 -131
- package/internal/uploads.mjs.map +0 -1
- package/internal/utils/base64.d.mts +0 -3
- package/internal/utils/base64.d.mts.map +0 -1
- package/internal/utils/base64.d.ts +0 -3
- package/internal/utils/base64.d.ts.map +0 -1
- package/internal/utils/base64.js +0 -38
- package/internal/utils/base64.js.map +0 -1
- package/internal/utils/base64.mjs +0 -33
- package/internal/utils/base64.mjs.map +0 -1
- package/internal/utils/bytes.d.mts +0 -4
- package/internal/utils/bytes.d.mts.map +0 -1
- package/internal/utils/bytes.d.ts +0 -4
- package/internal/utils/bytes.d.ts.map +0 -1
- package/internal/utils/bytes.js +0 -31
- package/internal/utils/bytes.js.map +0 -1
- package/internal/utils/bytes.mjs +0 -26
- package/internal/utils/bytes.mjs.map +0 -1
- package/internal/utils/env.d.mts +0 -9
- package/internal/utils/env.d.mts.map +0 -1
- package/internal/utils/env.d.ts +0 -9
- package/internal/utils/env.d.ts.map +0 -1
- package/internal/utils/env.js +0 -22
- package/internal/utils/env.js.map +0 -1
- package/internal/utils/env.mjs +0 -18
- package/internal/utils/env.mjs.map +0 -1
- package/internal/utils/log.d.mts +0 -37
- package/internal/utils/log.d.mts.map +0 -1
- package/internal/utils/log.d.ts +0 -37
- package/internal/utils/log.d.ts.map +0 -1
- package/internal/utils/log.js +0 -86
- package/internal/utils/log.js.map +0 -1
- package/internal/utils/log.mjs +0 -80
- package/internal/utils/log.mjs.map +0 -1
- package/internal/utils/path.d.mts +0 -15
- package/internal/utils/path.d.mts.map +0 -1
- package/internal/utils/path.d.ts +0 -15
- package/internal/utils/path.d.ts.map +0 -1
- package/internal/utils/path.js +0 -79
- package/internal/utils/path.js.map +0 -1
- package/internal/utils/path.mjs +0 -74
- package/internal/utils/path.mjs.map +0 -1
- package/internal/utils/query.d.mts +0 -2
- package/internal/utils/query.d.mts.map +0 -1
- package/internal/utils/query.d.ts +0 -2
- package/internal/utils/query.d.ts.map +0 -1
- package/internal/utils/query.js +0 -10
- package/internal/utils/query.js.map +0 -1
- package/internal/utils/query.mjs +0 -6
- package/internal/utils/query.mjs.map +0 -1
- package/internal/utils/sleep.d.mts +0 -2
- package/internal/utils/sleep.d.mts.map +0 -1
- package/internal/utils/sleep.d.ts +0 -2
- package/internal/utils/sleep.d.ts.map +0 -1
- package/internal/utils/sleep.js +0 -7
- package/internal/utils/sleep.js.map +0 -1
- package/internal/utils/sleep.mjs +0 -3
- package/internal/utils/sleep.mjs.map +0 -1
- package/internal/utils/uuid.d.mts +0 -5
- package/internal/utils/uuid.d.mts.map +0 -1
- package/internal/utils/uuid.d.ts +0 -5
- package/internal/utils/uuid.d.ts.map +0 -1
- package/internal/utils/uuid.js +0 -19
- package/internal/utils/uuid.js.map +0 -1
- package/internal/utils/uuid.mjs +0 -15
- package/internal/utils/uuid.mjs.map +0 -1
- package/internal/utils/values.d.mts +0 -18
- package/internal/utils/values.d.mts.map +0 -1
- package/internal/utils/values.d.ts +0 -18
- package/internal/utils/values.d.ts.map +0 -1
- package/internal/utils/values.js +0 -112
- package/internal/utils/values.js.map +0 -1
- package/internal/utils/values.mjs +0 -94
- package/internal/utils/values.mjs.map +0 -1
- package/internal/utils.d.mts +0 -8
- package/internal/utils.d.mts.map +0 -1
- package/internal/utils.d.ts +0 -8
- package/internal/utils.d.ts.map +0 -1
- package/internal/utils.js +0 -12
- package/internal/utils.js.map +0 -1
- package/internal/utils.mjs +0 -9
- package/internal/utils.mjs.map +0 -1
- package/resource.d.mts +0 -2
- package/resource.d.mts.map +0 -1
- package/resource.d.ts +0 -2
- package/resource.d.ts.map +0 -1
- package/resource.js +0 -6
- package/resource.js.map +0 -1
- package/resource.mjs +0 -2
- package/resource.mjs.map +0 -1
- package/resources/connect/connect.d.mts +0 -26
- package/resources/connect/connect.d.mts.map +0 -1
- package/resources/connect/connect.d.ts +0 -26
- package/resources/connect/connect.d.ts.map +0 -1
- package/resources/connect/connect.js +0 -24
- package/resources/connect/connect.js.map +0 -1
- package/resources/connect/connect.mjs +0 -19
- package/resources/connect/connect.mjs.map +0 -1
- package/resources/connect/index.d.mts +0 -3
- package/resources/connect/index.d.mts.map +0 -1
- package/resources/connect/index.d.ts +0 -3
- package/resources/connect/index.d.ts.map +0 -1
- package/resources/connect/index.js +0 -9
- package/resources/connect/index.js.map +0 -1
- package/resources/connect/index.mjs +0 -4
- package/resources/connect/index.mjs.map +0 -1
- package/resources/connect/integrations.d.mts +0 -64
- package/resources/connect/integrations.d.mts.map +0 -1
- package/resources/connect/integrations.d.ts +0 -64
- package/resources/connect/integrations.d.ts.map +0 -1
- package/resources/connect/integrations.js +0 -22
- package/resources/connect/integrations.js.map +0 -1
- package/resources/connect/integrations.mjs +0 -18
- package/resources/connect/integrations.mjs.map +0 -1
- package/resources/connect.d.mts +0 -2
- package/resources/connect.d.mts.map +0 -1
- package/resources/connect.d.ts +0 -2
- package/resources/connect.d.ts.map +0 -1
- package/resources/connect.js +0 -6
- package/resources/connect.js.map +0 -1
- package/resources/connect.mjs +0 -3
- package/resources/connect.mjs.map +0 -1
- package/resources/health.d.mts +0 -23
- package/resources/health.d.mts.map +0 -1
- package/resources/health.d.ts +0 -23
- package/resources/health.d.ts.map +0 -1
- package/resources/health.js +0 -21
- package/resources/health.js.map +0 -1
- package/resources/health.mjs +0 -17
- package/resources/health.mjs.map +0 -1
- package/resources/index.d.mts +0 -6
- package/resources/index.d.mts.map +0 -1
- package/resources/index.d.ts +0 -6
- package/resources/index.d.ts.map +0 -1
- package/resources/index.js +0 -15
- package/resources/index.js.map +0 -1
- package/resources/index.mjs +0 -7
- package/resources/index.mjs.map +0 -1
- package/resources/media.d.mts +0 -27
- package/resources/media.d.mts.map +0 -1
- package/resources/media.d.ts +0 -27
- package/resources/media.d.ts.map +0 -1
- package/resources/media.js +0 -15
- package/resources/media.js.map +0 -1
- package/resources/media.mjs +0 -11
- package/resources/media.mjs.map +0 -1
- package/resources/platforms.d.mts +0 -22
- package/resources/platforms.d.mts.map +0 -1
- package/resources/platforms.d.ts +0 -22
- package/resources/platforms.d.ts.map +0 -1
- package/resources/platforms.js +0 -15
- package/resources/platforms.js.map +0 -1
- package/resources/platforms.mjs +0 -11
- package/resources/platforms.mjs.map +0 -1
- package/resources/posts/index.d.mts +0 -3
- package/resources/posts/index.d.mts.map +0 -1
- package/resources/posts/index.d.ts +0 -3
- package/resources/posts/index.d.ts.map +0 -1
- package/resources/posts/index.js +0 -9
- package/resources/posts/index.js.map +0 -1
- package/resources/posts/index.mjs +0 -4
- package/resources/posts/index.mjs.map +0 -1
- package/resources/posts/posts.d.mts +0 -279
- package/resources/posts/posts.d.mts.map +0 -1
- package/resources/posts/posts.d.ts +0 -279
- package/resources/posts/posts.d.ts.map +0 -1
- package/resources/posts/posts.js +0 -69
- package/resources/posts/posts.js.map +0 -1
- package/resources/posts/posts.mjs +0 -64
- package/resources/posts/posts.mjs.map +0 -1
- package/resources/posts/scheduled.d.mts +0 -105
- package/resources/posts/scheduled.d.mts.map +0 -1
- package/resources/posts/scheduled.d.ts +0 -105
- package/resources/posts/scheduled.d.ts.map +0 -1
- package/resources/posts/scheduled.js +0 -48
- package/resources/posts/scheduled.js.map +0 -1
- package/resources/posts/scheduled.mjs +0 -44
- package/resources/posts/scheduled.mjs.map +0 -1
- package/resources/posts.d.mts +0 -2
- package/resources/posts.d.mts.map +0 -1
- package/resources/posts.d.ts +0 -2
- package/resources/posts.d.ts.map +0 -1
- package/resources/posts.js +0 -6
- package/resources/posts.js.map +0 -1
- package/resources/posts.mjs +0 -3
- package/resources/posts.mjs.map +0 -1
- package/resources.d.mts +0 -2
- package/resources.d.mts.map +0 -1
- package/resources.d.ts +0 -2
- package/resources.d.ts.map +0 -1
- package/resources.js +0 -5
- package/resources.js.map +0 -1
- package/resources.mjs +0 -2
- package/resources.mjs.map +0 -1
- package/src/api-promise.ts +0 -2
- package/src/client.ts +0 -789
- package/src/core/README.md +0 -3
- package/src/core/api-promise.ts +0 -92
- package/src/core/error.ts +0 -130
- package/src/core/resource.ts +0 -11
- package/src/core/uploads.ts +0 -2
- package/src/error.ts +0 -2
- package/src/index.ts +0 -22
- package/src/internal/README.md +0 -3
- package/src/internal/builtin-types.ts +0 -93
- package/src/internal/detect-platform.ts +0 -196
- package/src/internal/errors.ts +0 -33
- package/src/internal/headers.ts +0 -97
- package/src/internal/parse.ts +0 -56
- package/src/internal/qs/LICENSE.md +0 -13
- package/src/internal/qs/README.md +0 -3
- package/src/internal/qs/formats.ts +0 -10
- package/src/internal/qs/index.ts +0 -13
- package/src/internal/qs/stringify.ts +0 -385
- package/src/internal/qs/types.ts +0 -71
- package/src/internal/qs/utils.ts +0 -265
- package/src/internal/request-options.ts +0 -91
- package/src/internal/shim-types.ts +0 -26
- package/src/internal/shims.ts +0 -107
- package/src/internal/to-file.ts +0 -154
- package/src/internal/types.ts +0 -93
- package/src/internal/uploads.ts +0 -187
- package/src/internal/utils/base64.ts +0 -40
- package/src/internal/utils/bytes.ts +0 -32
- package/src/internal/utils/env.ts +0 -18
- package/src/internal/utils/log.ts +0 -127
- package/src/internal/utils/path.ts +0 -88
- package/src/internal/utils/query.ts +0 -7
- package/src/internal/utils/sleep.ts +0 -3
- package/src/internal/utils/uuid.ts +0 -17
- package/src/internal/utils/values.ts +0 -105
- package/src/internal/utils.ts +0 -9
- package/src/lib/.keep +0 -4
- package/src/resource.ts +0 -2
- package/src/resources/connect/connect.ts +0 -55
- package/src/resources/connect/index.ts +0 -9
- package/src/resources/connect/integrations.ts +0 -96
- package/src/resources/connect.ts +0 -3
- package/src/resources/health.ts +0 -36
- package/src/resources/index.ts +0 -16
- package/src/resources/media.ts +0 -38
- package/src/resources/platforms.ts +0 -30
- package/src/resources/posts/index.ts +0 -19
- package/src/resources/posts/posts.ts +0 -399
- package/src/resources/posts/scheduled.ts +0 -147
- package/src/resources/posts.ts +0 -3
- package/src/resources.ts +0 -1
- package/src/tsconfig.json +0 -11
- package/src/uploads.ts +0 -2
- package/src/version.ts +0 -1
- package/uploads.d.mts +0 -2
- package/uploads.d.mts.map +0 -1
- package/uploads.d.ts +0 -2
- package/uploads.d.ts.map +0 -1
- package/uploads.js +0 -6
- package/uploads.js.map +0 -1
- package/uploads.mjs +0 -2
- package/uploads.mjs.map +0 -1
- package/version.d.mts +0 -2
- package/version.d.mts.map +0 -1
- package/version.d.ts +0 -2
- package/version.d.ts.map +0 -1
- package/version.js +0 -5
- package/version.js.map +0 -1
- package/version.mjs +0 -2
- package/version.mjs.map +0 -1
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,3484 @@
|
|
|
1
|
+
type AuthToken = string | undefined;
|
|
2
|
+
interface Auth {
|
|
3
|
+
/**
|
|
4
|
+
* Which part of the request do we use to send the auth?
|
|
5
|
+
*
|
|
6
|
+
* @default 'header'
|
|
7
|
+
*/
|
|
8
|
+
in?: 'header' | 'query' | 'cookie';
|
|
9
|
+
/**
|
|
10
|
+
* A unique identifier for the security scheme.
|
|
11
|
+
*
|
|
12
|
+
* Defined only when there are multiple security schemes whose `Auth`
|
|
13
|
+
* shape would otherwise be identical.
|
|
14
|
+
*/
|
|
15
|
+
key?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Header or query parameter name.
|
|
18
|
+
*
|
|
19
|
+
* @default 'Authorization'
|
|
20
|
+
*/
|
|
21
|
+
name?: string;
|
|
22
|
+
scheme?: 'basic' | 'bearer';
|
|
23
|
+
type: 'apiKey' | 'http';
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
interface SerializerOptions<T> {
|
|
27
|
+
/**
|
|
28
|
+
* @default true
|
|
29
|
+
*/
|
|
30
|
+
explode: boolean;
|
|
31
|
+
style: T;
|
|
32
|
+
}
|
|
33
|
+
type ArrayStyle = 'form' | 'spaceDelimited' | 'pipeDelimited';
|
|
34
|
+
type ObjectStyle = 'form' | 'deepObject';
|
|
35
|
+
|
|
36
|
+
type QuerySerializer = (query: Record<string, unknown>) => string;
|
|
37
|
+
type BodySerializer = (body: unknown) => unknown;
|
|
38
|
+
type QuerySerializerOptionsObject = {
|
|
39
|
+
allowReserved?: boolean;
|
|
40
|
+
array?: Partial<SerializerOptions<ArrayStyle>>;
|
|
41
|
+
object?: Partial<SerializerOptions<ObjectStyle>>;
|
|
42
|
+
};
|
|
43
|
+
type QuerySerializerOptions = QuerySerializerOptionsObject & {
|
|
44
|
+
/**
|
|
45
|
+
* Per-parameter serialization overrides. When provided, these settings
|
|
46
|
+
* override the global array/object settings for specific parameter names.
|
|
47
|
+
*/
|
|
48
|
+
parameters?: Record<string, QuerySerializerOptionsObject>;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
type HttpMethod = 'connect' | 'delete' | 'get' | 'head' | 'options' | 'patch' | 'post' | 'put' | 'trace';
|
|
52
|
+
type Client$1<RequestFn = never, Config = unknown, MethodFn = never, BuildUrlFn = never, SseFn = never> = {
|
|
53
|
+
/**
|
|
54
|
+
* Returns the final request URL.
|
|
55
|
+
*/
|
|
56
|
+
buildUrl: BuildUrlFn;
|
|
57
|
+
getConfig: () => Config;
|
|
58
|
+
request: RequestFn;
|
|
59
|
+
setConfig: (config: Config) => Config;
|
|
60
|
+
} & {
|
|
61
|
+
[K in HttpMethod]: MethodFn;
|
|
62
|
+
} & ([SseFn] extends [never] ? {
|
|
63
|
+
sse?: never;
|
|
64
|
+
} : {
|
|
65
|
+
sse: {
|
|
66
|
+
[K in HttpMethod]: SseFn;
|
|
67
|
+
};
|
|
68
|
+
});
|
|
69
|
+
interface Config$1 {
|
|
70
|
+
/**
|
|
71
|
+
* Auth token or a function returning auth token. The resolved value will be
|
|
72
|
+
* added to the request payload as defined by its `security` array.
|
|
73
|
+
*/
|
|
74
|
+
auth?: ((auth: Auth) => Promise<AuthToken> | AuthToken) | AuthToken;
|
|
75
|
+
/**
|
|
76
|
+
* A function for serializing request body parameter. By default,
|
|
77
|
+
* {@link JSON.stringify()} will be used.
|
|
78
|
+
*/
|
|
79
|
+
bodySerializer?: BodySerializer | null;
|
|
80
|
+
/**
|
|
81
|
+
* An object containing any HTTP headers that you want to pre-populate your
|
|
82
|
+
* `Headers` object with.
|
|
83
|
+
*
|
|
84
|
+
* {@link https://developer.mozilla.org/docs/Web/API/Headers/Headers#init See more}
|
|
85
|
+
*/
|
|
86
|
+
headers?: RequestInit['headers'] | Record<string, string | number | boolean | (string | number | boolean)[] | null | undefined | unknown>;
|
|
87
|
+
/**
|
|
88
|
+
* The request method.
|
|
89
|
+
*
|
|
90
|
+
* {@link https://developer.mozilla.org/docs/Web/API/fetch#method See more}
|
|
91
|
+
*/
|
|
92
|
+
method?: Uppercase<HttpMethod>;
|
|
93
|
+
/**
|
|
94
|
+
* A function for serializing request query parameters. By default, arrays
|
|
95
|
+
* will be exploded in form style, objects will be exploded in deepObject
|
|
96
|
+
* style, and reserved characters are percent-encoded.
|
|
97
|
+
*
|
|
98
|
+
* This method will have no effect if the native `paramsSerializer()` Axios
|
|
99
|
+
* API function is used.
|
|
100
|
+
*
|
|
101
|
+
* {@link https://swagger.io/docs/specification/serialization/#query View examples}
|
|
102
|
+
*/
|
|
103
|
+
querySerializer?: QuerySerializer | QuerySerializerOptions;
|
|
104
|
+
/**
|
|
105
|
+
* A function validating request data. This is useful if you want to ensure
|
|
106
|
+
* the request conforms to the desired shape, so it can be safely sent to
|
|
107
|
+
* the server.
|
|
108
|
+
*/
|
|
109
|
+
requestValidator?: (data: unknown) => Promise<unknown>;
|
|
110
|
+
/**
|
|
111
|
+
* A function transforming response data before it's returned. This is useful
|
|
112
|
+
* for post-processing data, e.g., converting ISO strings into Date objects.
|
|
113
|
+
*/
|
|
114
|
+
responseTransformer?: (data: unknown) => Promise<unknown>;
|
|
115
|
+
/**
|
|
116
|
+
* A function validating response data. This is useful if you want to ensure
|
|
117
|
+
* the response conforms to the desired shape, so it can be safely passed to
|
|
118
|
+
* the transformers and returned to the user.
|
|
119
|
+
*/
|
|
120
|
+
responseValidator?: (data: unknown) => Promise<unknown>;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Arbitrary metadata passed through the `meta` request option.
|
|
124
|
+
*/
|
|
125
|
+
interface ClientMeta {
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
type ServerSentEventsOptions<TData = unknown> = Omit<RequestInit, 'method'> & Pick<Config$1, 'method' | 'responseTransformer' | 'responseValidator'> & {
|
|
129
|
+
/**
|
|
130
|
+
* Fetch API implementation. You can use this option to provide a custom
|
|
131
|
+
* fetch instance.
|
|
132
|
+
*
|
|
133
|
+
* @default globalThis.fetch
|
|
134
|
+
*/
|
|
135
|
+
fetch?: typeof fetch;
|
|
136
|
+
/**
|
|
137
|
+
* Implementing clients can call request interceptors inside this hook.
|
|
138
|
+
*/
|
|
139
|
+
onRequest?: (url: string, init: RequestInit) => Promise<Request>;
|
|
140
|
+
/**
|
|
141
|
+
* Callback invoked when a network or parsing error occurs during streaming.
|
|
142
|
+
*
|
|
143
|
+
* This option applies only if the endpoint returns a stream of events.
|
|
144
|
+
*
|
|
145
|
+
* @param error The error that occurred.
|
|
146
|
+
*/
|
|
147
|
+
onSseError?: (error: unknown) => void;
|
|
148
|
+
/**
|
|
149
|
+
* Callback invoked when an event is streamed from the server.
|
|
150
|
+
*
|
|
151
|
+
* This option applies only if the endpoint returns a stream of events.
|
|
152
|
+
*
|
|
153
|
+
* @param event Event streamed from the server.
|
|
154
|
+
* @returns Nothing (void).
|
|
155
|
+
*/
|
|
156
|
+
onSseEvent?: (event: StreamEvent<TData>) => void;
|
|
157
|
+
serializedBody?: RequestInit['body'];
|
|
158
|
+
/**
|
|
159
|
+
* Default retry delay in milliseconds.
|
|
160
|
+
*
|
|
161
|
+
* This option applies only if the endpoint returns a stream of events.
|
|
162
|
+
*
|
|
163
|
+
* @default 3000
|
|
164
|
+
*/
|
|
165
|
+
sseDefaultRetryDelay?: number;
|
|
166
|
+
/**
|
|
167
|
+
* Maximum number of retry attempts before giving up.
|
|
168
|
+
*/
|
|
169
|
+
sseMaxRetryAttempts?: number;
|
|
170
|
+
/**
|
|
171
|
+
* Maximum retry delay in milliseconds.
|
|
172
|
+
*
|
|
173
|
+
* Applies only when exponential backoff is used.
|
|
174
|
+
*
|
|
175
|
+
* This option applies only if the endpoint returns a stream of events.
|
|
176
|
+
*
|
|
177
|
+
* @default 30000
|
|
178
|
+
*/
|
|
179
|
+
sseMaxRetryDelay?: number;
|
|
180
|
+
/**
|
|
181
|
+
* Optional sleep function for retry backoff.
|
|
182
|
+
*
|
|
183
|
+
* Defaults to using `setTimeout`.
|
|
184
|
+
*/
|
|
185
|
+
sseSleepFn?: (ms: number) => Promise<void>;
|
|
186
|
+
url: string;
|
|
187
|
+
};
|
|
188
|
+
interface StreamEvent<TData = unknown> {
|
|
189
|
+
data: TData;
|
|
190
|
+
event?: string;
|
|
191
|
+
id?: string;
|
|
192
|
+
retry?: number;
|
|
193
|
+
}
|
|
194
|
+
type ServerSentEventsResult<TData = unknown, TReturn = void, TNext = unknown> = {
|
|
195
|
+
stream: AsyncGenerator<TData extends Record<string, unknown> ? TData[keyof TData] : TData, TReturn, TNext>;
|
|
196
|
+
};
|
|
197
|
+
|
|
198
|
+
type ErrInterceptor<Err, Res, Req, Options> = (error: Err,
|
|
199
|
+
/** response may be undefined due to a network error where no response object is produced */
|
|
200
|
+
response: Res | undefined,
|
|
201
|
+
/** request may be undefined, because error may be from building the request object itself */
|
|
202
|
+
request: Req | undefined, options: Options) => Err | Promise<Err>;
|
|
203
|
+
type ReqInterceptor<Req, Options> = (request: Req, options: Options) => Req | Promise<Req>;
|
|
204
|
+
type ResInterceptor<Res, Req, Options> = (response: Res, request: Req, options: Options) => Res | Promise<Res>;
|
|
205
|
+
declare class Interceptors<Interceptor> {
|
|
206
|
+
fns: Array<Interceptor | null>;
|
|
207
|
+
clear(): void;
|
|
208
|
+
eject(id: number | Interceptor): void;
|
|
209
|
+
exists(id: number | Interceptor): boolean;
|
|
210
|
+
getInterceptorIndex(id: number | Interceptor): number;
|
|
211
|
+
update(id: number | Interceptor, fn: Interceptor): number | Interceptor | false;
|
|
212
|
+
use(fn: Interceptor): number;
|
|
213
|
+
}
|
|
214
|
+
interface Middleware<Req, Res, Err, Options> {
|
|
215
|
+
error: Interceptors<ErrInterceptor<Err, Res, Req, Options>>;
|
|
216
|
+
request: Interceptors<ReqInterceptor<Req, Options>>;
|
|
217
|
+
response: Interceptors<ResInterceptor<Res, Req, Options>>;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
type ResponseStyle = 'data' | 'fields';
|
|
221
|
+
interface Config<T extends ClientOptions$1 = ClientOptions$1> extends Omit<RequestInit, 'body' | 'headers' | 'method'>, Config$1 {
|
|
222
|
+
/**
|
|
223
|
+
* Base URL for all requests made by this client.
|
|
224
|
+
*/
|
|
225
|
+
baseUrl?: T['baseUrl'];
|
|
226
|
+
/**
|
|
227
|
+
* Fetch API implementation. You can use this option to provide a custom
|
|
228
|
+
* fetch instance.
|
|
229
|
+
*
|
|
230
|
+
* @default globalThis.fetch
|
|
231
|
+
*/
|
|
232
|
+
fetch?: typeof fetch;
|
|
233
|
+
/**
|
|
234
|
+
* Please don't use the Fetch client for Next.js applications. The `next`
|
|
235
|
+
* options won't have any effect.
|
|
236
|
+
*
|
|
237
|
+
* Install {@link https://www.npmjs.com/package/@hey-api/client-next `@hey-api/client-next`} instead.
|
|
238
|
+
*/
|
|
239
|
+
next?: never;
|
|
240
|
+
/**
|
|
241
|
+
* Return the response data parsed in a specified format. By default, `auto`
|
|
242
|
+
* will infer the appropriate method from the `Content-Type` response header.
|
|
243
|
+
* You can override this behavior with any of the {@link Body} methods.
|
|
244
|
+
* Select `stream` if you don't want to parse response data at all.
|
|
245
|
+
*
|
|
246
|
+
* @default 'auto'
|
|
247
|
+
*/
|
|
248
|
+
parseAs?: 'arrayBuffer' | 'auto' | 'blob' | 'formData' | 'json' | 'stream' | 'text';
|
|
249
|
+
/**
|
|
250
|
+
* Should we return only data or multiple fields (data, error, response, etc.)?
|
|
251
|
+
*
|
|
252
|
+
* @default 'fields'
|
|
253
|
+
*/
|
|
254
|
+
responseStyle?: ResponseStyle;
|
|
255
|
+
/**
|
|
256
|
+
* Throw an error instead of returning it in the response?
|
|
257
|
+
*
|
|
258
|
+
* @default false
|
|
259
|
+
*/
|
|
260
|
+
throwOnError?: T['throwOnError'];
|
|
261
|
+
}
|
|
262
|
+
interface RequestOptions<TData = unknown, TResponseStyle extends ResponseStyle = 'fields', ThrowOnError extends boolean = boolean, Url extends string = string> extends Config<{
|
|
263
|
+
responseStyle: TResponseStyle;
|
|
264
|
+
throwOnError: ThrowOnError;
|
|
265
|
+
}>, Pick<ServerSentEventsOptions<TData>, 'onRequest' | 'onSseError' | 'onSseEvent' | 'sseDefaultRetryDelay' | 'sseMaxRetryAttempts' | 'sseMaxRetryDelay'> {
|
|
266
|
+
/**
|
|
267
|
+
* Any body that you want to add to your request.
|
|
268
|
+
*
|
|
269
|
+
* {@link https://developer.mozilla.org/docs/Web/API/fetch#body}
|
|
270
|
+
*/
|
|
271
|
+
body?: unknown;
|
|
272
|
+
path?: Record<string, unknown>;
|
|
273
|
+
query?: Record<string, unknown>;
|
|
274
|
+
/**
|
|
275
|
+
* Security mechanism(s) to use for the request.
|
|
276
|
+
*/
|
|
277
|
+
security?: ReadonlyArray<Auth>;
|
|
278
|
+
url: Url;
|
|
279
|
+
}
|
|
280
|
+
interface ResolvedRequestOptions<TResponseStyle extends ResponseStyle = 'fields', ThrowOnError extends boolean = boolean, Url extends string = string> extends RequestOptions<unknown, TResponseStyle, ThrowOnError, Url> {
|
|
281
|
+
headers: Headers;
|
|
282
|
+
serializedBody?: string;
|
|
283
|
+
}
|
|
284
|
+
type RequestResult<TData = unknown, TError = unknown, ThrowOnError extends boolean = boolean, TResponseStyle extends ResponseStyle = 'fields'> = ThrowOnError extends true ? Promise<TResponseStyle extends 'data' ? TData extends Record<string, unknown> ? TData[keyof TData] : TData : {
|
|
285
|
+
data: TData extends Record<string, unknown> ? TData[keyof TData] : TData;
|
|
286
|
+
request: Request;
|
|
287
|
+
response: Response;
|
|
288
|
+
}> : Promise<TResponseStyle extends 'data' ? (TData extends Record<string, unknown> ? TData[keyof TData] : TData) | undefined : ({
|
|
289
|
+
data: TData extends Record<string, unknown> ? TData[keyof TData] : TData;
|
|
290
|
+
error: undefined;
|
|
291
|
+
} | {
|
|
292
|
+
data: undefined;
|
|
293
|
+
error: TError extends Record<string, unknown> ? TError[keyof TError] : TError;
|
|
294
|
+
}) & {
|
|
295
|
+
/** request may be undefined, because error may be from building the request object itself */
|
|
296
|
+
request?: Request;
|
|
297
|
+
/** response may be undefined, because error may be from building the request object itself or from a network error */
|
|
298
|
+
response?: Response;
|
|
299
|
+
}>;
|
|
300
|
+
interface ClientOptions$1 {
|
|
301
|
+
baseUrl?: string;
|
|
302
|
+
responseStyle?: ResponseStyle;
|
|
303
|
+
throwOnError?: boolean;
|
|
304
|
+
}
|
|
305
|
+
type MethodFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = 'fields'>(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, 'method'>) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
|
|
306
|
+
type SseFn = <TData = unknown, _TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = 'fields'>(options: Omit<RequestOptions<never, TResponseStyle, ThrowOnError>, 'method'>) => Promise<ServerSentEventsResult<TData>>;
|
|
307
|
+
type RequestFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = 'fields'>(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, 'method'> & Pick<Required<RequestOptions<TData, TResponseStyle, ThrowOnError>>, 'method'>) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
|
|
308
|
+
type BuildUrlFn = <TData extends {
|
|
309
|
+
body?: unknown;
|
|
310
|
+
path?: Record<string, unknown>;
|
|
311
|
+
query?: Record<string, unknown>;
|
|
312
|
+
url: string;
|
|
313
|
+
}>(options: TData & Options$1<TData>) => string;
|
|
314
|
+
type Client = Client$1<RequestFn, Config, MethodFn, BuildUrlFn, SseFn> & {
|
|
315
|
+
interceptors: Middleware<Request, Response, unknown, ResolvedRequestOptions>;
|
|
316
|
+
};
|
|
317
|
+
interface TDataShape {
|
|
318
|
+
body?: unknown;
|
|
319
|
+
headers?: unknown;
|
|
320
|
+
path?: unknown;
|
|
321
|
+
query?: unknown;
|
|
322
|
+
url: string;
|
|
323
|
+
}
|
|
324
|
+
type OmitKeys<T, K> = Pick<T, Exclude<keyof T, K>>;
|
|
325
|
+
type Options$1<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown, TResponseStyle extends ResponseStyle = 'fields'> = OmitKeys<RequestOptions<TResponse, TResponseStyle, ThrowOnError>, 'body' | 'path' | 'query' | 'url'> & ([TData] extends [never] ? unknown : Omit<TData, 'url'>);
|
|
326
|
+
|
|
327
|
+
type Platform = 'twitter' | 'instagram' | 'youtube' | 'tiktok' | 'pinterest' | 'linkedin' | 'bluesky' | 'facebook' | 'threads' | 'googlebusiness';
|
|
328
|
+
type Status = 'draft' | 'pending' | 'scheduled' | 'publishing' | 'published' | 'failed' | 'partial';
|
|
329
|
+
type SortOrder = 'asc' | 'desc';
|
|
330
|
+
type ErrorResponse = {
|
|
331
|
+
success: boolean;
|
|
332
|
+
message: string;
|
|
333
|
+
};
|
|
334
|
+
/**
|
|
335
|
+
* Pass this object in platformSpecificData when posting to Twitter/X, including Community post options.
|
|
336
|
+
*/
|
|
337
|
+
type TwitterConfigurations = {
|
|
338
|
+
/**
|
|
339
|
+
* Community ID to publish this post into.
|
|
340
|
+
*/
|
|
341
|
+
communityId?: string;
|
|
342
|
+
/**
|
|
343
|
+
* When posting to a Community, also share the post with followers.
|
|
344
|
+
*/
|
|
345
|
+
shareWithFollowers?: boolean;
|
|
346
|
+
/**
|
|
347
|
+
* Tweet ID to reply to.
|
|
348
|
+
*/
|
|
349
|
+
replyToTweetId?: string;
|
|
350
|
+
replySettings?: 'following' | 'mentionedUsers' | 'subscribers' | 'verified';
|
|
351
|
+
/**
|
|
352
|
+
* Additional tweets to chain as a thread. The root tweet uses post.content.
|
|
353
|
+
*/
|
|
354
|
+
threadItems?: Array<{
|
|
355
|
+
/**
|
|
356
|
+
* Text of this thread tweet (max 280 chars)
|
|
357
|
+
*/
|
|
358
|
+
content: string;
|
|
359
|
+
mediaItems?: Array<{
|
|
360
|
+
type: 'image' | 'video' | 'gif' | 'document';
|
|
361
|
+
url: string;
|
|
362
|
+
/**
|
|
363
|
+
* Thumbnail image URL for video items. Supported on YouTube regular videos (not Shorts). JPEG, PNG, or GIF, max 2 MB, min 640 px wide.
|
|
364
|
+
*/
|
|
365
|
+
thumbnail?: string;
|
|
366
|
+
}>;
|
|
367
|
+
}>;
|
|
368
|
+
/**
|
|
369
|
+
* Cannot be combined with media or threadItems.
|
|
370
|
+
*/
|
|
371
|
+
poll?: {
|
|
372
|
+
/**
|
|
373
|
+
* 2–4 poll options.
|
|
374
|
+
*/
|
|
375
|
+
options: Array<string>;
|
|
376
|
+
/**
|
|
377
|
+
* Poll duration in minutes (5 min – 7 days).
|
|
378
|
+
*/
|
|
379
|
+
durationMinutes: number;
|
|
380
|
+
};
|
|
381
|
+
};
|
|
382
|
+
/**
|
|
383
|
+
* Pass this object in platformSpecificData when posting to YouTube.
|
|
384
|
+
*/
|
|
385
|
+
type YouTubeConfigurations = {
|
|
386
|
+
/**
|
|
387
|
+
* Video title (max 100 chars, no < or >). Defaults to first 100 chars of content, or "Untitled Video".
|
|
388
|
+
*/
|
|
389
|
+
title?: string;
|
|
390
|
+
/**
|
|
391
|
+
* Video tags. Total characters across all tags must be ≤500.
|
|
392
|
+
*/
|
|
393
|
+
tags?: Array<string>;
|
|
394
|
+
/**
|
|
395
|
+
* Who can see the video. Defaults to "public". Scheduled posts upload as private and flip to this value at publish time.
|
|
396
|
+
*/
|
|
397
|
+
visibility?: 'public' | 'private' | 'unlisted';
|
|
398
|
+
/**
|
|
399
|
+
* COPPA compliance flag. Setting to true permanently disables comments, notification bell, personalized ads, end screens, and cards on the video. Defaults to false.
|
|
400
|
+
*/
|
|
401
|
+
madeForKids?: boolean;
|
|
402
|
+
/**
|
|
403
|
+
* AI-generated content disclosure. YouTube is increasingly enforcing this requirement. Defaults to false.
|
|
404
|
+
*/
|
|
405
|
+
containsSyntheticMedia?: boolean;
|
|
406
|
+
/**
|
|
407
|
+
* YouTube category ID. Defaults to "22" (People & Blogs). Common values: "1" Film & Animation, "10" Music, "20" Gaming, "22" People & Blogs, "27" Education, "28" Science & Technology.
|
|
408
|
+
*/
|
|
409
|
+
categoryId?: string;
|
|
410
|
+
/**
|
|
411
|
+
* Auto-posted comment after the video goes live. Max 10,000 characters. For publishNow posts: posted immediately after upload. For scheduled posts: posted when the video becomes public.
|
|
412
|
+
*/
|
|
413
|
+
firstComment?: string;
|
|
414
|
+
};
|
|
415
|
+
/**
|
|
416
|
+
* Pass this object in platformSpecificData when posting to TikTok.
|
|
417
|
+
*/
|
|
418
|
+
type TikTokConfigurations = {
|
|
419
|
+
/**
|
|
420
|
+
* Who can see this post. Defaults to "PUBLIC_TO_EVERYONE".
|
|
421
|
+
*/
|
|
422
|
+
privacyLevel?: 'PUBLIC_TO_EVERYONE' | 'MUTUAL_FOLLOW_FRIENDS' | 'FOLLOWER_OF_CREATOR' | 'SELF_ONLY';
|
|
423
|
+
/**
|
|
424
|
+
* Disable comments on this post. Defaults to false.
|
|
425
|
+
*/
|
|
426
|
+
disableComment?: boolean;
|
|
427
|
+
/**
|
|
428
|
+
* Disable duet for this video. Videos only. Defaults to false.
|
|
429
|
+
*/
|
|
430
|
+
disableDuet?: boolean;
|
|
431
|
+
/**
|
|
432
|
+
* Disable stitch for this video. Videos only. Defaults to false.
|
|
433
|
+
*/
|
|
434
|
+
disableStitch?: boolean;
|
|
435
|
+
/**
|
|
436
|
+
* Mark as branded content (paid partnership). Defaults to false.
|
|
437
|
+
*/
|
|
438
|
+
brandContentToggle?: boolean;
|
|
439
|
+
/**
|
|
440
|
+
* Mark as organic brand promotion. Defaults to false.
|
|
441
|
+
*/
|
|
442
|
+
brandOrganicToggle?: boolean;
|
|
443
|
+
/**
|
|
444
|
+
* AI-generated content disclosure. Videos only. Defaults to false.
|
|
445
|
+
*/
|
|
446
|
+
isAigc?: boolean;
|
|
447
|
+
/**
|
|
448
|
+
* Timestamp in milliseconds to use as the video cover frame. Videos only.
|
|
449
|
+
*/
|
|
450
|
+
videoCoverTimestampMs?: number;
|
|
451
|
+
/**
|
|
452
|
+
* Automatically add background music to photo carousels. Photo posts only. Defaults to true.
|
|
453
|
+
*/
|
|
454
|
+
autoAddMusic?: boolean;
|
|
455
|
+
/**
|
|
456
|
+
* 0-indexed position of the cover image in a photo carousel. Photo posts only. Defaults to 0.
|
|
457
|
+
*/
|
|
458
|
+
photoCoverIndex?: number;
|
|
459
|
+
/**
|
|
460
|
+
* Separate description for a TikTok photo or carousel post. Max 4,000 characters. When omitted, the post content is also used as the description. Photo posts only.
|
|
461
|
+
*/
|
|
462
|
+
description?: string;
|
|
463
|
+
/**
|
|
464
|
+
* When true, sends content to the creator's TikTok inbox as a draft. Defaults to false (publishes immediately via DIRECT_POST).
|
|
465
|
+
*/
|
|
466
|
+
draft?: boolean;
|
|
467
|
+
};
|
|
468
|
+
/**
|
|
469
|
+
* Pass this object in platformSpecificData when posting to Pinterest.
|
|
470
|
+
*/
|
|
471
|
+
type PinterestConfigurations = {
|
|
472
|
+
/**
|
|
473
|
+
* Target board ID. Retrieve available boards via GET /v1/pinterest/boards.
|
|
474
|
+
*/
|
|
475
|
+
boardId: string;
|
|
476
|
+
/**
|
|
477
|
+
* Pin title. Max 100 characters. Defaults to first line of content.
|
|
478
|
+
*/
|
|
479
|
+
title?: string;
|
|
480
|
+
/**
|
|
481
|
+
* HTTPS destination URL when the pin is clicked. Important for driving traffic.
|
|
482
|
+
*/
|
|
483
|
+
link?: string;
|
|
484
|
+
/**
|
|
485
|
+
* Accessible image description. Max 500 characters.
|
|
486
|
+
*/
|
|
487
|
+
altText?: string;
|
|
488
|
+
/**
|
|
489
|
+
* Hex color for the loading placeholder (e.g. "#6E7874").
|
|
490
|
+
*/
|
|
491
|
+
dominantColor?: string;
|
|
492
|
+
/**
|
|
493
|
+
* Custom cover image URL for video pins.
|
|
494
|
+
*/
|
|
495
|
+
coverImageUrl?: string;
|
|
496
|
+
};
|
|
497
|
+
/**
|
|
498
|
+
* Pass this object in platformSpecificData when posting to LinkedIn.
|
|
499
|
+
*/
|
|
500
|
+
type LinkedInConfigurations = {
|
|
501
|
+
/**
|
|
502
|
+
* Post visibility. "PUBLIC" = visible to everyone, "CONNECTIONS" = visible to connections only. Defaults to "PUBLIC".
|
|
503
|
+
*/
|
|
504
|
+
visibility?: 'PUBLIC' | 'CONNECTIONS';
|
|
505
|
+
/**
|
|
506
|
+
* URL for an article/link post. When provided, the post becomes a link share with a preview card.
|
|
507
|
+
*/
|
|
508
|
+
articleUrl?: string;
|
|
509
|
+
/**
|
|
510
|
+
* Title for the article preview card. Max 400 characters.
|
|
511
|
+
*/
|
|
512
|
+
articleTitle?: string;
|
|
513
|
+
/**
|
|
514
|
+
* Description for the article preview card. Max 400 characters.
|
|
515
|
+
*/
|
|
516
|
+
articleDescription?: string;
|
|
517
|
+
/**
|
|
518
|
+
* Title shown on the document card when posting a PDF. Required by LinkedIn when a document media item is included.
|
|
519
|
+
*/
|
|
520
|
+
documentTitle?: string;
|
|
521
|
+
};
|
|
522
|
+
/**
|
|
523
|
+
* Pass this object in platformSpecificData when posting to Bluesky.
|
|
524
|
+
*/
|
|
525
|
+
type BlueskyConfigurations = {
|
|
526
|
+
/**
|
|
527
|
+
* BCP-47 language tags for the post (e.g. ["en"], ["en-US", "es"]). Defaults to ["en"].
|
|
528
|
+
*/
|
|
529
|
+
langs?: Array<string>;
|
|
530
|
+
/**
|
|
531
|
+
* Alt text for each image, in the same order as mediaItems. Strongly encouraged for accessibility.
|
|
532
|
+
*/
|
|
533
|
+
altText?: Array<string>;
|
|
534
|
+
};
|
|
535
|
+
/**
|
|
536
|
+
* Pass this object in platformSpecificData when posting to Facebook Pages.
|
|
537
|
+
*/
|
|
538
|
+
type FacebookConfigurations = {
|
|
539
|
+
/**
|
|
540
|
+
* When provided on a text-only post, Facebook renders a link preview card from this URL's Open Graph tags. Ignored when mediaItems are attached.
|
|
541
|
+
*/
|
|
542
|
+
link?: string;
|
|
543
|
+
/**
|
|
544
|
+
* When false, the post is created on the Page in unpublished/draft state — useful for staging or scheduling via Facebook's own composer. Defaults to true.
|
|
545
|
+
*/
|
|
546
|
+
published?: boolean;
|
|
547
|
+
/**
|
|
548
|
+
* Video posts only. Public URL of an image Facebook will use as the video's cover/thumbnail. Applied as a follow-up call after publish — if the upload fails, the post still succeeds (Facebook just auto-picks a frame). Ignored when no video is attached.
|
|
549
|
+
*/
|
|
550
|
+
videoThumbnailUrl?: string;
|
|
551
|
+
};
|
|
552
|
+
/**
|
|
553
|
+
* Pass this object in platformSpecificData when posting to Instagram Business accounts. All fields are optional and apply to Reels/video posts; image posts ignore them.
|
|
554
|
+
*/
|
|
555
|
+
type InstagramConfigurations = {
|
|
556
|
+
/**
|
|
557
|
+
* Reels-only. When true (default), the Reel also appears in the account's main feed grid. Set false to publish to Reels only.
|
|
558
|
+
*/
|
|
559
|
+
shareToFeed?: boolean;
|
|
560
|
+
/**
|
|
561
|
+
* Video-only. Public URL of an image Instagram will use as the cover frame for the Reel/video post. Ignored for image posts.
|
|
562
|
+
*/
|
|
563
|
+
coverUrl?: string;
|
|
564
|
+
/**
|
|
565
|
+
* Video-only. Timestamp in milliseconds Instagram extracts as the cover frame. Ignored when coverUrl is set or for image posts.
|
|
566
|
+
*/
|
|
567
|
+
thumbOffset?: number;
|
|
568
|
+
};
|
|
569
|
+
/**
|
|
570
|
+
* Pass this object in platformSpecificData when posting to Threads.
|
|
571
|
+
*/
|
|
572
|
+
type ThreadsConfigurations = {
|
|
573
|
+
/**
|
|
574
|
+
* Who can reply to this thread. Defaults to "everyone" when omitted.
|
|
575
|
+
*/
|
|
576
|
+
replyControl?: 'everyone' | 'accounts_you_follow' | 'mentioned_only';
|
|
577
|
+
/**
|
|
578
|
+
* Alt text for each image, in the same order as mediaItems. Strongly encouraged for accessibility.
|
|
579
|
+
*/
|
|
580
|
+
altText?: Array<string>;
|
|
581
|
+
};
|
|
582
|
+
/**
|
|
583
|
+
* Pass this object in platformSpecificData when posting to Google Business Profile. Posts appear on Google Search and Maps.
|
|
584
|
+
*/
|
|
585
|
+
type GoogleBusinessConfigurations = {
|
|
586
|
+
/**
|
|
587
|
+
* Post type. Defaults to STANDARD. Use EVENT for event posts, OFFER for promotional offer posts.
|
|
588
|
+
*/
|
|
589
|
+
topicType?: 'STANDARD' | 'EVENT' | 'OFFER';
|
|
590
|
+
/**
|
|
591
|
+
* Call-to-action button shown on the post.
|
|
592
|
+
*/
|
|
593
|
+
callToActionType?: 'BOOK' | 'ORDER' | 'SHOP' | 'LEARN_MORE' | 'SIGN_UP' | 'CALL' | 'GET_OFFER';
|
|
594
|
+
/**
|
|
595
|
+
* URL for the call-to-action. Required for all CTA types except CALL.
|
|
596
|
+
*/
|
|
597
|
+
callToActionUrl?: string;
|
|
598
|
+
/**
|
|
599
|
+
* Event title. Required when topicType is EVENT.
|
|
600
|
+
*/
|
|
601
|
+
eventTitle?: string;
|
|
602
|
+
/**
|
|
603
|
+
* Event start date in YYYY-MM-DD format. Required when topicType is EVENT.
|
|
604
|
+
*/
|
|
605
|
+
eventStartDate?: string;
|
|
606
|
+
/**
|
|
607
|
+
* Event start time in HH:MM (24-hour) format. Required when topicType is EVENT.
|
|
608
|
+
*/
|
|
609
|
+
eventStartTime?: string;
|
|
610
|
+
/**
|
|
611
|
+
* Event end date in YYYY-MM-DD format. Required when topicType is EVENT.
|
|
612
|
+
*/
|
|
613
|
+
eventEndDate?: string;
|
|
614
|
+
/**
|
|
615
|
+
* Event end time in HH:MM (24-hour) format. Required when topicType is EVENT.
|
|
616
|
+
*/
|
|
617
|
+
eventEndTime?: string;
|
|
618
|
+
/**
|
|
619
|
+
* Coupon code for OFFER posts.
|
|
620
|
+
*/
|
|
621
|
+
offerCouponCode?: string;
|
|
622
|
+
/**
|
|
623
|
+
* Online redemption URL for OFFER posts.
|
|
624
|
+
*/
|
|
625
|
+
offerRedeemOnlineUrl?: string;
|
|
626
|
+
/**
|
|
627
|
+
* Terms and conditions text for OFFER posts.
|
|
628
|
+
*/
|
|
629
|
+
offerTermsConditions?: string;
|
|
630
|
+
};
|
|
631
|
+
type PostPayload = {
|
|
632
|
+
/**
|
|
633
|
+
* Post text body
|
|
634
|
+
*/
|
|
635
|
+
content: string;
|
|
636
|
+
/**
|
|
637
|
+
* Media attachments (images, videos, GIFs)
|
|
638
|
+
*/
|
|
639
|
+
mediaItems?: Array<{
|
|
640
|
+
type: 'image' | 'video' | 'gif' | 'document';
|
|
641
|
+
url: string;
|
|
642
|
+
/**
|
|
643
|
+
* Thumbnail image URL for video items. Supported on YouTube regular videos (not Shorts). JPEG, PNG, or GIF, max 2 MB, min 640 px wide.
|
|
644
|
+
*/
|
|
645
|
+
thumbnail?: string;
|
|
646
|
+
}>;
|
|
647
|
+
/**
|
|
648
|
+
* Target platform accounts to publish to
|
|
649
|
+
*/
|
|
650
|
+
platforms: Array<{
|
|
651
|
+
platform: 'twitter';
|
|
652
|
+
/**
|
|
653
|
+
* Integration._id — find yours via GET /connect/integrations
|
|
654
|
+
*/
|
|
655
|
+
accountId: string;
|
|
656
|
+
/**
|
|
657
|
+
* Optional per-platform text override. Use when you want to change the text for this platform because different platforms talk differently. When omitted, the top-level `content` is used.
|
|
658
|
+
*/
|
|
659
|
+
content?: string;
|
|
660
|
+
platformSpecificData?: TwitterConfigurations;
|
|
661
|
+
} | {
|
|
662
|
+
platform: 'instagram';
|
|
663
|
+
/**
|
|
664
|
+
* Integration._id — find yours via GET /connect/integrations
|
|
665
|
+
*/
|
|
666
|
+
accountId: string;
|
|
667
|
+
/**
|
|
668
|
+
* Optional per-platform text override. Use when you want to change the text for this platform because different platforms talk differently. When omitted, the top-level `content` is used.
|
|
669
|
+
*/
|
|
670
|
+
content?: string;
|
|
671
|
+
platformSpecificData?: InstagramConfigurations;
|
|
672
|
+
} | {
|
|
673
|
+
platform: 'youtube';
|
|
674
|
+
/**
|
|
675
|
+
* Integration._id — find yours via GET /connect/integrations
|
|
676
|
+
*/
|
|
677
|
+
accountId: string;
|
|
678
|
+
/**
|
|
679
|
+
* Optional per-platform text override. Use when you want to change the text for this platform because different platforms talk differently. When omitted, the top-level `content` is used.
|
|
680
|
+
*/
|
|
681
|
+
content?: string;
|
|
682
|
+
platformSpecificData?: YouTubeConfigurations;
|
|
683
|
+
} | {
|
|
684
|
+
platform: 'tiktok';
|
|
685
|
+
/**
|
|
686
|
+
* Integration._id — find yours via GET /connect/integrations
|
|
687
|
+
*/
|
|
688
|
+
accountId: string;
|
|
689
|
+
/**
|
|
690
|
+
* Optional per-platform text override. Use when you want to change the text for this platform because different platforms talk differently. When omitted, the top-level `content` is used.
|
|
691
|
+
*/
|
|
692
|
+
content?: string;
|
|
693
|
+
platformSpecificData?: TikTokConfigurations;
|
|
694
|
+
} | {
|
|
695
|
+
platform: 'pinterest';
|
|
696
|
+
/**
|
|
697
|
+
* Integration._id — find yours via GET /connect/integrations
|
|
698
|
+
*/
|
|
699
|
+
accountId: string;
|
|
700
|
+
/**
|
|
701
|
+
* Optional per-platform text override. Use when you want to change the text for this platform because different platforms talk differently. When omitted, the top-level `content` is used.
|
|
702
|
+
*/
|
|
703
|
+
content?: string;
|
|
704
|
+
platformSpecificData?: PinterestConfigurations;
|
|
705
|
+
} | {
|
|
706
|
+
platform: 'linkedin';
|
|
707
|
+
/**
|
|
708
|
+
* Integration._id — find yours via GET /connect/integrations
|
|
709
|
+
*/
|
|
710
|
+
accountId: string;
|
|
711
|
+
/**
|
|
712
|
+
* Optional per-platform text override. Use when you want to change the text for this platform because different platforms talk differently. When omitted, the top-level `content` is used.
|
|
713
|
+
*/
|
|
714
|
+
content?: string;
|
|
715
|
+
platformSpecificData?: LinkedInConfigurations;
|
|
716
|
+
} | {
|
|
717
|
+
platform: 'bluesky';
|
|
718
|
+
/**
|
|
719
|
+
* Integration._id — find yours via GET /connect/integrations
|
|
720
|
+
*/
|
|
721
|
+
accountId: string;
|
|
722
|
+
/**
|
|
723
|
+
* Optional per-platform text override. Use when you want to change the text for this platform because different platforms talk differently. When omitted, the top-level `content` is used.
|
|
724
|
+
*/
|
|
725
|
+
content?: string;
|
|
726
|
+
platformSpecificData?: BlueskyConfigurations;
|
|
727
|
+
} | {
|
|
728
|
+
platform: 'facebook';
|
|
729
|
+
/**
|
|
730
|
+
* Integration._id — find yours via GET /connect/integrations
|
|
731
|
+
*/
|
|
732
|
+
accountId: string;
|
|
733
|
+
/**
|
|
734
|
+
* Optional per-platform text override. Use when you want to change the text for this platform because different platforms talk differently. When omitted, the top-level `content` is used.
|
|
735
|
+
*/
|
|
736
|
+
content?: string;
|
|
737
|
+
platformSpecificData?: FacebookConfigurations;
|
|
738
|
+
} | {
|
|
739
|
+
platform: 'threads';
|
|
740
|
+
/**
|
|
741
|
+
* Integration._id — find yours via GET /connect/integrations
|
|
742
|
+
*/
|
|
743
|
+
accountId: string;
|
|
744
|
+
/**
|
|
745
|
+
* Optional per-platform text override. Use when you want to change the text for this platform because different platforms talk differently. When omitted, the top-level `content` is used.
|
|
746
|
+
*/
|
|
747
|
+
content?: string;
|
|
748
|
+
platformSpecificData?: ThreadsConfigurations;
|
|
749
|
+
} | {
|
|
750
|
+
platform: 'googlebusiness';
|
|
751
|
+
/**
|
|
752
|
+
* Integration._id — find yours via GET /connect/integrations
|
|
753
|
+
*/
|
|
754
|
+
accountId: string;
|
|
755
|
+
/**
|
|
756
|
+
* Optional per-platform text override. Use when you want to change the text for this platform because different platforms talk differently. When omitted, the top-level `content` is used.
|
|
757
|
+
*/
|
|
758
|
+
content?: string;
|
|
759
|
+
platformSpecificData?: GoogleBusinessConfigurations;
|
|
760
|
+
}>;
|
|
761
|
+
/**
|
|
762
|
+
* Publish immediately. Required when scheduledFor is omitted.
|
|
763
|
+
*/
|
|
764
|
+
publishNow?: boolean;
|
|
765
|
+
/**
|
|
766
|
+
* ISO 8601 datetime to schedule the post for future publishing
|
|
767
|
+
*/
|
|
768
|
+
scheduledFor?: string;
|
|
769
|
+
/**
|
|
770
|
+
* IANA timezone for the scheduled time (e.g. America/New_York). Defaults to UTC.
|
|
771
|
+
*/
|
|
772
|
+
timezone?: string;
|
|
773
|
+
};
|
|
774
|
+
type GetV1HealthData = {
|
|
775
|
+
body?: never;
|
|
776
|
+
path?: never;
|
|
777
|
+
query?: never;
|
|
778
|
+
url: '/v1/health';
|
|
779
|
+
};
|
|
780
|
+
type GetV1HealthResponses = {
|
|
781
|
+
/**
|
|
782
|
+
* Default Response
|
|
783
|
+
*/
|
|
784
|
+
200: {
|
|
785
|
+
ok: boolean;
|
|
786
|
+
};
|
|
787
|
+
};
|
|
788
|
+
type GetV1HealthResponse = GetV1HealthResponses[keyof GetV1HealthResponses];
|
|
789
|
+
type GetV1HealthAuthData = {
|
|
790
|
+
body?: never;
|
|
791
|
+
path?: never;
|
|
792
|
+
query?: never;
|
|
793
|
+
url: '/v1/health/auth';
|
|
794
|
+
};
|
|
795
|
+
type GetV1HealthAuthResponses = {
|
|
796
|
+
/**
|
|
797
|
+
* Default Response
|
|
798
|
+
*/
|
|
799
|
+
200: {
|
|
800
|
+
ok: boolean;
|
|
801
|
+
};
|
|
802
|
+
};
|
|
803
|
+
type GetV1HealthAuthResponse = GetV1HealthAuthResponses[keyof GetV1HealthAuthResponses];
|
|
804
|
+
type GetV1ConnectLinkedinSelectionByTokenData = {
|
|
805
|
+
body?: never;
|
|
806
|
+
path: {
|
|
807
|
+
token: string;
|
|
808
|
+
};
|
|
809
|
+
query?: never;
|
|
810
|
+
url: '/v1/connect/linkedin/selection/{token}';
|
|
811
|
+
};
|
|
812
|
+
type GetV1ConnectLinkedinSelectionByTokenErrors = {
|
|
813
|
+
/**
|
|
814
|
+
* Default Response
|
|
815
|
+
*/
|
|
816
|
+
404: {
|
|
817
|
+
error: string;
|
|
818
|
+
};
|
|
819
|
+
};
|
|
820
|
+
type GetV1ConnectLinkedinSelectionByTokenError = GetV1ConnectLinkedinSelectionByTokenErrors[keyof GetV1ConnectLinkedinSelectionByTokenErrors];
|
|
821
|
+
type GetV1ConnectLinkedinSelectionByTokenResponses = {
|
|
822
|
+
/**
|
|
823
|
+
* Default Response
|
|
824
|
+
*/
|
|
825
|
+
200: {
|
|
826
|
+
success: boolean;
|
|
827
|
+
platform: 'linkedin';
|
|
828
|
+
expiresInSeconds: number;
|
|
829
|
+
accounts: Array<{
|
|
830
|
+
id: string;
|
|
831
|
+
type: 'person' | 'organization';
|
|
832
|
+
platformUserId: string;
|
|
833
|
+
displayName: string | null;
|
|
834
|
+
username: string | null;
|
|
835
|
+
imageUrl: string | null;
|
|
836
|
+
}>;
|
|
837
|
+
};
|
|
838
|
+
};
|
|
839
|
+
type GetV1ConnectLinkedinSelectionByTokenResponse = GetV1ConnectLinkedinSelectionByTokenResponses[keyof GetV1ConnectLinkedinSelectionByTokenResponses];
|
|
840
|
+
type PostV1ConnectLinkedinSelectionByTokenData = {
|
|
841
|
+
body: {
|
|
842
|
+
selectedAccountIds: Array<string>;
|
|
843
|
+
};
|
|
844
|
+
path: {
|
|
845
|
+
token: string;
|
|
846
|
+
};
|
|
847
|
+
query?: never;
|
|
848
|
+
url: '/v1/connect/linkedin/selection/{token}';
|
|
849
|
+
};
|
|
850
|
+
type PostV1ConnectLinkedinSelectionByTokenErrors = {
|
|
851
|
+
/**
|
|
852
|
+
* Default Response
|
|
853
|
+
*/
|
|
854
|
+
400: {
|
|
855
|
+
error: string;
|
|
856
|
+
};
|
|
857
|
+
/**
|
|
858
|
+
* Default Response
|
|
859
|
+
*/
|
|
860
|
+
404: {
|
|
861
|
+
error: string;
|
|
862
|
+
};
|
|
863
|
+
};
|
|
864
|
+
type PostV1ConnectLinkedinSelectionByTokenError = PostV1ConnectLinkedinSelectionByTokenErrors[keyof PostV1ConnectLinkedinSelectionByTokenErrors];
|
|
865
|
+
type PostV1ConnectLinkedinSelectionByTokenResponses = {
|
|
866
|
+
/**
|
|
867
|
+
* Default Response
|
|
868
|
+
*/
|
|
869
|
+
200: {
|
|
870
|
+
success: boolean;
|
|
871
|
+
platform: 'linkedin';
|
|
872
|
+
message: string;
|
|
873
|
+
redirectUri?: string;
|
|
874
|
+
integrations: Array<{
|
|
875
|
+
/**
|
|
876
|
+
* Use this as accountId when creating posts
|
|
877
|
+
*/
|
|
878
|
+
id: string;
|
|
879
|
+
platform: 'twitter' | 'instagram' | 'youtube' | 'tiktok' | 'pinterest' | 'linkedin' | 'bluesky' | 'facebook' | 'threads' | 'googlebusiness';
|
|
880
|
+
/**
|
|
881
|
+
* The user ID on the platform, or null if not yet retrieved
|
|
882
|
+
*/
|
|
883
|
+
platformUserId: string | null;
|
|
884
|
+
/**
|
|
885
|
+
* The public username or handle, including @ for handle-based platforms
|
|
886
|
+
*/
|
|
887
|
+
username: string | null;
|
|
888
|
+
/**
|
|
889
|
+
* Human-readable display name of the connected account
|
|
890
|
+
*/
|
|
891
|
+
displayName: string | null;
|
|
892
|
+
/**
|
|
893
|
+
* Public profile/page URL for the connected account, when it can be derived
|
|
894
|
+
*/
|
|
895
|
+
profileUrl: string | null;
|
|
896
|
+
/**
|
|
897
|
+
* Profile image URL for the connected account, or null if unavailable
|
|
898
|
+
*/
|
|
899
|
+
imageUrl: string | null;
|
|
900
|
+
/**
|
|
901
|
+
* Provider-specific public metadata for this connected account.
|
|
902
|
+
*/
|
|
903
|
+
platformMetadata?: {
|
|
904
|
+
[key: string]: unknown;
|
|
905
|
+
};
|
|
906
|
+
/**
|
|
907
|
+
* Profile this integration belongs to, or null if it was connected without a profile
|
|
908
|
+
*/
|
|
909
|
+
profileId: string | null;
|
|
910
|
+
/**
|
|
911
|
+
* The OAuth app (customer's own OAuth app) this integration was connected under, or null if postpeer's system app was used.
|
|
912
|
+
*/
|
|
913
|
+
appId: string | null;
|
|
914
|
+
/**
|
|
915
|
+
* The OAuth app metadata for BYOK integrations, or null when postpeer system app was used.
|
|
916
|
+
*/
|
|
917
|
+
app: {
|
|
918
|
+
id?: string;
|
|
919
|
+
name?: string;
|
|
920
|
+
imageUrl?: string | null;
|
|
921
|
+
} | null;
|
|
922
|
+
/**
|
|
923
|
+
* True when this integration was connected under the customer's own OAuth app (Bring Your Own Keys), i.e. appId is set. False when postpeer's system app is used.
|
|
924
|
+
*/
|
|
925
|
+
byok: boolean;
|
|
926
|
+
createdAt: string;
|
|
927
|
+
}>;
|
|
928
|
+
};
|
|
929
|
+
};
|
|
930
|
+
type PostV1ConnectLinkedinSelectionByTokenResponse = PostV1ConnectLinkedinSelectionByTokenResponses[keyof PostV1ConnectLinkedinSelectionByTokenResponses];
|
|
931
|
+
type GetV1ConnectByPlatformData = {
|
|
932
|
+
body?: never;
|
|
933
|
+
path: {
|
|
934
|
+
platform: 'twitter' | 'instagram' | 'youtube' | 'tiktok' | 'pinterest' | 'linkedin' | 'bluesky' | 'facebook' | 'threads' | 'googlebusiness';
|
|
935
|
+
};
|
|
936
|
+
query?: {
|
|
937
|
+
/**
|
|
938
|
+
* Final URL to redirect to after the connection completes. In headless mode, this URL also receives selection status query parameters when customer-owned account selection is required.
|
|
939
|
+
*/
|
|
940
|
+
redirectUri?: string;
|
|
941
|
+
/**
|
|
942
|
+
* URL to redirect to when the user cancels or denies the OAuth prompt. Falls back to redirectUri when omitted.
|
|
943
|
+
*/
|
|
944
|
+
cancelRedirectUri?: string;
|
|
945
|
+
/**
|
|
946
|
+
* When true, platforms that require account selection redirect back to redirectUri with a short-lived selectionToken so you can build your own selection UI. When false, PostPeer hosts the selection UI.
|
|
947
|
+
*/
|
|
948
|
+
headless?: boolean;
|
|
949
|
+
/**
|
|
950
|
+
* Profile to associate the resulting integration with. Must belong to the same project. Omit to connect without a profile.
|
|
951
|
+
*/
|
|
952
|
+
profileId?: string;
|
|
953
|
+
/**
|
|
954
|
+
* Connect under your own OAuth app (Bring Your Own Keys). Pass the id of an OAuth app created via /v1/apps for this same platform. Omit to use postpeer's system app.
|
|
955
|
+
*/
|
|
956
|
+
appId?: string;
|
|
957
|
+
};
|
|
958
|
+
url: '/v1/connect/{platform}';
|
|
959
|
+
};
|
|
960
|
+
type GetV1ConnectByPlatformErrors = {
|
|
961
|
+
/**
|
|
962
|
+
* Default Response
|
|
963
|
+
*/
|
|
964
|
+
500: {
|
|
965
|
+
error: string;
|
|
966
|
+
};
|
|
967
|
+
};
|
|
968
|
+
type GetV1ConnectByPlatformError = GetV1ConnectByPlatformErrors[keyof GetV1ConnectByPlatformErrors];
|
|
969
|
+
type GetV1ConnectByPlatformResponses = {
|
|
970
|
+
/**
|
|
971
|
+
* Default Response
|
|
972
|
+
*/
|
|
973
|
+
200: {
|
|
974
|
+
url: string;
|
|
975
|
+
};
|
|
976
|
+
};
|
|
977
|
+
type GetV1ConnectByPlatformResponse = GetV1ConnectByPlatformResponses[keyof GetV1ConnectByPlatformResponses];
|
|
978
|
+
type PostV1ConnectBlueskyAuthData = {
|
|
979
|
+
body: {
|
|
980
|
+
/**
|
|
981
|
+
* Bluesky handle (e.g. "alice.bsky.social") or DID (e.g. "did:plc:abc123").
|
|
982
|
+
*/
|
|
983
|
+
identifier: string;
|
|
984
|
+
/**
|
|
985
|
+
* An app password generated at https://bsky.app/settings/app-passwords. Do NOT use the account password.
|
|
986
|
+
*/
|
|
987
|
+
password: string;
|
|
988
|
+
};
|
|
989
|
+
path?: never;
|
|
990
|
+
query?: {
|
|
991
|
+
/**
|
|
992
|
+
* Final URL to redirect to after the connection completes. In headless mode, this URL also receives selection status query parameters when customer-owned account selection is required.
|
|
993
|
+
*/
|
|
994
|
+
redirectUri?: string;
|
|
995
|
+
/**
|
|
996
|
+
* URL to redirect to when the user cancels or denies the OAuth prompt. Falls back to redirectUri when omitted.
|
|
997
|
+
*/
|
|
998
|
+
cancelRedirectUri?: string;
|
|
999
|
+
/**
|
|
1000
|
+
* When true, platforms that require account selection redirect back to redirectUri with a short-lived selectionToken so you can build your own selection UI. When false, PostPeer hosts the selection UI.
|
|
1001
|
+
*/
|
|
1002
|
+
headless?: boolean;
|
|
1003
|
+
/**
|
|
1004
|
+
* Profile to associate the resulting integration with. Must belong to the same project. Omit to connect without a profile.
|
|
1005
|
+
*/
|
|
1006
|
+
profileId?: string;
|
|
1007
|
+
/**
|
|
1008
|
+
* Connect under your own OAuth app (Bring Your Own Keys). Pass the id of an OAuth app created via /v1/apps for this same platform. Omit to use postpeer's system app.
|
|
1009
|
+
*/
|
|
1010
|
+
appId?: string;
|
|
1011
|
+
};
|
|
1012
|
+
url: '/v1/connect/bluesky/auth';
|
|
1013
|
+
};
|
|
1014
|
+
type PostV1ConnectBlueskyAuthErrors = {
|
|
1015
|
+
/**
|
|
1016
|
+
* Default Response
|
|
1017
|
+
*/
|
|
1018
|
+
400: {
|
|
1019
|
+
error: string;
|
|
1020
|
+
};
|
|
1021
|
+
/**
|
|
1022
|
+
* Default Response
|
|
1023
|
+
*/
|
|
1024
|
+
401: {
|
|
1025
|
+
error: string;
|
|
1026
|
+
};
|
|
1027
|
+
/**
|
|
1028
|
+
* Default Response
|
|
1029
|
+
*/
|
|
1030
|
+
502: {
|
|
1031
|
+
error: string;
|
|
1032
|
+
};
|
|
1033
|
+
};
|
|
1034
|
+
type PostV1ConnectBlueskyAuthError = PostV1ConnectBlueskyAuthErrors[keyof PostV1ConnectBlueskyAuthErrors];
|
|
1035
|
+
type GetV1ConnectIntegrationsData = {
|
|
1036
|
+
body?: never;
|
|
1037
|
+
path?: never;
|
|
1038
|
+
query?: {
|
|
1039
|
+
platform?: 'twitter' | 'instagram' | 'youtube' | 'tiktok' | 'pinterest' | 'linkedin' | 'bluesky' | 'facebook' | 'threads' | 'googlebusiness';
|
|
1040
|
+
/**
|
|
1041
|
+
* Filter to integrations belonging to this profile. Pass "null" (literal string) to filter to integrations with no profile.
|
|
1042
|
+
*/
|
|
1043
|
+
profileId?: string;
|
|
1044
|
+
/**
|
|
1045
|
+
* Case-insensitive search across the connected account name (displayName), username, and platform user ID.
|
|
1046
|
+
*/
|
|
1047
|
+
q?: string;
|
|
1048
|
+
/**
|
|
1049
|
+
* Page size (max 100)
|
|
1050
|
+
*/
|
|
1051
|
+
limit?: number;
|
|
1052
|
+
/**
|
|
1053
|
+
* Number of integrations to skip
|
|
1054
|
+
*/
|
|
1055
|
+
offset?: number;
|
|
1056
|
+
sort?: SortOrder;
|
|
1057
|
+
};
|
|
1058
|
+
url: '/v1/connect/integrations';
|
|
1059
|
+
};
|
|
1060
|
+
type GetV1ConnectIntegrationsResponses = {
|
|
1061
|
+
/**
|
|
1062
|
+
* Default Response
|
|
1063
|
+
*/
|
|
1064
|
+
200: {
|
|
1065
|
+
success: boolean;
|
|
1066
|
+
/**
|
|
1067
|
+
* Total matched integrations across all pages
|
|
1068
|
+
*/
|
|
1069
|
+
total: number;
|
|
1070
|
+
integrations: Array<{
|
|
1071
|
+
/**
|
|
1072
|
+
* Use this as accountId when creating posts
|
|
1073
|
+
*/
|
|
1074
|
+
id: string;
|
|
1075
|
+
platform: 'twitter' | 'instagram' | 'youtube' | 'tiktok' | 'pinterest' | 'linkedin' | 'bluesky' | 'facebook' | 'threads' | 'googlebusiness';
|
|
1076
|
+
/**
|
|
1077
|
+
* The user ID on the platform, or null if not yet retrieved
|
|
1078
|
+
*/
|
|
1079
|
+
platformUserId: string | null;
|
|
1080
|
+
/**
|
|
1081
|
+
* The public username or handle, including @ for handle-based platforms
|
|
1082
|
+
*/
|
|
1083
|
+
username: string | null;
|
|
1084
|
+
/**
|
|
1085
|
+
* Human-readable display name of the connected account
|
|
1086
|
+
*/
|
|
1087
|
+
displayName: string | null;
|
|
1088
|
+
/**
|
|
1089
|
+
* Public profile/page URL for the connected account, when it can be derived
|
|
1090
|
+
*/
|
|
1091
|
+
profileUrl: string | null;
|
|
1092
|
+
/**
|
|
1093
|
+
* Profile image URL for the connected account, or null if unavailable
|
|
1094
|
+
*/
|
|
1095
|
+
imageUrl: string | null;
|
|
1096
|
+
/**
|
|
1097
|
+
* Provider-specific public metadata for this connected account.
|
|
1098
|
+
*/
|
|
1099
|
+
platformMetadata?: {
|
|
1100
|
+
[key: string]: unknown;
|
|
1101
|
+
};
|
|
1102
|
+
/**
|
|
1103
|
+
* Profile this integration belongs to, or null if it was connected without a profile
|
|
1104
|
+
*/
|
|
1105
|
+
profileId: string | null;
|
|
1106
|
+
/**
|
|
1107
|
+
* The OAuth app (customer's own OAuth app) this integration was connected under, or null if postpeer's system app was used.
|
|
1108
|
+
*/
|
|
1109
|
+
appId: string | null;
|
|
1110
|
+
/**
|
|
1111
|
+
* The OAuth app metadata for BYOK integrations, or null when postpeer system app was used.
|
|
1112
|
+
*/
|
|
1113
|
+
app: {
|
|
1114
|
+
id?: string;
|
|
1115
|
+
name?: string;
|
|
1116
|
+
imageUrl?: string | null;
|
|
1117
|
+
} | null;
|
|
1118
|
+
/**
|
|
1119
|
+
* True when this integration was connected under the customer's own OAuth app (Bring Your Own Keys), i.e. appId is set. False when postpeer's system app is used.
|
|
1120
|
+
*/
|
|
1121
|
+
byok: boolean;
|
|
1122
|
+
createdAt: string;
|
|
1123
|
+
}>;
|
|
1124
|
+
};
|
|
1125
|
+
};
|
|
1126
|
+
type GetV1ConnectIntegrationsResponse = GetV1ConnectIntegrationsResponses[keyof GetV1ConnectIntegrationsResponses];
|
|
1127
|
+
type DeleteV1ConnectIntegrationsByIdData = {
|
|
1128
|
+
body?: never;
|
|
1129
|
+
path: {
|
|
1130
|
+
/**
|
|
1131
|
+
* Integration ID to disconnect
|
|
1132
|
+
*/
|
|
1133
|
+
id: string;
|
|
1134
|
+
};
|
|
1135
|
+
query?: never;
|
|
1136
|
+
url: '/v1/connect/integrations/{id}';
|
|
1137
|
+
};
|
|
1138
|
+
type DeleteV1ConnectIntegrationsByIdErrors = {
|
|
1139
|
+
/**
|
|
1140
|
+
* Default Response
|
|
1141
|
+
*/
|
|
1142
|
+
404: {
|
|
1143
|
+
error: string;
|
|
1144
|
+
};
|
|
1145
|
+
};
|
|
1146
|
+
type DeleteV1ConnectIntegrationsByIdError = DeleteV1ConnectIntegrationsByIdErrors[keyof DeleteV1ConnectIntegrationsByIdErrors];
|
|
1147
|
+
type DeleteV1ConnectIntegrationsByIdResponses = {
|
|
1148
|
+
/**
|
|
1149
|
+
* Default Response
|
|
1150
|
+
*/
|
|
1151
|
+
200: {
|
|
1152
|
+
success: boolean;
|
|
1153
|
+
message: string;
|
|
1154
|
+
};
|
|
1155
|
+
};
|
|
1156
|
+
type DeleteV1ConnectIntegrationsByIdResponse = DeleteV1ConnectIntegrationsByIdResponses[keyof DeleteV1ConnectIntegrationsByIdResponses];
|
|
1157
|
+
type GetV1ProfilesData = {
|
|
1158
|
+
body?: never;
|
|
1159
|
+
path?: never;
|
|
1160
|
+
query?: {
|
|
1161
|
+
page?: number;
|
|
1162
|
+
limit?: number;
|
|
1163
|
+
/**
|
|
1164
|
+
* Case-insensitive substring match on profile name
|
|
1165
|
+
*/
|
|
1166
|
+
name?: string;
|
|
1167
|
+
};
|
|
1168
|
+
url: '/v1/profiles/';
|
|
1169
|
+
};
|
|
1170
|
+
type GetV1ProfilesResponses = {
|
|
1171
|
+
/**
|
|
1172
|
+
* Default Response
|
|
1173
|
+
*/
|
|
1174
|
+
200: {
|
|
1175
|
+
success: boolean;
|
|
1176
|
+
total: number;
|
|
1177
|
+
page: number;
|
|
1178
|
+
limit: number;
|
|
1179
|
+
profiles: Array<{
|
|
1180
|
+
id: string;
|
|
1181
|
+
name: string;
|
|
1182
|
+
description: string | null;
|
|
1183
|
+
/**
|
|
1184
|
+
* Number of active integrations bound to this profile
|
|
1185
|
+
*/
|
|
1186
|
+
integrationCount: number;
|
|
1187
|
+
createdAt: string;
|
|
1188
|
+
updatedAt: string;
|
|
1189
|
+
}>;
|
|
1190
|
+
};
|
|
1191
|
+
};
|
|
1192
|
+
type GetV1ProfilesResponse = GetV1ProfilesResponses[keyof GetV1ProfilesResponses];
|
|
1193
|
+
type PostV1ProfilesData = {
|
|
1194
|
+
body: {
|
|
1195
|
+
/**
|
|
1196
|
+
* Profile name (e.g. "Acme Co", "Personal Brand")
|
|
1197
|
+
*/
|
|
1198
|
+
name: string;
|
|
1199
|
+
/**
|
|
1200
|
+
* Optional description of what this profile is for
|
|
1201
|
+
*/
|
|
1202
|
+
description?: string;
|
|
1203
|
+
};
|
|
1204
|
+
path?: never;
|
|
1205
|
+
query?: never;
|
|
1206
|
+
url: '/v1/profiles/';
|
|
1207
|
+
};
|
|
1208
|
+
type PostV1ProfilesResponses = {
|
|
1209
|
+
/**
|
|
1210
|
+
* Default Response
|
|
1211
|
+
*/
|
|
1212
|
+
201: {
|
|
1213
|
+
success: boolean;
|
|
1214
|
+
profile: {
|
|
1215
|
+
id: string;
|
|
1216
|
+
name: string;
|
|
1217
|
+
description: string | null;
|
|
1218
|
+
/**
|
|
1219
|
+
* Number of active integrations bound to this profile
|
|
1220
|
+
*/
|
|
1221
|
+
integrationCount: number;
|
|
1222
|
+
createdAt: string;
|
|
1223
|
+
updatedAt: string;
|
|
1224
|
+
};
|
|
1225
|
+
};
|
|
1226
|
+
};
|
|
1227
|
+
type PostV1ProfilesResponse = PostV1ProfilesResponses[keyof PostV1ProfilesResponses];
|
|
1228
|
+
type DeleteV1ProfilesByIdData = {
|
|
1229
|
+
body?: never;
|
|
1230
|
+
path: {
|
|
1231
|
+
/**
|
|
1232
|
+
* Profile ID
|
|
1233
|
+
*/
|
|
1234
|
+
id: string;
|
|
1235
|
+
};
|
|
1236
|
+
query?: never;
|
|
1237
|
+
url: '/v1/profiles/{id}';
|
|
1238
|
+
};
|
|
1239
|
+
type DeleteV1ProfilesByIdErrors = {
|
|
1240
|
+
/**
|
|
1241
|
+
* Default Response
|
|
1242
|
+
*/
|
|
1243
|
+
400: {
|
|
1244
|
+
error: string;
|
|
1245
|
+
};
|
|
1246
|
+
/**
|
|
1247
|
+
* Default Response
|
|
1248
|
+
*/
|
|
1249
|
+
404: {
|
|
1250
|
+
error: string;
|
|
1251
|
+
};
|
|
1252
|
+
};
|
|
1253
|
+
type DeleteV1ProfilesByIdError = DeleteV1ProfilesByIdErrors[keyof DeleteV1ProfilesByIdErrors];
|
|
1254
|
+
type DeleteV1ProfilesByIdResponses = {
|
|
1255
|
+
/**
|
|
1256
|
+
* Default Response
|
|
1257
|
+
*/
|
|
1258
|
+
200: {
|
|
1259
|
+
success: boolean;
|
|
1260
|
+
message: string;
|
|
1261
|
+
};
|
|
1262
|
+
};
|
|
1263
|
+
type DeleteV1ProfilesByIdResponse = DeleteV1ProfilesByIdResponses[keyof DeleteV1ProfilesByIdResponses];
|
|
1264
|
+
type GetV1ProfilesByIdData = {
|
|
1265
|
+
body?: never;
|
|
1266
|
+
path: {
|
|
1267
|
+
/**
|
|
1268
|
+
* Profile ID
|
|
1269
|
+
*/
|
|
1270
|
+
id: string;
|
|
1271
|
+
};
|
|
1272
|
+
query?: never;
|
|
1273
|
+
url: '/v1/profiles/{id}';
|
|
1274
|
+
};
|
|
1275
|
+
type GetV1ProfilesByIdErrors = {
|
|
1276
|
+
/**
|
|
1277
|
+
* Default Response
|
|
1278
|
+
*/
|
|
1279
|
+
400: {
|
|
1280
|
+
error: string;
|
|
1281
|
+
};
|
|
1282
|
+
/**
|
|
1283
|
+
* Default Response
|
|
1284
|
+
*/
|
|
1285
|
+
404: {
|
|
1286
|
+
error: string;
|
|
1287
|
+
};
|
|
1288
|
+
};
|
|
1289
|
+
type GetV1ProfilesByIdError = GetV1ProfilesByIdErrors[keyof GetV1ProfilesByIdErrors];
|
|
1290
|
+
type GetV1ProfilesByIdResponses = {
|
|
1291
|
+
/**
|
|
1292
|
+
* Default Response
|
|
1293
|
+
*/
|
|
1294
|
+
200: {
|
|
1295
|
+
success: boolean;
|
|
1296
|
+
profile: {
|
|
1297
|
+
id: string;
|
|
1298
|
+
name: string;
|
|
1299
|
+
description: string | null;
|
|
1300
|
+
/**
|
|
1301
|
+
* Number of active integrations bound to this profile
|
|
1302
|
+
*/
|
|
1303
|
+
integrationCount: number;
|
|
1304
|
+
createdAt: string;
|
|
1305
|
+
updatedAt: string;
|
|
1306
|
+
};
|
|
1307
|
+
};
|
|
1308
|
+
};
|
|
1309
|
+
type GetV1ProfilesByIdResponse = GetV1ProfilesByIdResponses[keyof GetV1ProfilesByIdResponses];
|
|
1310
|
+
type PatchV1ProfilesByIdData = {
|
|
1311
|
+
body: {
|
|
1312
|
+
name?: string;
|
|
1313
|
+
description?: string | null;
|
|
1314
|
+
};
|
|
1315
|
+
path: {
|
|
1316
|
+
/**
|
|
1317
|
+
* Profile ID
|
|
1318
|
+
*/
|
|
1319
|
+
id: string;
|
|
1320
|
+
};
|
|
1321
|
+
query?: never;
|
|
1322
|
+
url: '/v1/profiles/{id}';
|
|
1323
|
+
};
|
|
1324
|
+
type PatchV1ProfilesByIdErrors = {
|
|
1325
|
+
/**
|
|
1326
|
+
* Default Response
|
|
1327
|
+
*/
|
|
1328
|
+
400: {
|
|
1329
|
+
error: string;
|
|
1330
|
+
};
|
|
1331
|
+
/**
|
|
1332
|
+
* Default Response
|
|
1333
|
+
*/
|
|
1334
|
+
404: {
|
|
1335
|
+
error: string;
|
|
1336
|
+
};
|
|
1337
|
+
};
|
|
1338
|
+
type PatchV1ProfilesByIdError = PatchV1ProfilesByIdErrors[keyof PatchV1ProfilesByIdErrors];
|
|
1339
|
+
type PatchV1ProfilesByIdResponses = {
|
|
1340
|
+
/**
|
|
1341
|
+
* Default Response
|
|
1342
|
+
*/
|
|
1343
|
+
200: {
|
|
1344
|
+
success: boolean;
|
|
1345
|
+
profile: {
|
|
1346
|
+
id: string;
|
|
1347
|
+
name: string;
|
|
1348
|
+
description: string | null;
|
|
1349
|
+
/**
|
|
1350
|
+
* Number of active integrations bound to this profile
|
|
1351
|
+
*/
|
|
1352
|
+
integrationCount: number;
|
|
1353
|
+
createdAt: string;
|
|
1354
|
+
updatedAt: string;
|
|
1355
|
+
};
|
|
1356
|
+
};
|
|
1357
|
+
};
|
|
1358
|
+
type PatchV1ProfilesByIdResponse = PatchV1ProfilesByIdResponses[keyof PatchV1ProfilesByIdResponses];
|
|
1359
|
+
type GetV1AppsData = {
|
|
1360
|
+
body?: never;
|
|
1361
|
+
path?: never;
|
|
1362
|
+
query?: {
|
|
1363
|
+
platform?: 'twitter' | 'instagram' | 'youtube' | 'tiktok' | 'pinterest' | 'linkedin' | 'bluesky' | 'facebook' | 'threads' | 'googlebusiness';
|
|
1364
|
+
page?: number;
|
|
1365
|
+
limit?: number;
|
|
1366
|
+
/**
|
|
1367
|
+
* Case-insensitive substring match on app name
|
|
1368
|
+
*/
|
|
1369
|
+
name?: string;
|
|
1370
|
+
};
|
|
1371
|
+
url: '/v1/apps/';
|
|
1372
|
+
};
|
|
1373
|
+
type GetV1AppsResponses = {
|
|
1374
|
+
/**
|
|
1375
|
+
* Default Response
|
|
1376
|
+
*/
|
|
1377
|
+
200: {
|
|
1378
|
+
success: boolean;
|
|
1379
|
+
total: number;
|
|
1380
|
+
page: number;
|
|
1381
|
+
limit: number;
|
|
1382
|
+
apps: Array<{
|
|
1383
|
+
/**
|
|
1384
|
+
* Pass this as appId when connecting
|
|
1385
|
+
*/
|
|
1386
|
+
id: string;
|
|
1387
|
+
platform: 'twitter' | 'instagram' | 'youtube' | 'tiktok' | 'pinterest' | 'linkedin' | 'bluesky' | 'facebook' | 'threads' | 'googlebusiness';
|
|
1388
|
+
name: string;
|
|
1389
|
+
imageUrl: string | null;
|
|
1390
|
+
/**
|
|
1391
|
+
* The OAuth app client id. The client secret is never returned.
|
|
1392
|
+
*/
|
|
1393
|
+
clientId: string;
|
|
1394
|
+
/**
|
|
1395
|
+
* Number of active integrations connected under this app
|
|
1396
|
+
*/
|
|
1397
|
+
integrationCount: number;
|
|
1398
|
+
createdAt: string;
|
|
1399
|
+
updatedAt: string;
|
|
1400
|
+
}>;
|
|
1401
|
+
};
|
|
1402
|
+
};
|
|
1403
|
+
type GetV1AppsResponse = GetV1AppsResponses[keyof GetV1AppsResponses];
|
|
1404
|
+
type PostV1AppsData = {
|
|
1405
|
+
body: {
|
|
1406
|
+
platform: 'twitter' | 'instagram' | 'youtube' | 'tiktok' | 'pinterest' | 'linkedin' | 'bluesky' | 'facebook' | 'threads' | 'googlebusiness';
|
|
1407
|
+
/**
|
|
1408
|
+
* A label for this app (e.g. "Acme Twitter OAuth App")
|
|
1409
|
+
*/
|
|
1410
|
+
name: string;
|
|
1411
|
+
/**
|
|
1412
|
+
* The client id of your OAuth app for this platform
|
|
1413
|
+
*/
|
|
1414
|
+
clientId: string;
|
|
1415
|
+
/**
|
|
1416
|
+
* The client secret of your OAuth app. Stored encrypted.
|
|
1417
|
+
*/
|
|
1418
|
+
clientSecret: string;
|
|
1419
|
+
/**
|
|
1420
|
+
* Optional icon URL for the app
|
|
1421
|
+
*/
|
|
1422
|
+
imageUrl?: string;
|
|
1423
|
+
};
|
|
1424
|
+
path?: never;
|
|
1425
|
+
query?: never;
|
|
1426
|
+
url: '/v1/apps/';
|
|
1427
|
+
};
|
|
1428
|
+
type PostV1AppsErrors = {
|
|
1429
|
+
/**
|
|
1430
|
+
* Default Response
|
|
1431
|
+
*/
|
|
1432
|
+
400: {
|
|
1433
|
+
error: string;
|
|
1434
|
+
};
|
|
1435
|
+
/**
|
|
1436
|
+
* Default Response
|
|
1437
|
+
*/
|
|
1438
|
+
409: {
|
|
1439
|
+
error: string;
|
|
1440
|
+
};
|
|
1441
|
+
};
|
|
1442
|
+
type PostV1AppsError = PostV1AppsErrors[keyof PostV1AppsErrors];
|
|
1443
|
+
type PostV1AppsResponses = {
|
|
1444
|
+
/**
|
|
1445
|
+
* Default Response
|
|
1446
|
+
*/
|
|
1447
|
+
201: {
|
|
1448
|
+
success: boolean;
|
|
1449
|
+
app: {
|
|
1450
|
+
/**
|
|
1451
|
+
* Pass this as appId when connecting
|
|
1452
|
+
*/
|
|
1453
|
+
id: string;
|
|
1454
|
+
platform: 'twitter' | 'instagram' | 'youtube' | 'tiktok' | 'pinterest' | 'linkedin' | 'bluesky' | 'facebook' | 'threads' | 'googlebusiness';
|
|
1455
|
+
name: string;
|
|
1456
|
+
imageUrl: string | null;
|
|
1457
|
+
/**
|
|
1458
|
+
* The OAuth app client id. The client secret is never returned.
|
|
1459
|
+
*/
|
|
1460
|
+
clientId: string;
|
|
1461
|
+
/**
|
|
1462
|
+
* Number of active integrations connected under this app
|
|
1463
|
+
*/
|
|
1464
|
+
integrationCount: number;
|
|
1465
|
+
createdAt: string;
|
|
1466
|
+
updatedAt: string;
|
|
1467
|
+
};
|
|
1468
|
+
};
|
|
1469
|
+
};
|
|
1470
|
+
type PostV1AppsResponse = PostV1AppsResponses[keyof PostV1AppsResponses];
|
|
1471
|
+
type DeleteV1AppsByIdData = {
|
|
1472
|
+
body?: never;
|
|
1473
|
+
path: {
|
|
1474
|
+
/**
|
|
1475
|
+
* OAuth app ID
|
|
1476
|
+
*/
|
|
1477
|
+
id: string;
|
|
1478
|
+
};
|
|
1479
|
+
query?: never;
|
|
1480
|
+
url: '/v1/apps/{id}';
|
|
1481
|
+
};
|
|
1482
|
+
type DeleteV1AppsByIdErrors = {
|
|
1483
|
+
/**
|
|
1484
|
+
* Default Response
|
|
1485
|
+
*/
|
|
1486
|
+
400: {
|
|
1487
|
+
error: string;
|
|
1488
|
+
};
|
|
1489
|
+
/**
|
|
1490
|
+
* Default Response
|
|
1491
|
+
*/
|
|
1492
|
+
404: {
|
|
1493
|
+
error: string;
|
|
1494
|
+
};
|
|
1495
|
+
/**
|
|
1496
|
+
* Default Response
|
|
1497
|
+
*/
|
|
1498
|
+
409: {
|
|
1499
|
+
error: string;
|
|
1500
|
+
};
|
|
1501
|
+
};
|
|
1502
|
+
type DeleteV1AppsByIdError = DeleteV1AppsByIdErrors[keyof DeleteV1AppsByIdErrors];
|
|
1503
|
+
type DeleteV1AppsByIdResponses = {
|
|
1504
|
+
/**
|
|
1505
|
+
* Default Response
|
|
1506
|
+
*/
|
|
1507
|
+
200: {
|
|
1508
|
+
success: boolean;
|
|
1509
|
+
message: string;
|
|
1510
|
+
};
|
|
1511
|
+
};
|
|
1512
|
+
type DeleteV1AppsByIdResponse = DeleteV1AppsByIdResponses[keyof DeleteV1AppsByIdResponses];
|
|
1513
|
+
type GetV1AppsByIdData = {
|
|
1514
|
+
body?: never;
|
|
1515
|
+
path: {
|
|
1516
|
+
/**
|
|
1517
|
+
* OAuth app ID
|
|
1518
|
+
*/
|
|
1519
|
+
id: string;
|
|
1520
|
+
};
|
|
1521
|
+
query?: never;
|
|
1522
|
+
url: '/v1/apps/{id}';
|
|
1523
|
+
};
|
|
1524
|
+
type GetV1AppsByIdErrors = {
|
|
1525
|
+
/**
|
|
1526
|
+
* Default Response
|
|
1527
|
+
*/
|
|
1528
|
+
400: {
|
|
1529
|
+
error: string;
|
|
1530
|
+
};
|
|
1531
|
+
/**
|
|
1532
|
+
* Default Response
|
|
1533
|
+
*/
|
|
1534
|
+
404: {
|
|
1535
|
+
error: string;
|
|
1536
|
+
};
|
|
1537
|
+
};
|
|
1538
|
+
type GetV1AppsByIdError = GetV1AppsByIdErrors[keyof GetV1AppsByIdErrors];
|
|
1539
|
+
type GetV1AppsByIdResponses = {
|
|
1540
|
+
/**
|
|
1541
|
+
* Default Response
|
|
1542
|
+
*/
|
|
1543
|
+
200: {
|
|
1544
|
+
success: boolean;
|
|
1545
|
+
app: {
|
|
1546
|
+
/**
|
|
1547
|
+
* Pass this as appId when connecting
|
|
1548
|
+
*/
|
|
1549
|
+
id: string;
|
|
1550
|
+
platform: 'twitter' | 'instagram' | 'youtube' | 'tiktok' | 'pinterest' | 'linkedin' | 'bluesky' | 'facebook' | 'threads' | 'googlebusiness';
|
|
1551
|
+
name: string;
|
|
1552
|
+
imageUrl: string | null;
|
|
1553
|
+
/**
|
|
1554
|
+
* The OAuth app client id. The client secret is never returned.
|
|
1555
|
+
*/
|
|
1556
|
+
clientId: string;
|
|
1557
|
+
/**
|
|
1558
|
+
* Number of active integrations connected under this app
|
|
1559
|
+
*/
|
|
1560
|
+
integrationCount: number;
|
|
1561
|
+
createdAt: string;
|
|
1562
|
+
updatedAt: string;
|
|
1563
|
+
};
|
|
1564
|
+
};
|
|
1565
|
+
};
|
|
1566
|
+
type GetV1AppsByIdResponse = GetV1AppsByIdResponses[keyof GetV1AppsByIdResponses];
|
|
1567
|
+
type PatchV1AppsByIdData = {
|
|
1568
|
+
body: {
|
|
1569
|
+
name?: string;
|
|
1570
|
+
imageUrl?: string | null;
|
|
1571
|
+
/**
|
|
1572
|
+
* Rotate the stored client secret. The clientId stays the same so existing tokens keep working — to switch to a different app, create a new OAuth app and reconnect.
|
|
1573
|
+
*/
|
|
1574
|
+
clientSecret?: string;
|
|
1575
|
+
};
|
|
1576
|
+
path: {
|
|
1577
|
+
/**
|
|
1578
|
+
* OAuth app ID
|
|
1579
|
+
*/
|
|
1580
|
+
id: string;
|
|
1581
|
+
};
|
|
1582
|
+
query?: never;
|
|
1583
|
+
url: '/v1/apps/{id}';
|
|
1584
|
+
};
|
|
1585
|
+
type PatchV1AppsByIdErrors = {
|
|
1586
|
+
/**
|
|
1587
|
+
* Default Response
|
|
1588
|
+
*/
|
|
1589
|
+
400: {
|
|
1590
|
+
error: string;
|
|
1591
|
+
};
|
|
1592
|
+
/**
|
|
1593
|
+
* Default Response
|
|
1594
|
+
*/
|
|
1595
|
+
404: {
|
|
1596
|
+
error: string;
|
|
1597
|
+
};
|
|
1598
|
+
};
|
|
1599
|
+
type PatchV1AppsByIdError = PatchV1AppsByIdErrors[keyof PatchV1AppsByIdErrors];
|
|
1600
|
+
type PatchV1AppsByIdResponses = {
|
|
1601
|
+
/**
|
|
1602
|
+
* Default Response
|
|
1603
|
+
*/
|
|
1604
|
+
200: {
|
|
1605
|
+
success: boolean;
|
|
1606
|
+
app: {
|
|
1607
|
+
/**
|
|
1608
|
+
* Pass this as appId when connecting
|
|
1609
|
+
*/
|
|
1610
|
+
id: string;
|
|
1611
|
+
platform: 'twitter' | 'instagram' | 'youtube' | 'tiktok' | 'pinterest' | 'linkedin' | 'bluesky' | 'facebook' | 'threads' | 'googlebusiness';
|
|
1612
|
+
name: string;
|
|
1613
|
+
imageUrl: string | null;
|
|
1614
|
+
/**
|
|
1615
|
+
* The OAuth app client id. The client secret is never returned.
|
|
1616
|
+
*/
|
|
1617
|
+
clientId: string;
|
|
1618
|
+
/**
|
|
1619
|
+
* Number of active integrations connected under this app
|
|
1620
|
+
*/
|
|
1621
|
+
integrationCount: number;
|
|
1622
|
+
createdAt: string;
|
|
1623
|
+
updatedAt: string;
|
|
1624
|
+
};
|
|
1625
|
+
};
|
|
1626
|
+
};
|
|
1627
|
+
type PatchV1AppsByIdResponse = PatchV1AppsByIdResponses[keyof PatchV1AppsByIdResponses];
|
|
1628
|
+
type PostV1NotificationsTestData = {
|
|
1629
|
+
body: {
|
|
1630
|
+
channel: 'webhook' | 'email';
|
|
1631
|
+
profileId?: string | null;
|
|
1632
|
+
webhook?: {
|
|
1633
|
+
/**
|
|
1634
|
+
* HTTPS endpoint that receives PostPeer JSON payloads
|
|
1635
|
+
*/
|
|
1636
|
+
url: string;
|
|
1637
|
+
};
|
|
1638
|
+
email?: {
|
|
1639
|
+
recipients: Array<string>;
|
|
1640
|
+
};
|
|
1641
|
+
};
|
|
1642
|
+
path?: never;
|
|
1643
|
+
query?: never;
|
|
1644
|
+
url: '/v1/notifications/test';
|
|
1645
|
+
};
|
|
1646
|
+
type PostV1NotificationsTestErrors = {
|
|
1647
|
+
/**
|
|
1648
|
+
* Default Response
|
|
1649
|
+
*/
|
|
1650
|
+
400: {
|
|
1651
|
+
success: boolean;
|
|
1652
|
+
message: string;
|
|
1653
|
+
};
|
|
1654
|
+
};
|
|
1655
|
+
type PostV1NotificationsTestError = PostV1NotificationsTestErrors[keyof PostV1NotificationsTestErrors];
|
|
1656
|
+
type PostV1NotificationsTestResponses = {
|
|
1657
|
+
/**
|
|
1658
|
+
* Default Response
|
|
1659
|
+
*/
|
|
1660
|
+
200: {
|
|
1661
|
+
success: boolean;
|
|
1662
|
+
message: string;
|
|
1663
|
+
};
|
|
1664
|
+
};
|
|
1665
|
+
type PostV1NotificationsTestResponse = PostV1NotificationsTestResponses[keyof PostV1NotificationsTestResponses];
|
|
1666
|
+
type GetV1NotificationsData = {
|
|
1667
|
+
body?: never;
|
|
1668
|
+
path?: never;
|
|
1669
|
+
query?: never;
|
|
1670
|
+
url: '/v1/notifications/';
|
|
1671
|
+
};
|
|
1672
|
+
type GetV1NotificationsResponses = {
|
|
1673
|
+
/**
|
|
1674
|
+
* Default Response
|
|
1675
|
+
*/
|
|
1676
|
+
200: {
|
|
1677
|
+
success: boolean;
|
|
1678
|
+
notifications: Array<{
|
|
1679
|
+
id: string;
|
|
1680
|
+
channel: 'webhook' | 'email';
|
|
1681
|
+
profileId: string | null;
|
|
1682
|
+
eventTypes: Array<'post.scheduled' | 'post.published' | 'post.partial' | 'post.failed'>;
|
|
1683
|
+
onlyScheduledPosts: boolean;
|
|
1684
|
+
enabled: boolean;
|
|
1685
|
+
webhook?: {
|
|
1686
|
+
url: string;
|
|
1687
|
+
/**
|
|
1688
|
+
* Webhook signing secret (masked in list responses)
|
|
1689
|
+
*/
|
|
1690
|
+
secret: string;
|
|
1691
|
+
};
|
|
1692
|
+
email?: {
|
|
1693
|
+
recipients: Array<string>;
|
|
1694
|
+
};
|
|
1695
|
+
lastTestAt: string | null;
|
|
1696
|
+
lastTestStatus: string | null;
|
|
1697
|
+
createdAt: string;
|
|
1698
|
+
updatedAt: string;
|
|
1699
|
+
}>;
|
|
1700
|
+
};
|
|
1701
|
+
};
|
|
1702
|
+
type GetV1NotificationsResponse = GetV1NotificationsResponses[keyof GetV1NotificationsResponses];
|
|
1703
|
+
type PostV1NotificationsData = {
|
|
1704
|
+
body: {
|
|
1705
|
+
channel: 'webhook' | 'email';
|
|
1706
|
+
profileId?: string | null;
|
|
1707
|
+
eventTypes: Array<'post.scheduled' | 'post.published' | 'post.partial' | 'post.failed'>;
|
|
1708
|
+
/**
|
|
1709
|
+
* When true, deliver matching notifications only for posts that were scheduled.
|
|
1710
|
+
*/
|
|
1711
|
+
onlyScheduledPosts?: boolean;
|
|
1712
|
+
enabled?: boolean;
|
|
1713
|
+
webhook?: {
|
|
1714
|
+
/**
|
|
1715
|
+
* HTTPS endpoint that receives PostPeer JSON payloads
|
|
1716
|
+
*/
|
|
1717
|
+
url: string;
|
|
1718
|
+
};
|
|
1719
|
+
email?: {
|
|
1720
|
+
recipients: Array<string>;
|
|
1721
|
+
};
|
|
1722
|
+
};
|
|
1723
|
+
path?: never;
|
|
1724
|
+
query?: never;
|
|
1725
|
+
url: '/v1/notifications/';
|
|
1726
|
+
};
|
|
1727
|
+
type PostV1NotificationsErrors = {
|
|
1728
|
+
/**
|
|
1729
|
+
* Default Response
|
|
1730
|
+
*/
|
|
1731
|
+
400: {
|
|
1732
|
+
success: boolean;
|
|
1733
|
+
message: string;
|
|
1734
|
+
};
|
|
1735
|
+
};
|
|
1736
|
+
type PostV1NotificationsError = PostV1NotificationsErrors[keyof PostV1NotificationsErrors];
|
|
1737
|
+
type PostV1NotificationsResponses = {
|
|
1738
|
+
/**
|
|
1739
|
+
* Default Response
|
|
1740
|
+
*/
|
|
1741
|
+
201: {
|
|
1742
|
+
success: boolean;
|
|
1743
|
+
notification: {
|
|
1744
|
+
id: string;
|
|
1745
|
+
channel: 'webhook' | 'email';
|
|
1746
|
+
profileId: string | null;
|
|
1747
|
+
eventTypes: Array<'post.scheduled' | 'post.published' | 'post.partial' | 'post.failed'>;
|
|
1748
|
+
onlyScheduledPosts: boolean;
|
|
1749
|
+
enabled: boolean;
|
|
1750
|
+
webhook?: {
|
|
1751
|
+
url: string;
|
|
1752
|
+
/**
|
|
1753
|
+
* Webhook signing secret (masked in list responses)
|
|
1754
|
+
*/
|
|
1755
|
+
secret: string;
|
|
1756
|
+
};
|
|
1757
|
+
email?: {
|
|
1758
|
+
recipients: Array<string>;
|
|
1759
|
+
};
|
|
1760
|
+
lastTestAt: string | null;
|
|
1761
|
+
lastTestStatus: string | null;
|
|
1762
|
+
createdAt: string;
|
|
1763
|
+
updatedAt: string;
|
|
1764
|
+
};
|
|
1765
|
+
};
|
|
1766
|
+
};
|
|
1767
|
+
type PostV1NotificationsResponse = PostV1NotificationsResponses[keyof PostV1NotificationsResponses];
|
|
1768
|
+
type DeleteV1NotificationsByIdData = {
|
|
1769
|
+
body?: never;
|
|
1770
|
+
path: {
|
|
1771
|
+
/**
|
|
1772
|
+
* Notification subscription ID
|
|
1773
|
+
*/
|
|
1774
|
+
id: string;
|
|
1775
|
+
};
|
|
1776
|
+
query?: never;
|
|
1777
|
+
url: '/v1/notifications/{id}';
|
|
1778
|
+
};
|
|
1779
|
+
type DeleteV1NotificationsByIdErrors = {
|
|
1780
|
+
/**
|
|
1781
|
+
* Default Response
|
|
1782
|
+
*/
|
|
1783
|
+
400: {
|
|
1784
|
+
success: boolean;
|
|
1785
|
+
message: string;
|
|
1786
|
+
};
|
|
1787
|
+
/**
|
|
1788
|
+
* Default Response
|
|
1789
|
+
*/
|
|
1790
|
+
404: {
|
|
1791
|
+
success: boolean;
|
|
1792
|
+
message: string;
|
|
1793
|
+
};
|
|
1794
|
+
};
|
|
1795
|
+
type DeleteV1NotificationsByIdError = DeleteV1NotificationsByIdErrors[keyof DeleteV1NotificationsByIdErrors];
|
|
1796
|
+
type DeleteV1NotificationsByIdResponses = {
|
|
1797
|
+
/**
|
|
1798
|
+
* Default Response
|
|
1799
|
+
*/
|
|
1800
|
+
200: {
|
|
1801
|
+
success: boolean;
|
|
1802
|
+
message: string;
|
|
1803
|
+
};
|
|
1804
|
+
};
|
|
1805
|
+
type DeleteV1NotificationsByIdResponse = DeleteV1NotificationsByIdResponses[keyof DeleteV1NotificationsByIdResponses];
|
|
1806
|
+
type GetV1NotificationsByIdData = {
|
|
1807
|
+
body?: never;
|
|
1808
|
+
path: {
|
|
1809
|
+
/**
|
|
1810
|
+
* Notification subscription ID
|
|
1811
|
+
*/
|
|
1812
|
+
id: string;
|
|
1813
|
+
};
|
|
1814
|
+
query?: never;
|
|
1815
|
+
url: '/v1/notifications/{id}';
|
|
1816
|
+
};
|
|
1817
|
+
type GetV1NotificationsByIdErrors = {
|
|
1818
|
+
/**
|
|
1819
|
+
* Default Response
|
|
1820
|
+
*/
|
|
1821
|
+
400: {
|
|
1822
|
+
success: boolean;
|
|
1823
|
+
message: string;
|
|
1824
|
+
};
|
|
1825
|
+
/**
|
|
1826
|
+
* Default Response
|
|
1827
|
+
*/
|
|
1828
|
+
404: {
|
|
1829
|
+
success: boolean;
|
|
1830
|
+
message: string;
|
|
1831
|
+
};
|
|
1832
|
+
};
|
|
1833
|
+
type GetV1NotificationsByIdError = GetV1NotificationsByIdErrors[keyof GetV1NotificationsByIdErrors];
|
|
1834
|
+
type GetV1NotificationsByIdResponses = {
|
|
1835
|
+
/**
|
|
1836
|
+
* Default Response
|
|
1837
|
+
*/
|
|
1838
|
+
200: {
|
|
1839
|
+
success: boolean;
|
|
1840
|
+
notification: {
|
|
1841
|
+
id: string;
|
|
1842
|
+
channel: 'webhook' | 'email';
|
|
1843
|
+
profileId: string | null;
|
|
1844
|
+
eventTypes: Array<'post.scheduled' | 'post.published' | 'post.partial' | 'post.failed'>;
|
|
1845
|
+
onlyScheduledPosts: boolean;
|
|
1846
|
+
enabled: boolean;
|
|
1847
|
+
webhook?: {
|
|
1848
|
+
url: string;
|
|
1849
|
+
/**
|
|
1850
|
+
* Webhook signing secret (masked in list responses)
|
|
1851
|
+
*/
|
|
1852
|
+
secret: string;
|
|
1853
|
+
};
|
|
1854
|
+
email?: {
|
|
1855
|
+
recipients: Array<string>;
|
|
1856
|
+
};
|
|
1857
|
+
lastTestAt: string | null;
|
|
1858
|
+
lastTestStatus: string | null;
|
|
1859
|
+
createdAt: string;
|
|
1860
|
+
updatedAt: string;
|
|
1861
|
+
};
|
|
1862
|
+
};
|
|
1863
|
+
};
|
|
1864
|
+
type GetV1NotificationsByIdResponse = GetV1NotificationsByIdResponses[keyof GetV1NotificationsByIdResponses];
|
|
1865
|
+
type PatchV1NotificationsByIdData = {
|
|
1866
|
+
body: {
|
|
1867
|
+
profileId?: string | null;
|
|
1868
|
+
eventTypes?: Array<'post.scheduled' | 'post.published' | 'post.partial' | 'post.failed'>;
|
|
1869
|
+
/**
|
|
1870
|
+
* When true, deliver matching notifications only for posts that were scheduled.
|
|
1871
|
+
*/
|
|
1872
|
+
onlyScheduledPosts?: boolean;
|
|
1873
|
+
enabled?: boolean;
|
|
1874
|
+
webhook?: {
|
|
1875
|
+
/**
|
|
1876
|
+
* HTTPS endpoint that receives PostPeer JSON payloads
|
|
1877
|
+
*/
|
|
1878
|
+
url: string;
|
|
1879
|
+
};
|
|
1880
|
+
email?: {
|
|
1881
|
+
recipients: Array<string>;
|
|
1882
|
+
};
|
|
1883
|
+
};
|
|
1884
|
+
path: {
|
|
1885
|
+
/**
|
|
1886
|
+
* Notification subscription ID
|
|
1887
|
+
*/
|
|
1888
|
+
id: string;
|
|
1889
|
+
};
|
|
1890
|
+
query?: never;
|
|
1891
|
+
url: '/v1/notifications/{id}';
|
|
1892
|
+
};
|
|
1893
|
+
type PatchV1NotificationsByIdErrors = {
|
|
1894
|
+
/**
|
|
1895
|
+
* Default Response
|
|
1896
|
+
*/
|
|
1897
|
+
400: {
|
|
1898
|
+
success: boolean;
|
|
1899
|
+
message: string;
|
|
1900
|
+
};
|
|
1901
|
+
/**
|
|
1902
|
+
* Default Response
|
|
1903
|
+
*/
|
|
1904
|
+
404: {
|
|
1905
|
+
success: boolean;
|
|
1906
|
+
message: string;
|
|
1907
|
+
};
|
|
1908
|
+
};
|
|
1909
|
+
type PatchV1NotificationsByIdError = PatchV1NotificationsByIdErrors[keyof PatchV1NotificationsByIdErrors];
|
|
1910
|
+
type PatchV1NotificationsByIdResponses = {
|
|
1911
|
+
/**
|
|
1912
|
+
* Default Response
|
|
1913
|
+
*/
|
|
1914
|
+
200: {
|
|
1915
|
+
success: boolean;
|
|
1916
|
+
notification: {
|
|
1917
|
+
id: string;
|
|
1918
|
+
channel: 'webhook' | 'email';
|
|
1919
|
+
profileId: string | null;
|
|
1920
|
+
eventTypes: Array<'post.scheduled' | 'post.published' | 'post.partial' | 'post.failed'>;
|
|
1921
|
+
onlyScheduledPosts: boolean;
|
|
1922
|
+
enabled: boolean;
|
|
1923
|
+
webhook?: {
|
|
1924
|
+
url: string;
|
|
1925
|
+
/**
|
|
1926
|
+
* Webhook signing secret (masked in list responses)
|
|
1927
|
+
*/
|
|
1928
|
+
secret: string;
|
|
1929
|
+
};
|
|
1930
|
+
email?: {
|
|
1931
|
+
recipients: Array<string>;
|
|
1932
|
+
};
|
|
1933
|
+
lastTestAt: string | null;
|
|
1934
|
+
lastTestStatus: string | null;
|
|
1935
|
+
createdAt: string;
|
|
1936
|
+
updatedAt: string;
|
|
1937
|
+
};
|
|
1938
|
+
};
|
|
1939
|
+
};
|
|
1940
|
+
type PatchV1NotificationsByIdResponse = PatchV1NotificationsByIdResponses[keyof PatchV1NotificationsByIdResponses];
|
|
1941
|
+
type GetV1PlatformsData = {
|
|
1942
|
+
body?: never;
|
|
1943
|
+
path?: never;
|
|
1944
|
+
query?: never;
|
|
1945
|
+
url: '/v1/platforms';
|
|
1946
|
+
};
|
|
1947
|
+
type GetV1PlatformsResponses = {
|
|
1948
|
+
/**
|
|
1949
|
+
* Default Response
|
|
1950
|
+
*/
|
|
1951
|
+
200: {
|
|
1952
|
+
platforms: Array<{
|
|
1953
|
+
name: 'twitter' | 'instagram' | 'youtube' | 'tiktok' | 'pinterest' | 'linkedin' | 'bluesky' | 'facebook' | 'threads' | 'googlebusiness';
|
|
1954
|
+
status: 'prod' | 'beta' | 'dev';
|
|
1955
|
+
}>;
|
|
1956
|
+
};
|
|
1957
|
+
};
|
|
1958
|
+
type GetV1PlatformsResponse = GetV1PlatformsResponses[keyof GetV1PlatformsResponses];
|
|
1959
|
+
type GetV1PostsData = {
|
|
1960
|
+
body?: never;
|
|
1961
|
+
path?: never;
|
|
1962
|
+
query?: {
|
|
1963
|
+
status?: 'draft' | 'pending' | 'scheduled' | 'publishing' | 'published' | 'failed' | 'partial';
|
|
1964
|
+
/**
|
|
1965
|
+
* Filter by platform (repeatable — OR logic)
|
|
1966
|
+
*/
|
|
1967
|
+
platform?: Array<'twitter' | 'instagram' | 'youtube' | 'tiktok' | 'pinterest' | 'linkedin' | 'bluesky' | 'facebook' | 'threads' | 'googlebusiness'>;
|
|
1968
|
+
/**
|
|
1969
|
+
* Filter to posts targeting an integration bound to this profile. Pass "null" (literal string) to filter to posts whose integrations have no profile.
|
|
1970
|
+
*/
|
|
1971
|
+
profileId?: string;
|
|
1972
|
+
/**
|
|
1973
|
+
* ISO 8601 lower bound on createdAt
|
|
1974
|
+
*/
|
|
1975
|
+
createdAfter?: string;
|
|
1976
|
+
/**
|
|
1977
|
+
* ISO 8601 upper bound on createdAt
|
|
1978
|
+
*/
|
|
1979
|
+
createdBefore?: string;
|
|
1980
|
+
/**
|
|
1981
|
+
* ISO 8601 lower bound on scheduledFor
|
|
1982
|
+
*/
|
|
1983
|
+
scheduledAfter?: string;
|
|
1984
|
+
/**
|
|
1985
|
+
* ISO 8601 upper bound on scheduledFor
|
|
1986
|
+
*/
|
|
1987
|
+
scheduledBefore?: string;
|
|
1988
|
+
/**
|
|
1989
|
+
* Page size (max 100)
|
|
1990
|
+
*/
|
|
1991
|
+
limit?: number;
|
|
1992
|
+
/**
|
|
1993
|
+
* Number of posts to skip
|
|
1994
|
+
*/
|
|
1995
|
+
offset?: number;
|
|
1996
|
+
sort?: SortOrder;
|
|
1997
|
+
};
|
|
1998
|
+
url: '/v1/posts/';
|
|
1999
|
+
};
|
|
2000
|
+
type GetV1PostsErrors = {
|
|
2001
|
+
/**
|
|
2002
|
+
* Default Response
|
|
2003
|
+
*/
|
|
2004
|
+
400: {
|
|
2005
|
+
success: boolean;
|
|
2006
|
+
message: string;
|
|
2007
|
+
};
|
|
2008
|
+
};
|
|
2009
|
+
type GetV1PostsError = GetV1PostsErrors[keyof GetV1PostsErrors];
|
|
2010
|
+
type GetV1PostsResponses = {
|
|
2011
|
+
/**
|
|
2012
|
+
* Default Response
|
|
2013
|
+
*/
|
|
2014
|
+
200: {
|
|
2015
|
+
success: boolean;
|
|
2016
|
+
/**
|
|
2017
|
+
* Total matched posts across all pages
|
|
2018
|
+
*/
|
|
2019
|
+
total: number;
|
|
2020
|
+
posts: Array<{
|
|
2021
|
+
/**
|
|
2022
|
+
* MongoDB ObjectId of the Post document
|
|
2023
|
+
*/
|
|
2024
|
+
postId: string;
|
|
2025
|
+
content: string;
|
|
2026
|
+
status: 'draft' | 'pending' | 'scheduled' | 'publishing' | 'published' | 'failed' | 'partial';
|
|
2027
|
+
/**
|
|
2028
|
+
* ISO 8601 scheduled datetime
|
|
2029
|
+
*/
|
|
2030
|
+
scheduledFor: string | null;
|
|
2031
|
+
timezone: string;
|
|
2032
|
+
mediaItems: Array<{
|
|
2033
|
+
type: 'image' | 'video' | 'gif';
|
|
2034
|
+
url: string;
|
|
2035
|
+
filename: string;
|
|
2036
|
+
size: number;
|
|
2037
|
+
mimeType: string;
|
|
2038
|
+
}>;
|
|
2039
|
+
platforms: Array<{
|
|
2040
|
+
platform: 'twitter' | 'instagram' | 'youtube' | 'tiktok' | 'pinterest' | 'linkedin' | 'bluesky' | 'facebook' | 'threads' | 'googlebusiness';
|
|
2041
|
+
status: 'draft' | 'pending' | 'scheduled' | 'publishing' | 'published' | 'failed' | 'partial';
|
|
2042
|
+
/**
|
|
2043
|
+
* Per-platform text override that was used for this platform. Null when the top-level `content` was used.
|
|
2044
|
+
*/
|
|
2045
|
+
content: string | null;
|
|
2046
|
+
platformPostId: string | null;
|
|
2047
|
+
/**
|
|
2048
|
+
* Direct URL to the published post
|
|
2049
|
+
*/
|
|
2050
|
+
platformPostUrl: string | null;
|
|
2051
|
+
publishedAt: string | null;
|
|
2052
|
+
errorMessage: string | null;
|
|
2053
|
+
warningMessage: string | null;
|
|
2054
|
+
}>;
|
|
2055
|
+
crosspostingEnabled: boolean;
|
|
2056
|
+
rawRequestBody: {
|
|
2057
|
+
[key: string]: unknown;
|
|
2058
|
+
};
|
|
2059
|
+
createdAt: string;
|
|
2060
|
+
updatedAt: string;
|
|
2061
|
+
}>;
|
|
2062
|
+
};
|
|
2063
|
+
};
|
|
2064
|
+
type GetV1PostsResponse = GetV1PostsResponses[keyof GetV1PostsResponses];
|
|
2065
|
+
type PostV1PostsData = {
|
|
2066
|
+
body: {
|
|
2067
|
+
/**
|
|
2068
|
+
* Post text body
|
|
2069
|
+
*/
|
|
2070
|
+
content: string;
|
|
2071
|
+
/**
|
|
2072
|
+
* Media attachments (images, videos, GIFs)
|
|
2073
|
+
*/
|
|
2074
|
+
mediaItems?: Array<{
|
|
2075
|
+
type: 'image' | 'video' | 'gif' | 'document';
|
|
2076
|
+
url: string;
|
|
2077
|
+
/**
|
|
2078
|
+
* Thumbnail image URL for video items. Supported on YouTube regular videos (not Shorts). JPEG, PNG, or GIF, max 2 MB, min 640 px wide.
|
|
2079
|
+
*/
|
|
2080
|
+
thumbnail?: string;
|
|
2081
|
+
}>;
|
|
2082
|
+
/**
|
|
2083
|
+
* Target platform accounts to publish to
|
|
2084
|
+
*/
|
|
2085
|
+
platforms: Array<{
|
|
2086
|
+
platform: 'twitter';
|
|
2087
|
+
/**
|
|
2088
|
+
* Integration._id — find yours via GET /connect/integrations
|
|
2089
|
+
*/
|
|
2090
|
+
accountId: string;
|
|
2091
|
+
/**
|
|
2092
|
+
* Optional per-platform text override. Use when you want to change the text for this platform because different platforms talk differently. When omitted, the top-level `content` is used.
|
|
2093
|
+
*/
|
|
2094
|
+
content?: string;
|
|
2095
|
+
platformSpecificData?: TwitterConfigurations;
|
|
2096
|
+
} | {
|
|
2097
|
+
platform: 'instagram';
|
|
2098
|
+
/**
|
|
2099
|
+
* Integration._id — find yours via GET /connect/integrations
|
|
2100
|
+
*/
|
|
2101
|
+
accountId: string;
|
|
2102
|
+
/**
|
|
2103
|
+
* Optional per-platform text override. Use when you want to change the text for this platform because different platforms talk differently. When omitted, the top-level `content` is used.
|
|
2104
|
+
*/
|
|
2105
|
+
content?: string;
|
|
2106
|
+
platformSpecificData?: InstagramConfigurations;
|
|
2107
|
+
} | {
|
|
2108
|
+
platform: 'youtube';
|
|
2109
|
+
/**
|
|
2110
|
+
* Integration._id — find yours via GET /connect/integrations
|
|
2111
|
+
*/
|
|
2112
|
+
accountId: string;
|
|
2113
|
+
/**
|
|
2114
|
+
* Optional per-platform text override. Use when you want to change the text for this platform because different platforms talk differently. When omitted, the top-level `content` is used.
|
|
2115
|
+
*/
|
|
2116
|
+
content?: string;
|
|
2117
|
+
platformSpecificData?: YouTubeConfigurations;
|
|
2118
|
+
} | {
|
|
2119
|
+
platform: 'tiktok';
|
|
2120
|
+
/**
|
|
2121
|
+
* Integration._id — find yours via GET /connect/integrations
|
|
2122
|
+
*/
|
|
2123
|
+
accountId: string;
|
|
2124
|
+
/**
|
|
2125
|
+
* Optional per-platform text override. Use when you want to change the text for this platform because different platforms talk differently. When omitted, the top-level `content` is used.
|
|
2126
|
+
*/
|
|
2127
|
+
content?: string;
|
|
2128
|
+
platformSpecificData?: TikTokConfigurations;
|
|
2129
|
+
} | {
|
|
2130
|
+
platform: 'pinterest';
|
|
2131
|
+
/**
|
|
2132
|
+
* Integration._id — find yours via GET /connect/integrations
|
|
2133
|
+
*/
|
|
2134
|
+
accountId: string;
|
|
2135
|
+
/**
|
|
2136
|
+
* Optional per-platform text override. Use when you want to change the text for this platform because different platforms talk differently. When omitted, the top-level `content` is used.
|
|
2137
|
+
*/
|
|
2138
|
+
content?: string;
|
|
2139
|
+
platformSpecificData?: PinterestConfigurations;
|
|
2140
|
+
} | {
|
|
2141
|
+
platform: 'linkedin';
|
|
2142
|
+
/**
|
|
2143
|
+
* Integration._id — find yours via GET /connect/integrations
|
|
2144
|
+
*/
|
|
2145
|
+
accountId: string;
|
|
2146
|
+
/**
|
|
2147
|
+
* Optional per-platform text override. Use when you want to change the text for this platform because different platforms talk differently. When omitted, the top-level `content` is used.
|
|
2148
|
+
*/
|
|
2149
|
+
content?: string;
|
|
2150
|
+
platformSpecificData?: LinkedInConfigurations;
|
|
2151
|
+
} | {
|
|
2152
|
+
platform: 'bluesky';
|
|
2153
|
+
/**
|
|
2154
|
+
* Integration._id — find yours via GET /connect/integrations
|
|
2155
|
+
*/
|
|
2156
|
+
accountId: string;
|
|
2157
|
+
/**
|
|
2158
|
+
* Optional per-platform text override. Use when you want to change the text for this platform because different platforms talk differently. When omitted, the top-level `content` is used.
|
|
2159
|
+
*/
|
|
2160
|
+
content?: string;
|
|
2161
|
+
platformSpecificData?: BlueskyConfigurations;
|
|
2162
|
+
} | {
|
|
2163
|
+
platform: 'facebook';
|
|
2164
|
+
/**
|
|
2165
|
+
* Integration._id — find yours via GET /connect/integrations
|
|
2166
|
+
*/
|
|
2167
|
+
accountId: string;
|
|
2168
|
+
/**
|
|
2169
|
+
* Optional per-platform text override. Use when you want to change the text for this platform because different platforms talk differently. When omitted, the top-level `content` is used.
|
|
2170
|
+
*/
|
|
2171
|
+
content?: string;
|
|
2172
|
+
platformSpecificData?: FacebookConfigurations;
|
|
2173
|
+
} | {
|
|
2174
|
+
platform: 'threads';
|
|
2175
|
+
/**
|
|
2176
|
+
* Integration._id — find yours via GET /connect/integrations
|
|
2177
|
+
*/
|
|
2178
|
+
accountId: string;
|
|
2179
|
+
/**
|
|
2180
|
+
* Optional per-platform text override. Use when you want to change the text for this platform because different platforms talk differently. When omitted, the top-level `content` is used.
|
|
2181
|
+
*/
|
|
2182
|
+
content?: string;
|
|
2183
|
+
platformSpecificData?: ThreadsConfigurations;
|
|
2184
|
+
} | {
|
|
2185
|
+
platform: 'googlebusiness';
|
|
2186
|
+
/**
|
|
2187
|
+
* Integration._id — find yours via GET /connect/integrations
|
|
2188
|
+
*/
|
|
2189
|
+
accountId: string;
|
|
2190
|
+
/**
|
|
2191
|
+
* Optional per-platform text override. Use when you want to change the text for this platform because different platforms talk differently. When omitted, the top-level `content` is used.
|
|
2192
|
+
*/
|
|
2193
|
+
content?: string;
|
|
2194
|
+
platformSpecificData?: GoogleBusinessConfigurations;
|
|
2195
|
+
}>;
|
|
2196
|
+
/**
|
|
2197
|
+
* Publish immediately. Required when scheduledFor is omitted.
|
|
2198
|
+
*/
|
|
2199
|
+
publishNow?: boolean;
|
|
2200
|
+
/**
|
|
2201
|
+
* ISO 8601 datetime to schedule the post for future publishing
|
|
2202
|
+
*/
|
|
2203
|
+
scheduledFor?: string;
|
|
2204
|
+
/**
|
|
2205
|
+
* IANA timezone for the scheduled time (e.g. America/New_York). Defaults to UTC.
|
|
2206
|
+
*/
|
|
2207
|
+
timezone?: string;
|
|
2208
|
+
};
|
|
2209
|
+
path?: never;
|
|
2210
|
+
query?: never;
|
|
2211
|
+
url: '/v1/posts/';
|
|
2212
|
+
};
|
|
2213
|
+
type PostV1PostsErrors = {
|
|
2214
|
+
/**
|
|
2215
|
+
* Default Response
|
|
2216
|
+
*/
|
|
2217
|
+
400: {
|
|
2218
|
+
success: boolean;
|
|
2219
|
+
message: string;
|
|
2220
|
+
};
|
|
2221
|
+
/**
|
|
2222
|
+
* Default Response
|
|
2223
|
+
*/
|
|
2224
|
+
402: {
|
|
2225
|
+
success: boolean;
|
|
2226
|
+
message: string;
|
|
2227
|
+
};
|
|
2228
|
+
/**
|
|
2229
|
+
* Default Response
|
|
2230
|
+
*/
|
|
2231
|
+
403: {
|
|
2232
|
+
success: boolean;
|
|
2233
|
+
message: string;
|
|
2234
|
+
};
|
|
2235
|
+
/**
|
|
2236
|
+
* Default Response
|
|
2237
|
+
*/
|
|
2238
|
+
503: {
|
|
2239
|
+
success: boolean;
|
|
2240
|
+
message: string;
|
|
2241
|
+
};
|
|
2242
|
+
};
|
|
2243
|
+
type PostV1PostsError = PostV1PostsErrors[keyof PostV1PostsErrors];
|
|
2244
|
+
type PostV1PostsResponses = {
|
|
2245
|
+
/**
|
|
2246
|
+
* Default Response
|
|
2247
|
+
*/
|
|
2248
|
+
202: {
|
|
2249
|
+
/**
|
|
2250
|
+
* false only when every platform failed
|
|
2251
|
+
*/
|
|
2252
|
+
success: boolean;
|
|
2253
|
+
status: 'draft' | 'pending' | 'scheduled' | 'publishing' | 'published' | 'failed' | 'partial';
|
|
2254
|
+
/**
|
|
2255
|
+
* ISO 8601 datetime the post is scheduled for (only present for scheduled posts)
|
|
2256
|
+
*/
|
|
2257
|
+
scheduledFor?: string;
|
|
2258
|
+
/**
|
|
2259
|
+
* id of the saved Post document
|
|
2260
|
+
*/
|
|
2261
|
+
postId: string;
|
|
2262
|
+
platforms: Array<{
|
|
2263
|
+
platform: 'twitter' | 'instagram' | 'youtube' | 'tiktok' | 'pinterest' | 'linkedin' | 'bluesky' | 'facebook' | 'threads' | 'googlebusiness';
|
|
2264
|
+
/**
|
|
2265
|
+
* For publish-now timeout fallback, true means the platform target was accepted and final status is still pending.
|
|
2266
|
+
*/
|
|
2267
|
+
success: boolean;
|
|
2268
|
+
/**
|
|
2269
|
+
* Direct URL to the published post
|
|
2270
|
+
*/
|
|
2271
|
+
platformPostUrl?: string;
|
|
2272
|
+
/**
|
|
2273
|
+
* Error message when success is false
|
|
2274
|
+
*/
|
|
2275
|
+
error?: string;
|
|
2276
|
+
/**
|
|
2277
|
+
* Warning message when the post published but a non-critical follow-up action failed
|
|
2278
|
+
*/
|
|
2279
|
+
warningMessage?: string;
|
|
2280
|
+
}>;
|
|
2281
|
+
};
|
|
2282
|
+
};
|
|
2283
|
+
type PostV1PostsResponse = PostV1PostsResponses[keyof PostV1PostsResponses];
|
|
2284
|
+
type DeleteV1PostsByPostIdData = {
|
|
2285
|
+
body?: never;
|
|
2286
|
+
path: {
|
|
2287
|
+
/**
|
|
2288
|
+
* Post identifier
|
|
2289
|
+
*/
|
|
2290
|
+
postId: string;
|
|
2291
|
+
};
|
|
2292
|
+
query?: {
|
|
2293
|
+
/**
|
|
2294
|
+
* When true, also delete supported published platform posts. Costs 1 credit per successful platform deletion.
|
|
2295
|
+
*/
|
|
2296
|
+
deleteFromPlatforms?: boolean;
|
|
2297
|
+
};
|
|
2298
|
+
url: '/v1/posts/{postId}';
|
|
2299
|
+
};
|
|
2300
|
+
type DeleteV1PostsByPostIdErrors = {
|
|
2301
|
+
/**
|
|
2302
|
+
* Default Response
|
|
2303
|
+
*/
|
|
2304
|
+
402: {
|
|
2305
|
+
success: boolean;
|
|
2306
|
+
message: string;
|
|
2307
|
+
};
|
|
2308
|
+
/**
|
|
2309
|
+
* Default Response
|
|
2310
|
+
*/
|
|
2311
|
+
404: {
|
|
2312
|
+
success: boolean;
|
|
2313
|
+
message: string;
|
|
2314
|
+
};
|
|
2315
|
+
/**
|
|
2316
|
+
* Default Response
|
|
2317
|
+
*/
|
|
2318
|
+
409: {
|
|
2319
|
+
success: boolean;
|
|
2320
|
+
message: string;
|
|
2321
|
+
};
|
|
2322
|
+
};
|
|
2323
|
+
type DeleteV1PostsByPostIdError = DeleteV1PostsByPostIdErrors[keyof DeleteV1PostsByPostIdErrors];
|
|
2324
|
+
type DeleteV1PostsByPostIdResponses = {
|
|
2325
|
+
/**
|
|
2326
|
+
* Default Response
|
|
2327
|
+
*/
|
|
2328
|
+
200: {
|
|
2329
|
+
success: boolean;
|
|
2330
|
+
creditsCharged?: number;
|
|
2331
|
+
platforms?: Array<{
|
|
2332
|
+
platform: string;
|
|
2333
|
+
integrationId: string;
|
|
2334
|
+
platformPostId: string | null;
|
|
2335
|
+
status: string;
|
|
2336
|
+
success: boolean;
|
|
2337
|
+
message?: string;
|
|
2338
|
+
errorMessage?: string;
|
|
2339
|
+
}>;
|
|
2340
|
+
};
|
|
2341
|
+
};
|
|
2342
|
+
type DeleteV1PostsByPostIdResponse = DeleteV1PostsByPostIdResponses[keyof DeleteV1PostsByPostIdResponses];
|
|
2343
|
+
type GetV1PostsByPostIdData = {
|
|
2344
|
+
body?: never;
|
|
2345
|
+
path: {
|
|
2346
|
+
/**
|
|
2347
|
+
* Post identifier
|
|
2348
|
+
*/
|
|
2349
|
+
postId: string;
|
|
2350
|
+
};
|
|
2351
|
+
query?: never;
|
|
2352
|
+
url: '/v1/posts/{postId}';
|
|
2353
|
+
};
|
|
2354
|
+
type GetV1PostsByPostIdErrors = {
|
|
2355
|
+
/**
|
|
2356
|
+
* Default Response
|
|
2357
|
+
*/
|
|
2358
|
+
404: {
|
|
2359
|
+
success: boolean;
|
|
2360
|
+
message: string;
|
|
2361
|
+
};
|
|
2362
|
+
};
|
|
2363
|
+
type GetV1PostsByPostIdError = GetV1PostsByPostIdErrors[keyof GetV1PostsByPostIdErrors];
|
|
2364
|
+
type GetV1PostsByPostIdResponses = {
|
|
2365
|
+
/**
|
|
2366
|
+
* Default Response
|
|
2367
|
+
*/
|
|
2368
|
+
200: {
|
|
2369
|
+
success: boolean;
|
|
2370
|
+
post: {
|
|
2371
|
+
/**
|
|
2372
|
+
* MongoDB ObjectId of the Post document
|
|
2373
|
+
*/
|
|
2374
|
+
postId: string;
|
|
2375
|
+
content: string;
|
|
2376
|
+
status: 'draft' | 'pending' | 'scheduled' | 'publishing' | 'published' | 'failed' | 'partial';
|
|
2377
|
+
/**
|
|
2378
|
+
* ISO 8601 scheduled datetime
|
|
2379
|
+
*/
|
|
2380
|
+
scheduledFor: string | null;
|
|
2381
|
+
timezone: string;
|
|
2382
|
+
mediaItems: Array<{
|
|
2383
|
+
type: 'image' | 'video' | 'gif';
|
|
2384
|
+
url: string;
|
|
2385
|
+
filename: string;
|
|
2386
|
+
size: number;
|
|
2387
|
+
mimeType: string;
|
|
2388
|
+
}>;
|
|
2389
|
+
platforms: Array<{
|
|
2390
|
+
platform: 'twitter' | 'instagram' | 'youtube' | 'tiktok' | 'pinterest' | 'linkedin' | 'bluesky' | 'facebook' | 'threads' | 'googlebusiness';
|
|
2391
|
+
status: 'draft' | 'pending' | 'scheduled' | 'publishing' | 'published' | 'failed' | 'partial';
|
|
2392
|
+
/**
|
|
2393
|
+
* Per-platform text override that was used for this platform. Null when the top-level `content` was used.
|
|
2394
|
+
*/
|
|
2395
|
+
content: string | null;
|
|
2396
|
+
platformPostId: string | null;
|
|
2397
|
+
/**
|
|
2398
|
+
* Direct URL to the published post
|
|
2399
|
+
*/
|
|
2400
|
+
platformPostUrl: string | null;
|
|
2401
|
+
publishedAt: string | null;
|
|
2402
|
+
errorMessage: string | null;
|
|
2403
|
+
warningMessage: string | null;
|
|
2404
|
+
}>;
|
|
2405
|
+
crosspostingEnabled: boolean;
|
|
2406
|
+
rawRequestBody: {
|
|
2407
|
+
[key: string]: unknown;
|
|
2408
|
+
};
|
|
2409
|
+
createdAt: string;
|
|
2410
|
+
updatedAt: string;
|
|
2411
|
+
};
|
|
2412
|
+
};
|
|
2413
|
+
};
|
|
2414
|
+
type GetV1PostsByPostIdResponse = GetV1PostsByPostIdResponses[keyof GetV1PostsByPostIdResponses];
|
|
2415
|
+
type GetV1PostsScheduledData = {
|
|
2416
|
+
body?: never;
|
|
2417
|
+
path?: never;
|
|
2418
|
+
query?: {
|
|
2419
|
+
/**
|
|
2420
|
+
* Page size (max 100)
|
|
2421
|
+
*/
|
|
2422
|
+
limit?: number;
|
|
2423
|
+
/**
|
|
2424
|
+
* Number of scheduled posts to skip
|
|
2425
|
+
*/
|
|
2426
|
+
offset?: number;
|
|
2427
|
+
sort?: SortOrder;
|
|
2428
|
+
};
|
|
2429
|
+
url: '/v1/posts/scheduled/';
|
|
2430
|
+
};
|
|
2431
|
+
type GetV1PostsScheduledResponses = {
|
|
2432
|
+
/**
|
|
2433
|
+
* Default Response
|
|
2434
|
+
*/
|
|
2435
|
+
200: {
|
|
2436
|
+
success: boolean;
|
|
2437
|
+
/**
|
|
2438
|
+
* Total matched scheduled posts across all pages
|
|
2439
|
+
*/
|
|
2440
|
+
total: number;
|
|
2441
|
+
posts: Array<{
|
|
2442
|
+
/**
|
|
2443
|
+
* MongoDB ObjectId of the Post document
|
|
2444
|
+
*/
|
|
2445
|
+
postId: string;
|
|
2446
|
+
/**
|
|
2447
|
+
* Post text body
|
|
2448
|
+
*/
|
|
2449
|
+
content: string;
|
|
2450
|
+
/**
|
|
2451
|
+
* ISO 8601 scheduled datetime
|
|
2452
|
+
*/
|
|
2453
|
+
scheduledFor: string | null;
|
|
2454
|
+
/**
|
|
2455
|
+
* IANA timezone for the scheduled time
|
|
2456
|
+
*/
|
|
2457
|
+
timezone: string;
|
|
2458
|
+
/**
|
|
2459
|
+
* Media attachments
|
|
2460
|
+
*/
|
|
2461
|
+
mediaItems?: Array<{
|
|
2462
|
+
type: 'image' | 'video' | 'gif' | 'document';
|
|
2463
|
+
url: string;
|
|
2464
|
+
/**
|
|
2465
|
+
* Thumbnail image URL for video items. Supported on YouTube regular videos (not Shorts). JPEG, PNG, or GIF, max 2 MB, min 640 px wide.
|
|
2466
|
+
*/
|
|
2467
|
+
thumbnail?: string;
|
|
2468
|
+
}>;
|
|
2469
|
+
platforms: Array<{
|
|
2470
|
+
platform: 'twitter' | 'instagram' | 'youtube' | 'tiktok' | 'pinterest' | 'linkedin' | 'bluesky' | 'facebook' | 'threads' | 'googlebusiness';
|
|
2471
|
+
status: 'draft' | 'pending' | 'scheduled' | 'publishing' | 'published' | 'failed' | 'partial';
|
|
2472
|
+
}>;
|
|
2473
|
+
createdAt: string;
|
|
2474
|
+
}>;
|
|
2475
|
+
};
|
|
2476
|
+
};
|
|
2477
|
+
type GetV1PostsScheduledResponse = GetV1PostsScheduledResponses[keyof GetV1PostsScheduledResponses];
|
|
2478
|
+
type DeleteV1PostsScheduledByPostIdData = {
|
|
2479
|
+
body?: never;
|
|
2480
|
+
path: {
|
|
2481
|
+
postId: string;
|
|
2482
|
+
};
|
|
2483
|
+
query?: never;
|
|
2484
|
+
url: '/v1/posts/scheduled/{postId}';
|
|
2485
|
+
};
|
|
2486
|
+
type DeleteV1PostsScheduledByPostIdErrors = {
|
|
2487
|
+
/**
|
|
2488
|
+
* Default Response
|
|
2489
|
+
*/
|
|
2490
|
+
404: {
|
|
2491
|
+
success: boolean;
|
|
2492
|
+
message: string;
|
|
2493
|
+
};
|
|
2494
|
+
/**
|
|
2495
|
+
* Default Response
|
|
2496
|
+
*/
|
|
2497
|
+
409: {
|
|
2498
|
+
success: boolean;
|
|
2499
|
+
message: string;
|
|
2500
|
+
};
|
|
2501
|
+
};
|
|
2502
|
+
type DeleteV1PostsScheduledByPostIdError = DeleteV1PostsScheduledByPostIdErrors[keyof DeleteV1PostsScheduledByPostIdErrors];
|
|
2503
|
+
type DeleteV1PostsScheduledByPostIdResponses = {
|
|
2504
|
+
/**
|
|
2505
|
+
* Default Response
|
|
2506
|
+
*/
|
|
2507
|
+
200: {
|
|
2508
|
+
success: boolean;
|
|
2509
|
+
message: string;
|
|
2510
|
+
};
|
|
2511
|
+
};
|
|
2512
|
+
type DeleteV1PostsScheduledByPostIdResponse = DeleteV1PostsScheduledByPostIdResponses[keyof DeleteV1PostsScheduledByPostIdResponses];
|
|
2513
|
+
type PatchV1PostsScheduledByPostIdData = {
|
|
2514
|
+
body: {
|
|
2515
|
+
/**
|
|
2516
|
+
* New ISO 8601 datetime to schedule the post
|
|
2517
|
+
*/
|
|
2518
|
+
scheduledFor: string;
|
|
2519
|
+
/**
|
|
2520
|
+
* IANA timezone
|
|
2521
|
+
*/
|
|
2522
|
+
timezone?: string;
|
|
2523
|
+
};
|
|
2524
|
+
path: {
|
|
2525
|
+
postId: string;
|
|
2526
|
+
};
|
|
2527
|
+
query?: never;
|
|
2528
|
+
url: '/v1/posts/scheduled/{postId}';
|
|
2529
|
+
};
|
|
2530
|
+
type PatchV1PostsScheduledByPostIdErrors = {
|
|
2531
|
+
/**
|
|
2532
|
+
* Default Response
|
|
2533
|
+
*/
|
|
2534
|
+
404: {
|
|
2535
|
+
success: boolean;
|
|
2536
|
+
message: string;
|
|
2537
|
+
};
|
|
2538
|
+
/**
|
|
2539
|
+
* Default Response
|
|
2540
|
+
*/
|
|
2541
|
+
409: {
|
|
2542
|
+
success: boolean;
|
|
2543
|
+
message: string;
|
|
2544
|
+
};
|
|
2545
|
+
/**
|
|
2546
|
+
* Default Response
|
|
2547
|
+
*/
|
|
2548
|
+
503: {
|
|
2549
|
+
success: boolean;
|
|
2550
|
+
message: string;
|
|
2551
|
+
};
|
|
2552
|
+
};
|
|
2553
|
+
type PatchV1PostsScheduledByPostIdError = PatchV1PostsScheduledByPostIdErrors[keyof PatchV1PostsScheduledByPostIdErrors];
|
|
2554
|
+
type PatchV1PostsScheduledByPostIdResponses = {
|
|
2555
|
+
/**
|
|
2556
|
+
* Default Response
|
|
2557
|
+
*/
|
|
2558
|
+
200: {
|
|
2559
|
+
success: boolean;
|
|
2560
|
+
message: string;
|
|
2561
|
+
scheduledFor: string;
|
|
2562
|
+
};
|
|
2563
|
+
};
|
|
2564
|
+
type PatchV1PostsScheduledByPostIdResponse = PatchV1PostsScheduledByPostIdResponses[keyof PatchV1PostsScheduledByPostIdResponses];
|
|
2565
|
+
type PostV1MediaUploadData = {
|
|
2566
|
+
body: {
|
|
2567
|
+
filename: string;
|
|
2568
|
+
mimeType: string;
|
|
2569
|
+
};
|
|
2570
|
+
path?: never;
|
|
2571
|
+
query?: never;
|
|
2572
|
+
url: '/v1/media/upload';
|
|
2573
|
+
};
|
|
2574
|
+
type PostV1MediaUploadErrors = {
|
|
2575
|
+
/**
|
|
2576
|
+
* Default Response
|
|
2577
|
+
*/
|
|
2578
|
+
400: {
|
|
2579
|
+
success: boolean;
|
|
2580
|
+
message: string;
|
|
2581
|
+
};
|
|
2582
|
+
};
|
|
2583
|
+
type PostV1MediaUploadError = PostV1MediaUploadErrors[keyof PostV1MediaUploadErrors];
|
|
2584
|
+
type PostV1MediaUploadResponses = {
|
|
2585
|
+
/**
|
|
2586
|
+
* Default Response
|
|
2587
|
+
*/
|
|
2588
|
+
200: {
|
|
2589
|
+
success: boolean;
|
|
2590
|
+
data: {
|
|
2591
|
+
uploadUrl: string;
|
|
2592
|
+
publicUrl: string;
|
|
2593
|
+
};
|
|
2594
|
+
};
|
|
2595
|
+
};
|
|
2596
|
+
type PostV1MediaUploadResponse = PostV1MediaUploadResponses[keyof PostV1MediaUploadResponses];
|
|
2597
|
+
type GetV1AnalyticsData = {
|
|
2598
|
+
body?: never;
|
|
2599
|
+
path?: never;
|
|
2600
|
+
query?: {
|
|
2601
|
+
/**
|
|
2602
|
+
* PostPeer post ID or external platform post ID (auto-resolved). When omitted, returns a paginated list of all published posts with analytics.
|
|
2603
|
+
*/
|
|
2604
|
+
postId?: string;
|
|
2605
|
+
platform?: Platform;
|
|
2606
|
+
/**
|
|
2607
|
+
* Integration ID. Required for external ID lookups and source=platform.
|
|
2608
|
+
*/
|
|
2609
|
+
accountId?: string;
|
|
2610
|
+
/**
|
|
2611
|
+
* Where the result came from. "postpeer" = posts published via PostPeer (stored in our DB). "platform" = fetched directly from the connected platform account.
|
|
2612
|
+
*/
|
|
2613
|
+
source?: 'postpeer' | 'platform';
|
|
2614
|
+
/**
|
|
2615
|
+
* Inclusive start date (YYYY-MM-DD). Defaults to 90 days ago.
|
|
2616
|
+
*/
|
|
2617
|
+
fromDate?: string;
|
|
2618
|
+
/**
|
|
2619
|
+
* Inclusive end date (YYYY-MM-DD). Defaults to today.
|
|
2620
|
+
*/
|
|
2621
|
+
toDate?: string;
|
|
2622
|
+
/**
|
|
2623
|
+
* Sort results by this metric
|
|
2624
|
+
*/
|
|
2625
|
+
sortBy?: 'date' | 'likes' | 'comments' | 'impressions' | 'views' | 'shares' | 'saves' | 'clicks' | 'engagement';
|
|
2626
|
+
order?: SortOrder;
|
|
2627
|
+
/**
|
|
2628
|
+
* Page size (1-100)
|
|
2629
|
+
*/
|
|
2630
|
+
limit?: number;
|
|
2631
|
+
/**
|
|
2632
|
+
* Page number
|
|
2633
|
+
*/
|
|
2634
|
+
page?: number;
|
|
2635
|
+
};
|
|
2636
|
+
url: '/v1/analytics/';
|
|
2637
|
+
};
|
|
2638
|
+
type GetV1AnalyticsErrors = {
|
|
2639
|
+
/**
|
|
2640
|
+
* Default Response
|
|
2641
|
+
*/
|
|
2642
|
+
400: {
|
|
2643
|
+
success: boolean;
|
|
2644
|
+
message: string;
|
|
2645
|
+
};
|
|
2646
|
+
/**
|
|
2647
|
+
* Default Response
|
|
2648
|
+
*/
|
|
2649
|
+
402: {
|
|
2650
|
+
success: boolean;
|
|
2651
|
+
message: string;
|
|
2652
|
+
};
|
|
2653
|
+
/**
|
|
2654
|
+
* Default Response
|
|
2655
|
+
*/
|
|
2656
|
+
404: {
|
|
2657
|
+
success: boolean;
|
|
2658
|
+
message: string;
|
|
2659
|
+
};
|
|
2660
|
+
};
|
|
2661
|
+
type GetV1AnalyticsError = GetV1AnalyticsErrors[keyof GetV1AnalyticsErrors];
|
|
2662
|
+
type GetV1AnalyticsResponses = {
|
|
2663
|
+
/**
|
|
2664
|
+
* Single-post response (when postId is supplied) or paginated list response.
|
|
2665
|
+
*/
|
|
2666
|
+
200: {
|
|
2667
|
+
success: boolean;
|
|
2668
|
+
post: {
|
|
2669
|
+
/**
|
|
2670
|
+
* Where the result came from. "postpeer" = posts published via PostPeer (stored in our DB). "platform" = fetched directly from the connected platform account.
|
|
2671
|
+
*/
|
|
2672
|
+
source: 'postpeer' | 'platform';
|
|
2673
|
+
/**
|
|
2674
|
+
* PostPeer post ID. null when source=platform (post fetched directly from the platform).
|
|
2675
|
+
*/
|
|
2676
|
+
postId: string | null;
|
|
2677
|
+
content: string | null;
|
|
2678
|
+
publishedAt: string | null;
|
|
2679
|
+
aggregated: {
|
|
2680
|
+
impressions: number | null;
|
|
2681
|
+
reach: number | null;
|
|
2682
|
+
likes: number | null;
|
|
2683
|
+
comments: number | null;
|
|
2684
|
+
shares: number | null;
|
|
2685
|
+
saves: number | null;
|
|
2686
|
+
clicks: number | null;
|
|
2687
|
+
views: number | null;
|
|
2688
|
+
/**
|
|
2689
|
+
* Engagement rate (0-1). null when the platform does not report engagement.
|
|
2690
|
+
*/
|
|
2691
|
+
engagementRate: number | null;
|
|
2692
|
+
};
|
|
2693
|
+
platforms: Array<{
|
|
2694
|
+
platform: Platform;
|
|
2695
|
+
/**
|
|
2696
|
+
* Native post ID on the platform
|
|
2697
|
+
*/
|
|
2698
|
+
platformPostId: string;
|
|
2699
|
+
/**
|
|
2700
|
+
* Direct URL to the published post, if known
|
|
2701
|
+
*/
|
|
2702
|
+
platformPostUrl: string | null;
|
|
2703
|
+
metrics: {
|
|
2704
|
+
impressions: number | null;
|
|
2705
|
+
reach: number | null;
|
|
2706
|
+
likes: number | null;
|
|
2707
|
+
comments: number | null;
|
|
2708
|
+
shares: number | null;
|
|
2709
|
+
saves: number | null;
|
|
2710
|
+
clicks: number | null;
|
|
2711
|
+
views: number | null;
|
|
2712
|
+
/**
|
|
2713
|
+
* Engagement rate (0-1). null when the platform does not report engagement.
|
|
2714
|
+
*/
|
|
2715
|
+
engagementRate: number | null;
|
|
2716
|
+
};
|
|
2717
|
+
}>;
|
|
2718
|
+
};
|
|
2719
|
+
} | {
|
|
2720
|
+
success: boolean;
|
|
2721
|
+
/**
|
|
2722
|
+
* Total matched posts across all pages
|
|
2723
|
+
*/
|
|
2724
|
+
total: number;
|
|
2725
|
+
page: number;
|
|
2726
|
+
limit: number;
|
|
2727
|
+
posts: Array<{
|
|
2728
|
+
/**
|
|
2729
|
+
* Where the result came from. "postpeer" = posts published via PostPeer (stored in our DB). "platform" = fetched directly from the connected platform account.
|
|
2730
|
+
*/
|
|
2731
|
+
source: 'postpeer' | 'platform';
|
|
2732
|
+
/**
|
|
2733
|
+
* PostPeer post ID. null when source=platform (post fetched directly from the platform).
|
|
2734
|
+
*/
|
|
2735
|
+
postId: string | null;
|
|
2736
|
+
content: string | null;
|
|
2737
|
+
publishedAt: string | null;
|
|
2738
|
+
aggregated: {
|
|
2739
|
+
impressions: number | null;
|
|
2740
|
+
reach: number | null;
|
|
2741
|
+
likes: number | null;
|
|
2742
|
+
comments: number | null;
|
|
2743
|
+
shares: number | null;
|
|
2744
|
+
saves: number | null;
|
|
2745
|
+
clicks: number | null;
|
|
2746
|
+
views: number | null;
|
|
2747
|
+
/**
|
|
2748
|
+
* Engagement rate (0-1). null when the platform does not report engagement.
|
|
2749
|
+
*/
|
|
2750
|
+
engagementRate: number | null;
|
|
2751
|
+
};
|
|
2752
|
+
platforms: Array<{
|
|
2753
|
+
platform: Platform;
|
|
2754
|
+
/**
|
|
2755
|
+
* Native post ID on the platform
|
|
2756
|
+
*/
|
|
2757
|
+
platformPostId: string;
|
|
2758
|
+
/**
|
|
2759
|
+
* Direct URL to the published post, if known
|
|
2760
|
+
*/
|
|
2761
|
+
platformPostUrl: string | null;
|
|
2762
|
+
metrics: {
|
|
2763
|
+
impressions: number | null;
|
|
2764
|
+
reach: number | null;
|
|
2765
|
+
likes: number | null;
|
|
2766
|
+
comments: number | null;
|
|
2767
|
+
shares: number | null;
|
|
2768
|
+
saves: number | null;
|
|
2769
|
+
clicks: number | null;
|
|
2770
|
+
views: number | null;
|
|
2771
|
+
/**
|
|
2772
|
+
* Engagement rate (0-1). null when the platform does not report engagement.
|
|
2773
|
+
*/
|
|
2774
|
+
engagementRate: number | null;
|
|
2775
|
+
};
|
|
2776
|
+
}>;
|
|
2777
|
+
}>;
|
|
2778
|
+
};
|
|
2779
|
+
};
|
|
2780
|
+
type GetV1AnalyticsResponse = GetV1AnalyticsResponses[keyof GetV1AnalyticsResponses];
|
|
2781
|
+
type GetV1UsageData = {
|
|
2782
|
+
body?: never;
|
|
2783
|
+
path?: never;
|
|
2784
|
+
query?: {
|
|
2785
|
+
/**
|
|
2786
|
+
* Return usage for this profile only. Mutually exclusive with integrationId.
|
|
2787
|
+
*/
|
|
2788
|
+
profileId?: string;
|
|
2789
|
+
/**
|
|
2790
|
+
* Return usage for this integration only. Mutually exclusive with profileId.
|
|
2791
|
+
*/
|
|
2792
|
+
integrationId?: string;
|
|
2793
|
+
/**
|
|
2794
|
+
* Inclusive start month (YYYY-MM). Filters the usage history array.
|
|
2795
|
+
*/
|
|
2796
|
+
from?: string;
|
|
2797
|
+
/**
|
|
2798
|
+
* Inclusive end month (YYYY-MM). Filters the usage history array.
|
|
2799
|
+
*/
|
|
2800
|
+
to?: string;
|
|
2801
|
+
};
|
|
2802
|
+
url: '/v1/usage/';
|
|
2803
|
+
};
|
|
2804
|
+
type GetV1UsageErrors = {
|
|
2805
|
+
/**
|
|
2806
|
+
* Default Response
|
|
2807
|
+
*/
|
|
2808
|
+
400: {
|
|
2809
|
+
success: boolean;
|
|
2810
|
+
message: string;
|
|
2811
|
+
};
|
|
2812
|
+
/**
|
|
2813
|
+
* Default Response
|
|
2814
|
+
*/
|
|
2815
|
+
404: {
|
|
2816
|
+
success: boolean;
|
|
2817
|
+
message: string;
|
|
2818
|
+
};
|
|
2819
|
+
};
|
|
2820
|
+
type GetV1UsageError = GetV1UsageErrors[keyof GetV1UsageErrors];
|
|
2821
|
+
type GetV1UsageResponses = {
|
|
2822
|
+
/**
|
|
2823
|
+
* Default Response
|
|
2824
|
+
*/
|
|
2825
|
+
200: {
|
|
2826
|
+
success: boolean;
|
|
2827
|
+
/**
|
|
2828
|
+
* All-time credits used
|
|
2829
|
+
*/
|
|
2830
|
+
totalUsage: number;
|
|
2831
|
+
/**
|
|
2832
|
+
* Monthly credit history, oldest first
|
|
2833
|
+
*/
|
|
2834
|
+
usage: Array<{
|
|
2835
|
+
/**
|
|
2836
|
+
* Calendar year
|
|
2837
|
+
*/
|
|
2838
|
+
year: number;
|
|
2839
|
+
/**
|
|
2840
|
+
* Calendar month (1–12)
|
|
2841
|
+
*/
|
|
2842
|
+
month: number;
|
|
2843
|
+
/**
|
|
2844
|
+
* Credits used this month
|
|
2845
|
+
*/
|
|
2846
|
+
count: number;
|
|
2847
|
+
/**
|
|
2848
|
+
* Credits broken down by platform name
|
|
2849
|
+
*/
|
|
2850
|
+
platform: {
|
|
2851
|
+
[key: string]: number;
|
|
2852
|
+
};
|
|
2853
|
+
}>;
|
|
2854
|
+
/**
|
|
2855
|
+
* Current credit balance. Only present on project-level requests (no profileId or integrationId filter).
|
|
2856
|
+
*/
|
|
2857
|
+
balance?: {
|
|
2858
|
+
monthly: {
|
|
2859
|
+
/**
|
|
2860
|
+
* Total monthly credits included in your plan
|
|
2861
|
+
*/
|
|
2862
|
+
limit: number;
|
|
2863
|
+
/**
|
|
2864
|
+
* Monthly credits used so far this billing cycle
|
|
2865
|
+
*/
|
|
2866
|
+
used: number;
|
|
2867
|
+
/**
|
|
2868
|
+
* Monthly credits still available this cycle
|
|
2869
|
+
*/
|
|
2870
|
+
remaining: number;
|
|
2871
|
+
/**
|
|
2872
|
+
* Start of the current billing cycle
|
|
2873
|
+
*/
|
|
2874
|
+
cycleStart: string;
|
|
2875
|
+
/**
|
|
2876
|
+
* End of the current billing cycle — resets here
|
|
2877
|
+
*/
|
|
2878
|
+
cycleEnd: string;
|
|
2879
|
+
};
|
|
2880
|
+
purchased: {
|
|
2881
|
+
/**
|
|
2882
|
+
* Total one-time credits purchased (never expire)
|
|
2883
|
+
*/
|
|
2884
|
+
total: number;
|
|
2885
|
+
/**
|
|
2886
|
+
* One-time credits consumed so far
|
|
2887
|
+
*/
|
|
2888
|
+
used: number;
|
|
2889
|
+
/**
|
|
2890
|
+
* One-time credits still available
|
|
2891
|
+
*/
|
|
2892
|
+
remaining: number;
|
|
2893
|
+
};
|
|
2894
|
+
};
|
|
2895
|
+
};
|
|
2896
|
+
};
|
|
2897
|
+
type GetV1UsageResponse = GetV1UsageResponses[keyof GetV1UsageResponses];
|
|
2898
|
+
type GetV1PinterestBoardsData = {
|
|
2899
|
+
body?: never;
|
|
2900
|
+
path?: never;
|
|
2901
|
+
query?: {
|
|
2902
|
+
/**
|
|
2903
|
+
* Integration ID of the Pinterest account. If omitted, uses the first connected Pinterest account.
|
|
2904
|
+
*/
|
|
2905
|
+
accountId?: string;
|
|
2906
|
+
};
|
|
2907
|
+
url: '/v1/pinterest/boards';
|
|
2908
|
+
};
|
|
2909
|
+
type GetV1PinterestBoardsErrors = {
|
|
2910
|
+
/**
|
|
2911
|
+
* Default Response
|
|
2912
|
+
*/
|
|
2913
|
+
404: {
|
|
2914
|
+
error: string;
|
|
2915
|
+
};
|
|
2916
|
+
/**
|
|
2917
|
+
* Default Response
|
|
2918
|
+
*/
|
|
2919
|
+
502: {
|
|
2920
|
+
error: string;
|
|
2921
|
+
};
|
|
2922
|
+
};
|
|
2923
|
+
type GetV1PinterestBoardsError = GetV1PinterestBoardsErrors[keyof GetV1PinterestBoardsErrors];
|
|
2924
|
+
type GetV1PinterestBoardsResponses = {
|
|
2925
|
+
/**
|
|
2926
|
+
* Default Response
|
|
2927
|
+
*/
|
|
2928
|
+
200: {
|
|
2929
|
+
success: boolean;
|
|
2930
|
+
boards: Array<{
|
|
2931
|
+
id: string;
|
|
2932
|
+
name: string;
|
|
2933
|
+
description: string | null;
|
|
2934
|
+
privacy: string;
|
|
2935
|
+
}>;
|
|
2936
|
+
};
|
|
2937
|
+
};
|
|
2938
|
+
type GetV1PinterestBoardsResponse = GetV1PinterestBoardsResponses[keyof GetV1PinterestBoardsResponses];
|
|
2939
|
+
type GetV1TiktokCreatorInfoData = {
|
|
2940
|
+
body?: never;
|
|
2941
|
+
path?: never;
|
|
2942
|
+
query?: {
|
|
2943
|
+
/**
|
|
2944
|
+
* Integration ID of the TikTok account. If omitted, uses the first connected TikTok account.
|
|
2945
|
+
*/
|
|
2946
|
+
accountId?: string;
|
|
2947
|
+
};
|
|
2948
|
+
url: '/v1/tiktok/creator-info';
|
|
2949
|
+
};
|
|
2950
|
+
type GetV1TiktokCreatorInfoErrors = {
|
|
2951
|
+
/**
|
|
2952
|
+
* Default Response
|
|
2953
|
+
*/
|
|
2954
|
+
404: {
|
|
2955
|
+
error: string;
|
|
2956
|
+
};
|
|
2957
|
+
/**
|
|
2958
|
+
* Default Response
|
|
2959
|
+
*/
|
|
2960
|
+
502: {
|
|
2961
|
+
error: string;
|
|
2962
|
+
};
|
|
2963
|
+
};
|
|
2964
|
+
type GetV1TiktokCreatorInfoError = GetV1TiktokCreatorInfoErrors[keyof GetV1TiktokCreatorInfoErrors];
|
|
2965
|
+
type GetV1TiktokCreatorInfoResponses = {
|
|
2966
|
+
/**
|
|
2967
|
+
* Default Response
|
|
2968
|
+
*/
|
|
2969
|
+
200: {
|
|
2970
|
+
success: boolean;
|
|
2971
|
+
data?: {
|
|
2972
|
+
/**
|
|
2973
|
+
* Profile avatar URL returned by TikTok.
|
|
2974
|
+
*/
|
|
2975
|
+
creatorAvatarUrl: string | unknown;
|
|
2976
|
+
/**
|
|
2977
|
+
* Username (@handle) of the creator.
|
|
2978
|
+
*/
|
|
2979
|
+
creatorUsername: string | unknown;
|
|
2980
|
+
/**
|
|
2981
|
+
* Display name of the creator.
|
|
2982
|
+
*/
|
|
2983
|
+
creatorNickname: string | unknown;
|
|
2984
|
+
/**
|
|
2985
|
+
* Privacy levels available to this creator. Your UX must restrict the privacy dropdown to these values.
|
|
2986
|
+
*/
|
|
2987
|
+
privacyLevelOptions: Array<'PUBLIC_TO_EVERYONE' | 'MUTUAL_FOLLOW_FRIENDS' | 'FOLLOWER_OF_CREATOR' | 'SELF_ONLY'>;
|
|
2988
|
+
/**
|
|
2989
|
+
* If true, the creator has disabled comments in their app settings — grey out the Allow Comment toggle.
|
|
2990
|
+
*/
|
|
2991
|
+
commentDisabled: boolean;
|
|
2992
|
+
/**
|
|
2993
|
+
* If true, the creator has disabled duet in their app settings — grey out the Allow Duet toggle.
|
|
2994
|
+
*/
|
|
2995
|
+
duetDisabled: boolean;
|
|
2996
|
+
/**
|
|
2997
|
+
* If true, the creator has disabled stitch in their app settings — grey out the Allow Stitch toggle.
|
|
2998
|
+
*/
|
|
2999
|
+
stitchDisabled: boolean;
|
|
3000
|
+
/**
|
|
3001
|
+
* Maximum video duration (in seconds) this creator may post. Reject videos longer than this before upload.
|
|
3002
|
+
*/
|
|
3003
|
+
maxVideoPostDurationSec: number;
|
|
3004
|
+
};
|
|
3005
|
+
error?: string;
|
|
3006
|
+
};
|
|
3007
|
+
};
|
|
3008
|
+
type GetV1TiktokCreatorInfoResponse = GetV1TiktokCreatorInfoResponses[keyof GetV1TiktokCreatorInfoResponses];
|
|
3009
|
+
type PostV1AiWriteData = {
|
|
3010
|
+
body: {
|
|
3011
|
+
/**
|
|
3012
|
+
* Free-form description of what the post should be about, in the creator's own words.
|
|
3013
|
+
*/
|
|
3014
|
+
description: string;
|
|
3015
|
+
/**
|
|
3016
|
+
* Platforms this post will target. Used to fit the strictest character limit.
|
|
3017
|
+
*/
|
|
3018
|
+
platforms?: Array<'twitter' | 'instagram' | 'youtube' | 'tiktok' | 'pinterest' | 'linkedin' | 'bluesky' | 'facebook' | 'threads' | 'googlebusiness'>;
|
|
3019
|
+
/**
|
|
3020
|
+
* Optional existing draft to rewrite/improve rather than start from scratch.
|
|
3021
|
+
*/
|
|
3022
|
+
existingContent?: string;
|
|
3023
|
+
};
|
|
3024
|
+
path?: never;
|
|
3025
|
+
query?: never;
|
|
3026
|
+
url: '/v1/ai/write';
|
|
3027
|
+
};
|
|
3028
|
+
type PostV1AiWriteErrors = {
|
|
3029
|
+
/**
|
|
3030
|
+
* Default Response
|
|
3031
|
+
*/
|
|
3032
|
+
402: {
|
|
3033
|
+
success: boolean;
|
|
3034
|
+
message: string;
|
|
3035
|
+
};
|
|
3036
|
+
/**
|
|
3037
|
+
* Default Response
|
|
3038
|
+
*/
|
|
3039
|
+
500: {
|
|
3040
|
+
success: boolean;
|
|
3041
|
+
message: string;
|
|
3042
|
+
};
|
|
3043
|
+
/**
|
|
3044
|
+
* Default Response
|
|
3045
|
+
*/
|
|
3046
|
+
503: {
|
|
3047
|
+
success: boolean;
|
|
3048
|
+
message: string;
|
|
3049
|
+
};
|
|
3050
|
+
};
|
|
3051
|
+
type PostV1AiWriteError = PostV1AiWriteErrors[keyof PostV1AiWriteErrors];
|
|
3052
|
+
type PostV1AiWriteResponses = {
|
|
3053
|
+
/**
|
|
3054
|
+
* Default Response
|
|
3055
|
+
*/
|
|
3056
|
+
200: {
|
|
3057
|
+
success: boolean;
|
|
3058
|
+
content: string;
|
|
3059
|
+
creditsCharged: number;
|
|
3060
|
+
};
|
|
3061
|
+
};
|
|
3062
|
+
type PostV1AiWriteResponse = PostV1AiWriteResponses[keyof PostV1AiWriteResponses];
|
|
3063
|
+
type PostV1AiImageData = {
|
|
3064
|
+
body: {
|
|
3065
|
+
description: string;
|
|
3066
|
+
/**
|
|
3067
|
+
* Output aspect ratio. Defaults to square when omitted.
|
|
3068
|
+
*/
|
|
3069
|
+
aspectRatio?: 'square' | 'vertical' | 'landscape';
|
|
3070
|
+
/**
|
|
3071
|
+
* Visual style preset. Adds style guidance to the prompt. Omit for the model to pick whatever fits the brief.
|
|
3072
|
+
*/
|
|
3073
|
+
style?: 'photo' | 'illustration' | 'minimal' | 'vibrant' | 'cinematic' | '3d-render' | 'retro' | 'hand-drawn';
|
|
3074
|
+
/**
|
|
3075
|
+
* Reference images. Used as style/vibe inspiration ONLY. The model will not copy them. Useful for "match my brand look" or "same composition as this".
|
|
3076
|
+
*/
|
|
3077
|
+
referenceImageUrls?: Array<string>;
|
|
3078
|
+
/**
|
|
3079
|
+
* Asset images that MUST appear in the generated image (e.g. a brand logo, a specific product photo). The model will place them faithfully according to the brief, without redrawing them.
|
|
3080
|
+
*/
|
|
3081
|
+
assetImageUrls?: Array<string>;
|
|
3082
|
+
/**
|
|
3083
|
+
* DEPRECATED: use referenceImageUrls instead. Still accepted for backwards compatibility.
|
|
3084
|
+
*/
|
|
3085
|
+
referenceImageUrl?: string;
|
|
3086
|
+
};
|
|
3087
|
+
path?: never;
|
|
3088
|
+
query?: never;
|
|
3089
|
+
url: '/v1/ai/image';
|
|
3090
|
+
};
|
|
3091
|
+
type PostV1AiImageErrors = {
|
|
3092
|
+
/**
|
|
3093
|
+
* Default Response
|
|
3094
|
+
*/
|
|
3095
|
+
402: {
|
|
3096
|
+
success: boolean;
|
|
3097
|
+
message: string;
|
|
3098
|
+
};
|
|
3099
|
+
/**
|
|
3100
|
+
* Default Response
|
|
3101
|
+
*/
|
|
3102
|
+
500: {
|
|
3103
|
+
success: boolean;
|
|
3104
|
+
message: string;
|
|
3105
|
+
};
|
|
3106
|
+
/**
|
|
3107
|
+
* Default Response
|
|
3108
|
+
*/
|
|
3109
|
+
503: {
|
|
3110
|
+
success: boolean;
|
|
3111
|
+
message: string;
|
|
3112
|
+
};
|
|
3113
|
+
};
|
|
3114
|
+
type PostV1AiImageError = PostV1AiImageErrors[keyof PostV1AiImageErrors];
|
|
3115
|
+
type PostV1AiImageResponses = {
|
|
3116
|
+
/**
|
|
3117
|
+
* Default Response
|
|
3118
|
+
*/
|
|
3119
|
+
200: {
|
|
3120
|
+
success: boolean;
|
|
3121
|
+
url: string;
|
|
3122
|
+
mimeType: string;
|
|
3123
|
+
creditsCharged: number;
|
|
3124
|
+
};
|
|
3125
|
+
};
|
|
3126
|
+
type PostV1AiImageResponse = PostV1AiImageResponses[keyof PostV1AiImageResponses];
|
|
3127
|
+
|
|
3128
|
+
type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options$1<TData, ThrowOnError, TResponse> & {
|
|
3129
|
+
/**
|
|
3130
|
+
* You can provide a client instance returned by `createClient()` instead of
|
|
3131
|
+
* individual options. This might be also useful if you want to implement a
|
|
3132
|
+
* custom client.
|
|
3133
|
+
*/
|
|
3134
|
+
client?: Client;
|
|
3135
|
+
/**
|
|
3136
|
+
* You can pass arbitrary values through the `meta` object. This can be
|
|
3137
|
+
* used to access values that aren't defined as part of the SDK function.
|
|
3138
|
+
*/
|
|
3139
|
+
meta?: keyof ClientMeta extends never ? Record<string, unknown> : ClientMeta;
|
|
3140
|
+
};
|
|
3141
|
+
declare class HeyApiClient {
|
|
3142
|
+
protected client: Client;
|
|
3143
|
+
constructor(args?: {
|
|
3144
|
+
client?: Client;
|
|
3145
|
+
});
|
|
3146
|
+
}
|
|
3147
|
+
declare class HeyApiRegistry<T> {
|
|
3148
|
+
private readonly defaultKey;
|
|
3149
|
+
private readonly instances;
|
|
3150
|
+
get(key?: string): T;
|
|
3151
|
+
set(value: T, key?: string): void;
|
|
3152
|
+
}
|
|
3153
|
+
declare class Health extends HeyApiClient {
|
|
3154
|
+
/**
|
|
3155
|
+
* Health check
|
|
3156
|
+
*/
|
|
3157
|
+
check<ThrowOnError extends boolean = false>(options?: Options<GetV1HealthData, ThrowOnError>): RequestResult<GetV1HealthResponses, unknown, ThrowOnError>;
|
|
3158
|
+
/**
|
|
3159
|
+
* Verify that the provided access key is valid
|
|
3160
|
+
*/
|
|
3161
|
+
verifyAccessKey<ThrowOnError extends boolean = false>(options?: Options<GetV1HealthAuthData, ThrowOnError>): RequestResult<GetV1HealthAuthResponses, unknown, ThrowOnError>;
|
|
3162
|
+
}
|
|
3163
|
+
declare class Linkedin extends HeyApiClient {
|
|
3164
|
+
/**
|
|
3165
|
+
* Get pending LinkedIn account choices for headless mode
|
|
3166
|
+
*
|
|
3167
|
+
* Use only when starting LinkedIn OAuth with headless=true and the callback redirects to your redirectUri with status=selection_required and selectionToken. Returns the personal profile and organization pages available for the user to choose from.
|
|
3168
|
+
*/
|
|
3169
|
+
getSelection<ThrowOnError extends boolean = false>(options: Options<GetV1ConnectLinkedinSelectionByTokenData, ThrowOnError>): RequestResult<GetV1ConnectLinkedinSelectionByTokenResponses, GetV1ConnectLinkedinSelectionByTokenErrors, ThrowOnError>;
|
|
3170
|
+
/**
|
|
3171
|
+
* Save selected LinkedIn accounts for headless mode
|
|
3172
|
+
*
|
|
3173
|
+
* Use only after GET /v1/connect/linkedin/selection/:token in a headless LinkedIn connect flow. Saves the selected personal profile and/or organization pages, then invalidates the one-time selection token.
|
|
3174
|
+
*/
|
|
3175
|
+
submitSelection<ThrowOnError extends boolean = false>(options: Options<PostV1ConnectLinkedinSelectionByTokenData, ThrowOnError>): RequestResult<PostV1ConnectLinkedinSelectionByTokenResponses, PostV1ConnectLinkedinSelectionByTokenErrors, ThrowOnError>;
|
|
3176
|
+
}
|
|
3177
|
+
declare class Integrations extends HeyApiClient {
|
|
3178
|
+
/**
|
|
3179
|
+
* List integrations connected to this project
|
|
3180
|
+
*/
|
|
3181
|
+
list<ThrowOnError extends boolean = false>(options?: Options<GetV1ConnectIntegrationsData, ThrowOnError>): RequestResult<GetV1ConnectIntegrationsResponses, unknown, ThrowOnError>;
|
|
3182
|
+
/**
|
|
3183
|
+
* Disconnect a platform integration
|
|
3184
|
+
*/
|
|
3185
|
+
disconnect<ThrowOnError extends boolean = false>(options: Options<DeleteV1ConnectIntegrationsByIdData, ThrowOnError>): RequestResult<DeleteV1ConnectIntegrationsByIdResponses, DeleteV1ConnectIntegrationsByIdErrors, ThrowOnError>;
|
|
3186
|
+
}
|
|
3187
|
+
declare class Connect extends HeyApiClient {
|
|
3188
|
+
/**
|
|
3189
|
+
* Get OAuth URL for a platform
|
|
3190
|
+
*
|
|
3191
|
+
* Initiates an OAuth connection flow. By default, PostPeer hosts any required account selection UI and then returns the user to redirectUri. For LinkedIn custom account-selection UI, pass headless=true; if selection is required, the callback redirects to redirectUri with status=selection_required, platform=linkedin, and selectionToken.
|
|
3192
|
+
*/
|
|
3193
|
+
getOAuthUrl<ThrowOnError extends boolean = false>(options: Options<GetV1ConnectByPlatformData, ThrowOnError>): RequestResult<GetV1ConnectByPlatformResponses, GetV1ConnectByPlatformErrors, ThrowOnError>;
|
|
3194
|
+
/**
|
|
3195
|
+
* Connect a Bluesky account via app password
|
|
3196
|
+
*
|
|
3197
|
+
* Bluesky has no OAuth redirect. Have the user generate an app password at https://bsky.app/settings/app-passwords, then submit it here.
|
|
3198
|
+
*/
|
|
3199
|
+
bluesky<ThrowOnError extends boolean = false>(options: Options<PostV1ConnectBlueskyAuthData, ThrowOnError>): RequestResult<unknown, PostV1ConnectBlueskyAuthErrors, ThrowOnError>;
|
|
3200
|
+
private _linkedin?;
|
|
3201
|
+
get linkedin(): Linkedin;
|
|
3202
|
+
private _integrations?;
|
|
3203
|
+
get integrations(): Integrations;
|
|
3204
|
+
}
|
|
3205
|
+
declare class Profiles extends HeyApiClient {
|
|
3206
|
+
/**
|
|
3207
|
+
* List profiles for this project
|
|
3208
|
+
*/
|
|
3209
|
+
list<ThrowOnError extends boolean = false>(options?: Options<GetV1ProfilesData, ThrowOnError>): RequestResult<GetV1ProfilesResponses, unknown, ThrowOnError>;
|
|
3210
|
+
/**
|
|
3211
|
+
* Create a profile
|
|
3212
|
+
*
|
|
3213
|
+
* Profiles group integrations under a label. Pass the returned `id` as `profileId` when calling /v1/connect/:platform to bind the resulting integration to this profile.
|
|
3214
|
+
*/
|
|
3215
|
+
create<ThrowOnError extends boolean = false>(options: Options<PostV1ProfilesData, ThrowOnError>): RequestResult<PostV1ProfilesResponses, unknown, ThrowOnError>;
|
|
3216
|
+
/**
|
|
3217
|
+
* Delete a profile
|
|
3218
|
+
*
|
|
3219
|
+
* Soft-deletes the profile. Existing integrations bound to it keep their profileId — they are not orphaned, but listing /v1/profiles will no longer surface this row.
|
|
3220
|
+
*/
|
|
3221
|
+
delete<ThrowOnError extends boolean = false>(options: Options<DeleteV1ProfilesByIdData, ThrowOnError>): RequestResult<DeleteV1ProfilesByIdResponses, DeleteV1ProfilesByIdErrors, ThrowOnError>;
|
|
3222
|
+
/**
|
|
3223
|
+
* Get a single profile
|
|
3224
|
+
*/
|
|
3225
|
+
get<ThrowOnError extends boolean = false>(options: Options<GetV1ProfilesByIdData, ThrowOnError>): RequestResult<GetV1ProfilesByIdResponses, GetV1ProfilesByIdErrors, ThrowOnError>;
|
|
3226
|
+
/**
|
|
3227
|
+
* Update a profile
|
|
3228
|
+
*/
|
|
3229
|
+
update<ThrowOnError extends boolean = false>(options: Options<PatchV1ProfilesByIdData, ThrowOnError>): RequestResult<PatchV1ProfilesByIdResponses, PatchV1ProfilesByIdErrors, ThrowOnError>;
|
|
3230
|
+
}
|
|
3231
|
+
declare class Apps extends HeyApiClient {
|
|
3232
|
+
/**
|
|
3233
|
+
* List registered OAuth apps for this project
|
|
3234
|
+
*/
|
|
3235
|
+
list<ThrowOnError extends boolean = false>(options?: Options<GetV1AppsData, ThrowOnError>): RequestResult<GetV1AppsResponses, unknown, ThrowOnError>;
|
|
3236
|
+
/**
|
|
3237
|
+
* Register your own OAuth app (Bring Your Own Keys)
|
|
3238
|
+
*
|
|
3239
|
+
* Store the client credentials of your own OAuth app for a platform. Pass the returned `id` as `appId` when calling /v1/connect/:platform to connect accounts under it.
|
|
3240
|
+
*/
|
|
3241
|
+
create<ThrowOnError extends boolean = false>(options: Options<PostV1AppsData, ThrowOnError>): RequestResult<PostV1AppsResponses, PostV1AppsErrors, ThrowOnError>;
|
|
3242
|
+
/**
|
|
3243
|
+
* Delete an OAuth app
|
|
3244
|
+
*
|
|
3245
|
+
* Deletes the app. Blocked with 409 while active integrations are still connected under it — those integrations rely on the app for token refresh. Disconnect or reconnect them first.
|
|
3246
|
+
*/
|
|
3247
|
+
delete<ThrowOnError extends boolean = false>(options: Options<DeleteV1AppsByIdData, ThrowOnError>): RequestResult<DeleteV1AppsByIdResponses, DeleteV1AppsByIdErrors, ThrowOnError>;
|
|
3248
|
+
/**
|
|
3249
|
+
* Get a single OAuth app
|
|
3250
|
+
*/
|
|
3251
|
+
get<ThrowOnError extends boolean = false>(options: Options<GetV1AppsByIdData, ThrowOnError>): RequestResult<GetV1AppsByIdResponses, GetV1AppsByIdErrors, ThrowOnError>;
|
|
3252
|
+
/**
|
|
3253
|
+
* Update an OAuth app
|
|
3254
|
+
*
|
|
3255
|
+
* Change the name, image, or rotate the client secret. The clientId and platform are immutable: a refresh token is bound to the clientId that issued it, so changing the app would brick existing integrations — create a new OAuth app and reconnect instead.
|
|
3256
|
+
*/
|
|
3257
|
+
update<ThrowOnError extends boolean = false>(options: Options<PatchV1AppsByIdData, ThrowOnError>): RequestResult<PatchV1AppsByIdResponses, PatchV1AppsByIdErrors, ThrowOnError>;
|
|
3258
|
+
}
|
|
3259
|
+
declare class Notifications extends HeyApiClient {
|
|
3260
|
+
/**
|
|
3261
|
+
* Test a notification destination before saving it
|
|
3262
|
+
*/
|
|
3263
|
+
test<ThrowOnError extends boolean = false>(options: Options<PostV1NotificationsTestData, ThrowOnError>): RequestResult<PostV1NotificationsTestResponses, PostV1NotificationsTestErrors, ThrowOnError>;
|
|
3264
|
+
/**
|
|
3265
|
+
* List notification subscriptions
|
|
3266
|
+
*/
|
|
3267
|
+
list<ThrowOnError extends boolean = false>(options?: Options<GetV1NotificationsData, ThrowOnError>): RequestResult<GetV1NotificationsResponses, unknown, ThrowOnError>;
|
|
3268
|
+
/**
|
|
3269
|
+
* Create a notification subscription
|
|
3270
|
+
*/
|
|
3271
|
+
create<ThrowOnError extends boolean = false>(options: Options<PostV1NotificationsData, ThrowOnError>): RequestResult<PostV1NotificationsResponses, PostV1NotificationsErrors, ThrowOnError>;
|
|
3272
|
+
/**
|
|
3273
|
+
* Delete a notification subscription
|
|
3274
|
+
*/
|
|
3275
|
+
delete<ThrowOnError extends boolean = false>(options: Options<DeleteV1NotificationsByIdData, ThrowOnError>): RequestResult<DeleteV1NotificationsByIdResponses, DeleteV1NotificationsByIdErrors, ThrowOnError>;
|
|
3276
|
+
/**
|
|
3277
|
+
* Get a notification subscription
|
|
3278
|
+
*/
|
|
3279
|
+
get<ThrowOnError extends boolean = false>(options: Options<GetV1NotificationsByIdData, ThrowOnError>): RequestResult<GetV1NotificationsByIdResponses, GetV1NotificationsByIdErrors, ThrowOnError>;
|
|
3280
|
+
/**
|
|
3281
|
+
* Update a notification subscription
|
|
3282
|
+
*/
|
|
3283
|
+
update<ThrowOnError extends boolean = false>(options: Options<PatchV1NotificationsByIdData, ThrowOnError>): RequestResult<PatchV1NotificationsByIdResponses, PatchV1NotificationsByIdErrors, ThrowOnError>;
|
|
3284
|
+
}
|
|
3285
|
+
declare class Platforms extends HeyApiClient {
|
|
3286
|
+
/**
|
|
3287
|
+
* List available platforms and their status
|
|
3288
|
+
*/
|
|
3289
|
+
list<ThrowOnError extends boolean = false>(options?: Options<GetV1PlatformsData, ThrowOnError>): RequestResult<GetV1PlatformsResponses, unknown, ThrowOnError>;
|
|
3290
|
+
}
|
|
3291
|
+
declare class Scheduled extends HeyApiClient {
|
|
3292
|
+
/**
|
|
3293
|
+
* List all scheduled posts
|
|
3294
|
+
*
|
|
3295
|
+
* Returns a paginated list of scheduled posts. Use `limit` + `offset` to page through the results.
|
|
3296
|
+
*/
|
|
3297
|
+
list<ThrowOnError extends boolean = false>(options?: Options<GetV1PostsScheduledData, ThrowOnError>): RequestResult<GetV1PostsScheduledResponses, unknown, ThrowOnError>;
|
|
3298
|
+
/**
|
|
3299
|
+
* Cancel a scheduled post (moves it back to draft)
|
|
3300
|
+
*/
|
|
3301
|
+
cancel<ThrowOnError extends boolean = false>(options: Options<DeleteV1PostsScheduledByPostIdData, ThrowOnError>): RequestResult<DeleteV1PostsScheduledByPostIdResponses, DeleteV1PostsScheduledByPostIdErrors, ThrowOnError>;
|
|
3302
|
+
/**
|
|
3303
|
+
* Reschedule a post to a new time
|
|
3304
|
+
*/
|
|
3305
|
+
reschedule<ThrowOnError extends boolean = false>(options: Options<PatchV1PostsScheduledByPostIdData, ThrowOnError>): RequestResult<PatchV1PostsScheduledByPostIdResponses, PatchV1PostsScheduledByPostIdErrors, ThrowOnError>;
|
|
3306
|
+
}
|
|
3307
|
+
declare class Posts extends HeyApiClient {
|
|
3308
|
+
/**
|
|
3309
|
+
* List all posts for the project
|
|
3310
|
+
*
|
|
3311
|
+
* Returns a paginated list of posts. Filter by status, platform (OR logic), and date ranges. Published posts include platformPostUrl per platform.
|
|
3312
|
+
*/
|
|
3313
|
+
list<ThrowOnError extends boolean = false>(options?: Options<GetV1PostsData, ThrowOnError>): RequestResult<GetV1PostsResponses, GetV1PostsErrors, ThrowOnError>;
|
|
3314
|
+
/**
|
|
3315
|
+
* Publish a post to one or more social media platforms
|
|
3316
|
+
*/
|
|
3317
|
+
create<ThrowOnError extends boolean = false>(options: Options<PostV1PostsData, ThrowOnError>): RequestResult<PostV1PostsResponses, PostV1PostsErrors, ThrowOnError>;
|
|
3318
|
+
/**
|
|
3319
|
+
* Delete a post by ID
|
|
3320
|
+
*/
|
|
3321
|
+
delete<ThrowOnError extends boolean = false>(options: Options<DeleteV1PostsByPostIdData, ThrowOnError>): RequestResult<DeleteV1PostsByPostIdResponses, DeleteV1PostsByPostIdErrors, ThrowOnError>;
|
|
3322
|
+
/**
|
|
3323
|
+
* Get a single post by ID
|
|
3324
|
+
*/
|
|
3325
|
+
get<ThrowOnError extends boolean = false>(options: Options<GetV1PostsByPostIdData, ThrowOnError>): RequestResult<GetV1PostsByPostIdResponses, GetV1PostsByPostIdErrors, ThrowOnError>;
|
|
3326
|
+
private _scheduled?;
|
|
3327
|
+
get scheduled(): Scheduled;
|
|
3328
|
+
}
|
|
3329
|
+
declare class Media extends HeyApiClient {
|
|
3330
|
+
/**
|
|
3331
|
+
* Get a presigned S3 URL to upload a media file
|
|
3332
|
+
*/
|
|
3333
|
+
upload<ThrowOnError extends boolean = false>(options: Options<PostV1MediaUploadData, ThrowOnError>): RequestResult<PostV1MediaUploadResponses, PostV1MediaUploadErrors, ThrowOnError>;
|
|
3334
|
+
}
|
|
3335
|
+
declare class Analytics extends HeyApiClient {
|
|
3336
|
+
/**
|
|
3337
|
+
* Get post analytics
|
|
3338
|
+
*
|
|
3339
|
+
* With postId, returns analytics for a single post. Without postId, returns a paginated list of published posts with analytics. Accepts both PostPeer post IDs and external platform post IDs (auto-resolved). fromDate defaults to 90 days ago if omitted, max range 366 days. Each call costs 1 credit.
|
|
3340
|
+
*/
|
|
3341
|
+
get<ThrowOnError extends boolean = false>(options?: Options<GetV1AnalyticsData, ThrowOnError>): RequestResult<GetV1AnalyticsResponses, GetV1AnalyticsErrors, ThrowOnError>;
|
|
3342
|
+
}
|
|
3343
|
+
declare class Usage extends HeyApiClient {
|
|
3344
|
+
/**
|
|
3345
|
+
* Get credit usage
|
|
3346
|
+
*
|
|
3347
|
+
* Returns credit usage history for the project. Without filters, returns project-level totals. Add `profileId` to scope to a specific profile, or `integrationId` to scope to a specific connected account. Use `from`/`to` (YYYY-MM) to slice the history. Each entry contains the monthly credit count and a per-platform breakdown.
|
|
3348
|
+
*/
|
|
3349
|
+
get<ThrowOnError extends boolean = false>(options?: Options<GetV1UsageData, ThrowOnError>): RequestResult<GetV1UsageResponses, GetV1UsageErrors, ThrowOnError>;
|
|
3350
|
+
}
|
|
3351
|
+
declare class Pinterest extends HeyApiClient {
|
|
3352
|
+
/**
|
|
3353
|
+
* List Pinterest boards for a connected account
|
|
3354
|
+
*/
|
|
3355
|
+
getBoards<ThrowOnError extends boolean = false>(options?: Options<GetV1PinterestBoardsData, ThrowOnError>): RequestResult<GetV1PinterestBoardsResponses, GetV1PinterestBoardsErrors, ThrowOnError>;
|
|
3356
|
+
}
|
|
3357
|
+
declare class Tiktok extends HeyApiClient {
|
|
3358
|
+
/**
|
|
3359
|
+
* Fetch TikTok creator info for a connected account
|
|
3360
|
+
*
|
|
3361
|
+
* Proxies TikTok's /v2/post/publish/creator_info/query/ endpoint. Use the returned `privacyLevelOptions`, `commentDisabled`, `duetDisabled`, `stitchDisabled`, and `maxVideoPostDurationSec` to build a compliant "Post to TikTok" UX.
|
|
3362
|
+
*/
|
|
3363
|
+
getCreatorInfo<ThrowOnError extends boolean = false>(options?: Options<GetV1TiktokCreatorInfoData, ThrowOnError>): RequestResult<GetV1TiktokCreatorInfoResponses, GetV1TiktokCreatorInfoErrors, ThrowOnError>;
|
|
3364
|
+
}
|
|
3365
|
+
declare class Ai extends HeyApiClient {
|
|
3366
|
+
/**
|
|
3367
|
+
* Generate a social media caption from a description
|
|
3368
|
+
*
|
|
3369
|
+
* Generates a caption tailored to the platforms you'll post to. Costs 2 credits per successful generation. Failed calls do not deduct credits.
|
|
3370
|
+
*/
|
|
3371
|
+
write<ThrowOnError extends boolean = false>(options: Options<PostV1AiWriteData, ThrowOnError>): RequestResult<PostV1AiWriteResponses, PostV1AiWriteErrors, ThrowOnError>;
|
|
3372
|
+
/**
|
|
3373
|
+
* Generate a social media image from a description
|
|
3374
|
+
*
|
|
3375
|
+
* Generates a square or vertical image suitable for social media. Costs 10 credits per successful generation. Failed calls do not deduct credits.
|
|
3376
|
+
*/
|
|
3377
|
+
generateImage<ThrowOnError extends boolean = false>(options: Options<PostV1AiImageData, ThrowOnError>): RequestResult<PostV1AiImageResponses, PostV1AiImageErrors, ThrowOnError>;
|
|
3378
|
+
}
|
|
3379
|
+
declare class PostPeerApi extends HeyApiClient {
|
|
3380
|
+
static readonly __registry: HeyApiRegistry<PostPeerApi>;
|
|
3381
|
+
constructor(args?: {
|
|
3382
|
+
client?: Client;
|
|
3383
|
+
key?: string;
|
|
3384
|
+
});
|
|
3385
|
+
private _health?;
|
|
3386
|
+
get health(): Health;
|
|
3387
|
+
private _connect?;
|
|
3388
|
+
get connect(): Connect;
|
|
3389
|
+
private _profiles?;
|
|
3390
|
+
get profiles(): Profiles;
|
|
3391
|
+
private _apps?;
|
|
3392
|
+
get apps(): Apps;
|
|
3393
|
+
private _notifications?;
|
|
3394
|
+
get notifications(): Notifications;
|
|
3395
|
+
private _platforms?;
|
|
3396
|
+
get platforms(): Platforms;
|
|
3397
|
+
private _posts?;
|
|
3398
|
+
get posts(): Posts;
|
|
3399
|
+
private _media?;
|
|
3400
|
+
get media(): Media;
|
|
3401
|
+
private _analytics?;
|
|
3402
|
+
get analytics(): Analytics;
|
|
3403
|
+
private _usage?;
|
|
3404
|
+
get usage(): Usage;
|
|
3405
|
+
private _pinterest?;
|
|
3406
|
+
get pinterest(): Pinterest;
|
|
3407
|
+
private _tiktok?;
|
|
3408
|
+
get tiktok(): Tiktok;
|
|
3409
|
+
private _ai?;
|
|
3410
|
+
get ai(): Ai;
|
|
3411
|
+
}
|
|
3412
|
+
|
|
3413
|
+
interface ClientOptions {
|
|
3414
|
+
/** Defaults to `process.env.POSTPEER_API_KEY`. */
|
|
3415
|
+
apiKey?: string;
|
|
3416
|
+
/** @default "https://api.postpeer.dev" */
|
|
3417
|
+
baseURL?: string;
|
|
3418
|
+
/** Request timeout in milliseconds. @default 60000 */
|
|
3419
|
+
timeout?: number;
|
|
3420
|
+
/** Number of retries for transient failures. @default 2 */
|
|
3421
|
+
maxRetries?: number;
|
|
3422
|
+
defaultHeaders?: HeadersInit;
|
|
3423
|
+
fetch?: typeof globalThis.fetch;
|
|
3424
|
+
}
|
|
3425
|
+
/** The official Node.js client for the PostPeer API. */
|
|
3426
|
+
declare class PostPeer extends PostPeerApi {
|
|
3427
|
+
#private;
|
|
3428
|
+
static readonly DEFAULT_TIMEOUT = 60000;
|
|
3429
|
+
static readonly DEFAULT_MAX_RETRIES = 2;
|
|
3430
|
+
readonly apiKey: string;
|
|
3431
|
+
readonly baseURL: string;
|
|
3432
|
+
readonly timeout: number;
|
|
3433
|
+
readonly maxRetries: number;
|
|
3434
|
+
readonly rawClient: Client;
|
|
3435
|
+
constructor(options?: ClientOptions);
|
|
3436
|
+
withOptions(options: Partial<ClientOptions>): PostPeer;
|
|
3437
|
+
}
|
|
3438
|
+
|
|
3439
|
+
declare class PostPeerError extends Error {
|
|
3440
|
+
constructor(message: string, options?: ErrorOptions);
|
|
3441
|
+
}
|
|
3442
|
+
declare class APIError extends PostPeerError {
|
|
3443
|
+
readonly status: number;
|
|
3444
|
+
readonly code?: string;
|
|
3445
|
+
readonly details?: unknown;
|
|
3446
|
+
readonly requestId?: string;
|
|
3447
|
+
readonly headers: Headers;
|
|
3448
|
+
constructor(status: number, message: string, options?: {
|
|
3449
|
+
code?: string;
|
|
3450
|
+
details?: unknown;
|
|
3451
|
+
headers?: Headers;
|
|
3452
|
+
requestId?: string;
|
|
3453
|
+
cause?: unknown;
|
|
3454
|
+
});
|
|
3455
|
+
}
|
|
3456
|
+
declare class BadRequestError extends APIError {
|
|
3457
|
+
}
|
|
3458
|
+
declare class AuthenticationError extends APIError {
|
|
3459
|
+
}
|
|
3460
|
+
declare class PermissionDeniedError extends APIError {
|
|
3461
|
+
}
|
|
3462
|
+
declare class NotFoundError extends APIError {
|
|
3463
|
+
}
|
|
3464
|
+
declare class ConflictError extends APIError {
|
|
3465
|
+
}
|
|
3466
|
+
declare class UnprocessableEntityError extends APIError {
|
|
3467
|
+
}
|
|
3468
|
+
declare class RateLimitError extends APIError {
|
|
3469
|
+
}
|
|
3470
|
+
declare class InternalServerError extends APIError {
|
|
3471
|
+
}
|
|
3472
|
+
declare class APIConnectionError extends PostPeerError {
|
|
3473
|
+
constructor(message?: string, options?: ErrorOptions);
|
|
3474
|
+
}
|
|
3475
|
+
declare class APIConnectionTimeoutError extends APIConnectionError {
|
|
3476
|
+
constructor(options?: ErrorOptions);
|
|
3477
|
+
}
|
|
3478
|
+
declare class APIUserAbortError extends APIConnectionError {
|
|
3479
|
+
constructor(options?: ErrorOptions);
|
|
3480
|
+
}
|
|
3481
|
+
|
|
3482
|
+
declare const VERSION = "0.8.0";
|
|
3483
|
+
|
|
3484
|
+
export { APIConnectionError, APIConnectionTimeoutError, APIError, APIUserAbortError, AuthenticationError, BadRequestError, type BlueskyConfigurations, type ClientOptions, ConflictError, type DeleteV1AppsByIdData, type DeleteV1AppsByIdError, type DeleteV1AppsByIdErrors, type DeleteV1AppsByIdResponse, type DeleteV1AppsByIdResponses, type DeleteV1ConnectIntegrationsByIdData, type DeleteV1ConnectIntegrationsByIdError, type DeleteV1ConnectIntegrationsByIdErrors, type DeleteV1ConnectIntegrationsByIdResponse, type DeleteV1ConnectIntegrationsByIdResponses, type DeleteV1NotificationsByIdData, type DeleteV1NotificationsByIdError, type DeleteV1NotificationsByIdErrors, type DeleteV1NotificationsByIdResponse, type DeleteV1NotificationsByIdResponses, type DeleteV1PostsByPostIdData, type DeleteV1PostsByPostIdError, type DeleteV1PostsByPostIdErrors, type DeleteV1PostsByPostIdResponse, type DeleteV1PostsByPostIdResponses, type DeleteV1PostsScheduledByPostIdData, type DeleteV1PostsScheduledByPostIdError, type DeleteV1PostsScheduledByPostIdErrors, type DeleteV1PostsScheduledByPostIdResponse, type DeleteV1PostsScheduledByPostIdResponses, type DeleteV1ProfilesByIdData, type DeleteV1ProfilesByIdError, type DeleteV1ProfilesByIdErrors, type DeleteV1ProfilesByIdResponse, type DeleteV1ProfilesByIdResponses, type ErrorResponse, type FacebookConfigurations, type GetV1AnalyticsData, type GetV1AnalyticsError, type GetV1AnalyticsErrors, type GetV1AnalyticsResponse, type GetV1AnalyticsResponses, type GetV1AppsByIdData, type GetV1AppsByIdError, type GetV1AppsByIdErrors, type GetV1AppsByIdResponse, type GetV1AppsByIdResponses, type GetV1AppsData, type GetV1AppsResponse, type GetV1AppsResponses, type GetV1ConnectByPlatformData, type GetV1ConnectByPlatformError, type GetV1ConnectByPlatformErrors, type GetV1ConnectByPlatformResponse, type GetV1ConnectByPlatformResponses, type GetV1ConnectIntegrationsData, type GetV1ConnectIntegrationsResponse, type GetV1ConnectIntegrationsResponses, type GetV1ConnectLinkedinSelectionByTokenData, type GetV1ConnectLinkedinSelectionByTokenError, type GetV1ConnectLinkedinSelectionByTokenErrors, type GetV1ConnectLinkedinSelectionByTokenResponse, type GetV1ConnectLinkedinSelectionByTokenResponses, type GetV1HealthAuthData, type GetV1HealthAuthResponse, type GetV1HealthAuthResponses, type GetV1HealthData, type GetV1HealthResponse, type GetV1HealthResponses, type GetV1NotificationsByIdData, type GetV1NotificationsByIdError, type GetV1NotificationsByIdErrors, type GetV1NotificationsByIdResponse, type GetV1NotificationsByIdResponses, type GetV1NotificationsData, type GetV1NotificationsResponse, type GetV1NotificationsResponses, type GetV1PinterestBoardsData, type GetV1PinterestBoardsError, type GetV1PinterestBoardsErrors, type GetV1PinterestBoardsResponse, type GetV1PinterestBoardsResponses, type GetV1PlatformsData, type GetV1PlatformsResponse, type GetV1PlatformsResponses, type GetV1PostsByPostIdData, type GetV1PostsByPostIdError, type GetV1PostsByPostIdErrors, type GetV1PostsByPostIdResponse, type GetV1PostsByPostIdResponses, type GetV1PostsData, type GetV1PostsError, type GetV1PostsErrors, type GetV1PostsResponse, type GetV1PostsResponses, type GetV1PostsScheduledData, type GetV1PostsScheduledResponse, type GetV1PostsScheduledResponses, type GetV1ProfilesByIdData, type GetV1ProfilesByIdError, type GetV1ProfilesByIdErrors, type GetV1ProfilesByIdResponse, type GetV1ProfilesByIdResponses, type GetV1ProfilesData, type GetV1ProfilesResponse, type GetV1ProfilesResponses, type GetV1TiktokCreatorInfoData, type GetV1TiktokCreatorInfoError, type GetV1TiktokCreatorInfoErrors, type GetV1TiktokCreatorInfoResponse, type GetV1TiktokCreatorInfoResponses, type GetV1UsageData, type GetV1UsageError, type GetV1UsageErrors, type GetV1UsageResponse, type GetV1UsageResponses, type GoogleBusinessConfigurations, type InstagramConfigurations, InternalServerError, type LinkedInConfigurations, NotFoundError, type PatchV1AppsByIdData, type PatchV1AppsByIdError, type PatchV1AppsByIdErrors, type PatchV1AppsByIdResponse, type PatchV1AppsByIdResponses, type PatchV1NotificationsByIdData, type PatchV1NotificationsByIdError, type PatchV1NotificationsByIdErrors, type PatchV1NotificationsByIdResponse, type PatchV1NotificationsByIdResponses, type PatchV1PostsScheduledByPostIdData, type PatchV1PostsScheduledByPostIdError, type PatchV1PostsScheduledByPostIdErrors, type PatchV1PostsScheduledByPostIdResponse, type PatchV1PostsScheduledByPostIdResponses, type PatchV1ProfilesByIdData, type PatchV1ProfilesByIdError, type PatchV1ProfilesByIdErrors, type PatchV1ProfilesByIdResponse, type PatchV1ProfilesByIdResponses, PermissionDeniedError, type PinterestConfigurations, type Platform, type PostPayload, PostPeer, PostPeerError, type PostV1AiImageData, type PostV1AiImageError, type PostV1AiImageErrors, type PostV1AiImageResponse, type PostV1AiImageResponses, type PostV1AiWriteData, type PostV1AiWriteError, type PostV1AiWriteErrors, type PostV1AiWriteResponse, type PostV1AiWriteResponses, type PostV1AppsData, type PostV1AppsError, type PostV1AppsErrors, type PostV1AppsResponse, type PostV1AppsResponses, type PostV1ConnectBlueskyAuthData, type PostV1ConnectBlueskyAuthError, type PostV1ConnectBlueskyAuthErrors, type PostV1ConnectLinkedinSelectionByTokenData, type PostV1ConnectLinkedinSelectionByTokenError, type PostV1ConnectLinkedinSelectionByTokenErrors, type PostV1ConnectLinkedinSelectionByTokenResponse, type PostV1ConnectLinkedinSelectionByTokenResponses, type PostV1MediaUploadData, type PostV1MediaUploadError, type PostV1MediaUploadErrors, type PostV1MediaUploadResponse, type PostV1MediaUploadResponses, type PostV1NotificationsData, type PostV1NotificationsError, type PostV1NotificationsErrors, type PostV1NotificationsResponse, type PostV1NotificationsResponses, type PostV1NotificationsTestData, type PostV1NotificationsTestError, type PostV1NotificationsTestErrors, type PostV1NotificationsTestResponse, type PostV1NotificationsTestResponses, type PostV1PostsData, type PostV1PostsError, type PostV1PostsErrors, type PostV1PostsResponse, type PostV1PostsResponses, type PostV1ProfilesData, type PostV1ProfilesResponse, type PostV1ProfilesResponses, RateLimitError, type SortOrder, type Status, type ThreadsConfigurations, type TikTokConfigurations, type TwitterConfigurations, UnprocessableEntityError, VERSION, type YouTubeConfigurations, PostPeer as default };
|