@curviate/sdk 0.41.0 → 0.42.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 +30 -0
- package/README.md +25 -1
- package/dist/index.d.ts +1362 -28
- package/dist/index.js +175 -3
- package/package.json +1 -1
- package/src/generated/types.ts +1240 -84
package/dist/index.d.ts
CHANGED
|
@@ -90,6 +90,15 @@ interface RequestArgs {
|
|
|
90
90
|
*/
|
|
91
91
|
query?: Record<string, string | number | boolean | string[] | undefined | null>;
|
|
92
92
|
body?: unknown;
|
|
93
|
+
/**
|
|
94
|
+
* A raw (non-JSON) request body with its own `Content-Type`, for the one
|
|
95
|
+
* route that takes a file as the body (`drafts.uploadAttachment`). Mutually
|
|
96
|
+
* exclusive with `body`.
|
|
97
|
+
*/
|
|
98
|
+
rawBody?: {
|
|
99
|
+
data: Blob | ArrayBuffer | Uint8Array;
|
|
100
|
+
contentType: string;
|
|
101
|
+
};
|
|
93
102
|
}
|
|
94
103
|
/** The bound caller a resource receives. */
|
|
95
104
|
type RequestFn = <T = unknown>(args: RequestArgs) => Promise<T>;
|
|
@@ -1575,7 +1584,7 @@ interface paths {
|
|
|
1575
1584
|
put?: never;
|
|
1576
1585
|
/**
|
|
1577
1586
|
* Create a post
|
|
1578
|
-
* @description Publishes a post
|
|
1587
|
+
* @description Publishes a post now; JSON, files as base64. Text is never stored. A publish record (account, post id, time) is kept, listed by GET /v1/drafts?status=published and removed when the post is deleted. To publish later, create a Draft at POST /v1/drafts.
|
|
1579
1588
|
*/
|
|
1580
1589
|
post: operations["postV1AccountIdPosts"];
|
|
1581
1590
|
delete?: never;
|
|
@@ -1696,6 +1705,98 @@ interface paths {
|
|
|
1696
1705
|
patch?: never;
|
|
1697
1706
|
trace?: never;
|
|
1698
1707
|
};
|
|
1708
|
+
"/v1/drafts": {
|
|
1709
|
+
parameters: {
|
|
1710
|
+
query?: never;
|
|
1711
|
+
header?: never;
|
|
1712
|
+
path?: never;
|
|
1713
|
+
cookie?: never;
|
|
1714
|
+
};
|
|
1715
|
+
/**
|
|
1716
|
+
* List drafts
|
|
1717
|
+
* @description Lists your Drafts and, with status=published, publish records (account, post id, time; never Drafts). Filter by status, account (or none) and a [from, to) range on each item's own date.
|
|
1718
|
+
*/
|
|
1719
|
+
get: operations["getV1Drafts"];
|
|
1720
|
+
put?: never;
|
|
1721
|
+
/**
|
|
1722
|
+
* Create a draft
|
|
1723
|
+
* @description Stores an unpublished post until it is published or deleted. Every field is optional, the account too; a Draft has at most one account and can move between yours. Up to 50 Drafts and 2 GiB of media per account, and per no-account. A retry creates a second Draft.
|
|
1724
|
+
*/
|
|
1725
|
+
post: operations["postV1Drafts"];
|
|
1726
|
+
delete?: never;
|
|
1727
|
+
options?: never;
|
|
1728
|
+
head?: never;
|
|
1729
|
+
patch?: never;
|
|
1730
|
+
trace?: never;
|
|
1731
|
+
};
|
|
1732
|
+
"/v1/drafts/{id}": {
|
|
1733
|
+
parameters: {
|
|
1734
|
+
query?: never;
|
|
1735
|
+
header?: never;
|
|
1736
|
+
path?: never;
|
|
1737
|
+
cookie?: never;
|
|
1738
|
+
};
|
|
1739
|
+
/**
|
|
1740
|
+
* Retrieve a draft
|
|
1741
|
+
* @description Returns one Draft, with a fresh signed link (valid 1 hour) for each attachment.
|
|
1742
|
+
*/
|
|
1743
|
+
get: operations["getV1DraftsId"];
|
|
1744
|
+
put?: never;
|
|
1745
|
+
post?: never;
|
|
1746
|
+
/**
|
|
1747
|
+
* Delete a draft
|
|
1748
|
+
* @description Deletes the Draft and its stored media.
|
|
1749
|
+
*/
|
|
1750
|
+
delete: operations["deleteV1DraftsId"];
|
|
1751
|
+
options?: never;
|
|
1752
|
+
head?: never;
|
|
1753
|
+
/**
|
|
1754
|
+
* Update a draft
|
|
1755
|
+
* @description Partial update: an omitted field is left as is, null clears it. attachments replaces the whole list ({id} keeps an existing file, a base64 object adds one, anything left out is deleted). account_id moves the Draft to another of your accounts. Editing a failed Draft clears its failure.
|
|
1756
|
+
*/
|
|
1757
|
+
patch: operations["patchV1DraftsId"];
|
|
1758
|
+
trace?: never;
|
|
1759
|
+
};
|
|
1760
|
+
"/v1/drafts/{id}/publish": {
|
|
1761
|
+
parameters: {
|
|
1762
|
+
query?: never;
|
|
1763
|
+
header?: never;
|
|
1764
|
+
path?: never;
|
|
1765
|
+
cookie?: never;
|
|
1766
|
+
};
|
|
1767
|
+
get?: never;
|
|
1768
|
+
put?: never;
|
|
1769
|
+
/**
|
|
1770
|
+
* Publish a draft now
|
|
1771
|
+
* @description Publishes the Draft now, under the same rules as create post, safety limits included. Success deletes the Draft and its media, writes a publish record and returns the post id, no webhook. Failure leaves the Draft unchanged.
|
|
1772
|
+
*/
|
|
1773
|
+
post: operations["postV1DraftsIdPublish"];
|
|
1774
|
+
delete?: never;
|
|
1775
|
+
options?: never;
|
|
1776
|
+
head?: never;
|
|
1777
|
+
patch?: never;
|
|
1778
|
+
trace?: never;
|
|
1779
|
+
};
|
|
1780
|
+
"/v1/drafts/{id}/attachments": {
|
|
1781
|
+
parameters: {
|
|
1782
|
+
query?: never;
|
|
1783
|
+
header?: never;
|
|
1784
|
+
path?: never;
|
|
1785
|
+
cookie?: never;
|
|
1786
|
+
};
|
|
1787
|
+
get?: never;
|
|
1788
|
+
put?: never;
|
|
1789
|
+
/**
|
|
1790
|
+
* Upload a draft attachment
|
|
1791
|
+
* @description Adds one file to the Draft as the raw request body, for media too large to send inline: a video (MP4, up to 50 MiB), a PDF (up to 50 MiB) or an image. Content-Type is the file's type, Content-Length is required; kept only if it arrives whole. Same media rules as inline.
|
|
1792
|
+
*/
|
|
1793
|
+
post: operations["postV1DraftsIdAttachments"];
|
|
1794
|
+
delete?: never;
|
|
1795
|
+
options?: never;
|
|
1796
|
+
head?: never;
|
|
1797
|
+
patch?: never;
|
|
1798
|
+
trace?: never;
|
|
1799
|
+
};
|
|
1699
1800
|
"/v1/{account_id}/recruiter/profiles/{user_id}": {
|
|
1700
1801
|
parameters: {
|
|
1701
1802
|
query?: never;
|
|
@@ -2611,7 +2712,7 @@ interface paths {
|
|
|
2611
2712
|
put?: never;
|
|
2612
2713
|
/**
|
|
2613
2714
|
* Create a webhook
|
|
2614
|
-
* @description Registers a new webhook endpoint to receive real-time events. Choose a source (messaging / user / account_status) and supply the target URL. The HMAC signing secret is returned exactly once in the 201 response, store it securely.
|
|
2715
|
+
* @description Registers a new webhook endpoint to receive real-time events. Choose a source (messaging / user / account_status / post) and supply the target URL. The HMAC signing secret is returned exactly once in the 201 response, store it securely.
|
|
2615
2716
|
*/
|
|
2616
2717
|
post: operations["postV1Webhooks"];
|
|
2617
2718
|
delete?: never;
|
|
@@ -2629,7 +2730,7 @@ interface paths {
|
|
|
2629
2730
|
};
|
|
2630
2731
|
/**
|
|
2631
2732
|
* List webhook event types
|
|
2632
|
-
* @description Returns the complete canonical event catalogue (
|
|
2733
|
+
* @description Returns the complete canonical event catalogue (29 events) grouped by source: messaging (7), user (2), account_status (15), post (2), plus 3 recruiter/sales_nav events. A local catalogue read: no platform call is made.
|
|
2633
2734
|
*/
|
|
2634
2735
|
get: operations["getV1WebhooksEvents"];
|
|
2635
2736
|
put?: never;
|
|
@@ -19781,7 +19882,752 @@ interface operations {
|
|
|
19781
19882
|
"application/json": components["schemas"]["Error"];
|
|
19782
19883
|
};
|
|
19783
19884
|
};
|
|
19784
|
-
/** @description The account_id does not belong to this tenant (ACCOUNT_NOT_FOUND), or the target post was not found (RESOURCE_NOT_FOUND). An id whose connection was replaced or removed also stops resolving here, and it is already absent from the list, so re-read `GET /v1/accounts` for the current id. */
|
|
19885
|
+
/** @description The account_id does not belong to this tenant (ACCOUNT_NOT_FOUND), or the target post was not found (RESOURCE_NOT_FOUND). An id whose connection was replaced or removed also stops resolving here, and it is already absent from the list, so re-read `GET /v1/accounts` for the current id. */
|
|
19886
|
+
404: {
|
|
19887
|
+
headers: {
|
|
19888
|
+
[name: string]: unknown;
|
|
19889
|
+
};
|
|
19890
|
+
content: {
|
|
19891
|
+
"application/json": components["schemas"]["Error"];
|
|
19892
|
+
};
|
|
19893
|
+
};
|
|
19894
|
+
/** @description Rate limited, slow down and retry after the hinted delay. */
|
|
19895
|
+
429: {
|
|
19896
|
+
headers: {
|
|
19897
|
+
"RateLimit-Policy": components["headers"]["RateLimit-Policy"];
|
|
19898
|
+
RateLimit: components["headers"]["RateLimit"];
|
|
19899
|
+
"Retry-After": components["headers"]["Retry-After"];
|
|
19900
|
+
[name: string]: unknown;
|
|
19901
|
+
};
|
|
19902
|
+
content: {
|
|
19903
|
+
"application/json": components["schemas"]["Error"];
|
|
19904
|
+
};
|
|
19905
|
+
};
|
|
19906
|
+
/** @description Internal error. */
|
|
19907
|
+
500: {
|
|
19908
|
+
headers: {
|
|
19909
|
+
[name: string]: unknown;
|
|
19910
|
+
};
|
|
19911
|
+
content: {
|
|
19912
|
+
"application/json": components["schemas"]["Error"];
|
|
19913
|
+
};
|
|
19914
|
+
};
|
|
19915
|
+
/** @description A temporary upstream error occurred, or the upstream response could not be interpreted. Check `retry_likely_to_succeed`: a temporary error is worth retrying, a response that could not be interpreted is not, and carries `retry_hint: {"kind": "never"}`. */
|
|
19916
|
+
502: {
|
|
19917
|
+
headers: {
|
|
19918
|
+
[name: string]: unknown;
|
|
19919
|
+
};
|
|
19920
|
+
content: {
|
|
19921
|
+
"application/json": components["schemas"]["Error"];
|
|
19922
|
+
};
|
|
19923
|
+
};
|
|
19924
|
+
/** @description Service unavailable. */
|
|
19925
|
+
503: {
|
|
19926
|
+
headers: {
|
|
19927
|
+
[name: string]: unknown;
|
|
19928
|
+
};
|
|
19929
|
+
content: {
|
|
19930
|
+
"application/json": components["schemas"]["Error"];
|
|
19931
|
+
};
|
|
19932
|
+
};
|
|
19933
|
+
/** @description Gateway timeout. */
|
|
19934
|
+
504: {
|
|
19935
|
+
headers: {
|
|
19936
|
+
[name: string]: unknown;
|
|
19937
|
+
};
|
|
19938
|
+
content: {
|
|
19939
|
+
"application/json": components["schemas"]["Error"];
|
|
19940
|
+
};
|
|
19941
|
+
};
|
|
19942
|
+
};
|
|
19943
|
+
};
|
|
19944
|
+
getV1Drafts: {
|
|
19945
|
+
parameters: {
|
|
19946
|
+
query?: {
|
|
19947
|
+
/** @description Comma list of draft, scheduled, failed, published. Default draft,scheduled,failed. published items are publish records, never Drafts. */
|
|
19948
|
+
status?: ("draft" | "scheduled" | "failed" | "published")[];
|
|
19949
|
+
/** @description Only items on this account (acc_...), or none for Drafts with no account. Omitted: all of yours. */
|
|
19950
|
+
account_id?: string;
|
|
19951
|
+
/** @description Only items whose date is at or after this instant (inclusive). */
|
|
19952
|
+
from?: string;
|
|
19953
|
+
/** @description Only items whose date is before this instant (exclusive). */
|
|
19954
|
+
to?: string;
|
|
19955
|
+
/** @description Sort by the item's date: desc (default) or asc. */
|
|
19956
|
+
order?: "desc" | "asc";
|
|
19957
|
+
/** @description Max items per page (1-100, default 20). */
|
|
19958
|
+
limit?: number;
|
|
19959
|
+
/** @description Pagination cursor from a previous response; pass it back verbatim with the same filters. */
|
|
19960
|
+
cursor?: string;
|
|
19961
|
+
};
|
|
19962
|
+
header?: never;
|
|
19963
|
+
path?: never;
|
|
19964
|
+
cookie?: never;
|
|
19965
|
+
};
|
|
19966
|
+
requestBody?: never;
|
|
19967
|
+
responses: {
|
|
19968
|
+
/** @description Drafts and publish records, ordered by each item's own date: scheduled_at for scheduled, failure.failed_at for failed, published_at for published, updated_at for draft. */
|
|
19969
|
+
200: {
|
|
19970
|
+
headers: {
|
|
19971
|
+
"RateLimit-Policy": components["headers"]["RateLimit-Policy"];
|
|
19972
|
+
RateLimit: components["headers"]["RateLimit"];
|
|
19973
|
+
[name: string]: unknown;
|
|
19974
|
+
};
|
|
19975
|
+
content: {
|
|
19976
|
+
"application/json": {
|
|
19977
|
+
/**
|
|
19978
|
+
* @description Response type discriminator.
|
|
19979
|
+
* @enum {string}
|
|
19980
|
+
*/
|
|
19981
|
+
object: "draft_list";
|
|
19982
|
+
/** @description Each item is a draft (object: draft) or a publish record (object: publish_record). Publish records are never Drafts. */
|
|
19983
|
+
items: ({
|
|
19984
|
+
/**
|
|
19985
|
+
* @description Response type discriminator.
|
|
19986
|
+
* @enum {string}
|
|
19987
|
+
*/
|
|
19988
|
+
object: "draft";
|
|
19989
|
+
/** @description Draft id (drf_...). */
|
|
19990
|
+
id: string;
|
|
19991
|
+
/** @description The account this Draft will publish as, or null for none yet. */
|
|
19992
|
+
account_id: string | null;
|
|
19993
|
+
/**
|
|
19994
|
+
* @description Derived: failed if failure is set, else scheduled if scheduled_at is set, else draft.
|
|
19995
|
+
* @enum {string}
|
|
19996
|
+
*/
|
|
19997
|
+
status: "draft" | "scheduled" | "failed";
|
|
19998
|
+
/** @description Post body text. May be empty or null while drafting. */
|
|
19999
|
+
text: string | null;
|
|
20000
|
+
/** @description Media, in post order. */
|
|
20001
|
+
attachments: {
|
|
20002
|
+
/** @description Attachment id (att_...). Send {id} in a PATCH attachments list to keep it. */
|
|
20003
|
+
id: string;
|
|
20004
|
+
/** @description The file's type. */
|
|
20005
|
+
content_type: string;
|
|
20006
|
+
/** @description File name. */
|
|
20007
|
+
filename: string;
|
|
20008
|
+
/** @description Stored size in bytes. */
|
|
20009
|
+
size_bytes: number;
|
|
20010
|
+
/** @description Signed download link to the stored file, valid for 1 hour. Read the Draft again for a fresh one. Null when the stored file is unavailable. */
|
|
20011
|
+
url: string | null;
|
|
20012
|
+
}[];
|
|
20013
|
+
/** @description A post to quote or repost when published. */
|
|
20014
|
+
quoted_post_id?: string | null;
|
|
20015
|
+
/**
|
|
20016
|
+
* @description Who can read the post once published.
|
|
20017
|
+
* @enum {string|null}
|
|
20018
|
+
*/
|
|
20019
|
+
can_read?: "anyone" | "relations_only" | null;
|
|
20020
|
+
/**
|
|
20021
|
+
* @description Who may comment once published.
|
|
20022
|
+
* @enum {string|null}
|
|
20023
|
+
*/
|
|
20024
|
+
can_comment?: "anyone" | "relations_only" | "no_one" | null;
|
|
20025
|
+
/** @description Company page id to post as. */
|
|
20026
|
+
post_as?: string | null;
|
|
20027
|
+
/** @description When Curviate publishes the Draft (UTC, whole minute), or null. It goes out up to 20 seconds after this time. A failed Draft has null here; the time that failed is failure.scheduled_at. */
|
|
20028
|
+
scheduled_at: string | null;
|
|
20029
|
+
/** @description Why the last scheduled publish failed; present on failed Drafts only. */
|
|
20030
|
+
failure: {
|
|
20031
|
+
/**
|
|
20032
|
+
* @description Why it failed. outcome_unknown: the platform gave no usable answer, so the post may be live; check the account's posts before you publish again. missed: Curviate could not start within an hour of the time. platform_error and rate_limited: 3 attempts over about 15 minutes all failed.
|
|
20033
|
+
* @enum {string}
|
|
20034
|
+
*/
|
|
20035
|
+
code?: "platform_error" | "rate_limited" | "account_unavailable" | "media_rejected" | "budget_exhausted" | "outside_activity_window" | "no_active_seat" | "not_publishable" | "platform_rejected" | "missed" | "outcome_unknown";
|
|
20036
|
+
/** @description What went wrong and what to do next. Never contains post text. */
|
|
20037
|
+
message?: string;
|
|
20038
|
+
/** @description When it failed. */
|
|
20039
|
+
failed_at?: string;
|
|
20040
|
+
/** @description The time that failed to publish. */
|
|
20041
|
+
scheduled_at?: string;
|
|
20042
|
+
} | null;
|
|
20043
|
+
/** @description Creation time. */
|
|
20044
|
+
created_at: string;
|
|
20045
|
+
/** @description Last change. */
|
|
20046
|
+
updated_at: string;
|
|
20047
|
+
} | {
|
|
20048
|
+
/**
|
|
20049
|
+
* @description Response type discriminator.
|
|
20050
|
+
* @enum {string}
|
|
20051
|
+
*/
|
|
20052
|
+
object: "publish_record";
|
|
20053
|
+
/** @description The published post's id, or null when the platform returned none. */
|
|
20054
|
+
post_id: string | null;
|
|
20055
|
+
/** @description The account that published it. */
|
|
20056
|
+
account_id: string;
|
|
20057
|
+
/** @description When it was published. */
|
|
20058
|
+
published_at: string;
|
|
20059
|
+
/** @description The Draft it came from, or null for a post created directly. */
|
|
20060
|
+
draft_id: string | null;
|
|
20061
|
+
})[];
|
|
20062
|
+
/** @description Pass back as cursor for the next page; null on the last page. */
|
|
20063
|
+
cursor: string | null;
|
|
20064
|
+
safety_warning?: components["schemas"]["SafetyWarning"];
|
|
20065
|
+
};
|
|
20066
|
+
};
|
|
20067
|
+
};
|
|
20068
|
+
/** @description Invalid filter: an unknown status, a malformed date or cursor, or limit out of range. */
|
|
20069
|
+
400: {
|
|
20070
|
+
headers: {
|
|
20071
|
+
[name: string]: unknown;
|
|
20072
|
+
};
|
|
20073
|
+
content: {
|
|
20074
|
+
"application/json": components["schemas"]["Error"];
|
|
20075
|
+
};
|
|
20076
|
+
};
|
|
20077
|
+
/** @description Missing or invalid API key. */
|
|
20078
|
+
401: {
|
|
20079
|
+
headers: {
|
|
20080
|
+
[name: string]: unknown;
|
|
20081
|
+
};
|
|
20082
|
+
content: {
|
|
20083
|
+
"application/json": components["schemas"]["Error"];
|
|
20084
|
+
};
|
|
20085
|
+
};
|
|
20086
|
+
/** @description Rate limited, slow down and retry after the hinted delay. */
|
|
20087
|
+
429: {
|
|
20088
|
+
headers: {
|
|
20089
|
+
"RateLimit-Policy": components["headers"]["RateLimit-Policy"];
|
|
20090
|
+
RateLimit: components["headers"]["RateLimit"];
|
|
20091
|
+
"Retry-After": components["headers"]["Retry-After"];
|
|
20092
|
+
[name: string]: unknown;
|
|
20093
|
+
};
|
|
20094
|
+
content: {
|
|
20095
|
+
"application/json": components["schemas"]["Error"];
|
|
20096
|
+
};
|
|
20097
|
+
};
|
|
20098
|
+
};
|
|
20099
|
+
};
|
|
20100
|
+
postV1Drafts: {
|
|
20101
|
+
parameters: {
|
|
20102
|
+
query?: never;
|
|
20103
|
+
header?: never;
|
|
20104
|
+
path?: never;
|
|
20105
|
+
cookie?: never;
|
|
20106
|
+
};
|
|
20107
|
+
requestBody: {
|
|
20108
|
+
content: {
|
|
20109
|
+
"application/json": {
|
|
20110
|
+
/** @description The account (acc_...) this Draft will publish as, or null for none yet. A Draft belongs to at most one account. */
|
|
20111
|
+
account_id?: string | null;
|
|
20112
|
+
/** @description When Curviate publishes this Draft: an ISO 8601 date-time with an offset, at least 5 minutes and at most 365 days ahead, stored in UTC truncated to the minute. Scheduling needs an account and text. Curviate publishes it up to 20 seconds after this time, and keeps scheduled posts on one account at least 5 minutes apart. null unschedules. */
|
|
20113
|
+
scheduled_at?: string | null;
|
|
20114
|
+
/** @description Post body text, up to 3000 characters. May be empty while drafting; publishing needs at least one character. */
|
|
20115
|
+
text?: string | null;
|
|
20116
|
+
/** @description A post to quote or repost when published, the same as on create post. Checked at publish time. */
|
|
20117
|
+
quoted_post_id?: string | null;
|
|
20118
|
+
/**
|
|
20119
|
+
* @description Who can read the post once published.
|
|
20120
|
+
* @enum {string|null}
|
|
20121
|
+
*/
|
|
20122
|
+
can_read?: "anyone" | "relations_only" | null;
|
|
20123
|
+
/**
|
|
20124
|
+
* @description Who may comment once published.
|
|
20125
|
+
* @enum {string|null}
|
|
20126
|
+
*/
|
|
20127
|
+
can_comment?: "anyone" | "relations_only" | "no_one" | null;
|
|
20128
|
+
/** @description Company page id to post as; the account must administer it. Checked at publish time. */
|
|
20129
|
+
post_as?: string | null;
|
|
20130
|
+
/** @description Media as base64 objects: up to 20 images, or one MP4 video, or one PDF, never mixed. 5 MiB per file inline. */
|
|
20131
|
+
attachments?: {
|
|
20132
|
+
/** @description Base64-encoded file bytes. */
|
|
20133
|
+
content: string;
|
|
20134
|
+
/** @description The file's type: image/jpeg, image/png, image/gif, image/webp, video/mp4 or application/pdf. */
|
|
20135
|
+
content_type: string;
|
|
20136
|
+
/** @description File name. */
|
|
20137
|
+
filename: string;
|
|
20138
|
+
}[];
|
|
20139
|
+
};
|
|
20140
|
+
};
|
|
20141
|
+
};
|
|
20142
|
+
responses: {
|
|
20143
|
+
/** @description Draft created. With scheduled_at, status is scheduled and Curviate publishes it on its own. With scheduled_at, the response carries safety_warning (reason activity_window) when the time is outside the account's activity window and its posture is warn; under enforce the request is refused instead (429 BUDGET_EXHAUSTED, reason activity_window) and nothing is saved. */
|
|
20144
|
+
201: {
|
|
20145
|
+
headers: {
|
|
20146
|
+
"RateLimit-Policy": components["headers"]["RateLimit-Policy"];
|
|
20147
|
+
RateLimit: components["headers"]["RateLimit"];
|
|
20148
|
+
[name: string]: unknown;
|
|
20149
|
+
};
|
|
20150
|
+
content: {
|
|
20151
|
+
"application/json": {
|
|
20152
|
+
/**
|
|
20153
|
+
* @description Response type discriminator.
|
|
20154
|
+
* @enum {string}
|
|
20155
|
+
*/
|
|
20156
|
+
object: "draft";
|
|
20157
|
+
/** @description Draft id (drf_...). */
|
|
20158
|
+
id: string;
|
|
20159
|
+
/** @description The account this Draft will publish as, or null for none yet. */
|
|
20160
|
+
account_id: string | null;
|
|
20161
|
+
/**
|
|
20162
|
+
* @description Derived: failed if failure is set, else scheduled if scheduled_at is set, else draft.
|
|
20163
|
+
* @enum {string}
|
|
20164
|
+
*/
|
|
20165
|
+
status: "draft" | "scheduled" | "failed";
|
|
20166
|
+
/** @description Post body text. May be empty or null while drafting. */
|
|
20167
|
+
text: string | null;
|
|
20168
|
+
/** @description Media, in post order. */
|
|
20169
|
+
attachments: {
|
|
20170
|
+
/** @description Attachment id (att_...). Send {id} in a PATCH attachments list to keep it. */
|
|
20171
|
+
id: string;
|
|
20172
|
+
/** @description The file's type. */
|
|
20173
|
+
content_type: string;
|
|
20174
|
+
/** @description File name. */
|
|
20175
|
+
filename: string;
|
|
20176
|
+
/** @description Stored size in bytes. */
|
|
20177
|
+
size_bytes: number;
|
|
20178
|
+
/** @description Signed download link to the stored file, valid for 1 hour. Read the Draft again for a fresh one. Null when the stored file is unavailable. */
|
|
20179
|
+
url: string | null;
|
|
20180
|
+
}[];
|
|
20181
|
+
/** @description A post to quote or repost when published. */
|
|
20182
|
+
quoted_post_id?: string | null;
|
|
20183
|
+
/**
|
|
20184
|
+
* @description Who can read the post once published.
|
|
20185
|
+
* @enum {string|null}
|
|
20186
|
+
*/
|
|
20187
|
+
can_read?: "anyone" | "relations_only" | null;
|
|
20188
|
+
/**
|
|
20189
|
+
* @description Who may comment once published.
|
|
20190
|
+
* @enum {string|null}
|
|
20191
|
+
*/
|
|
20192
|
+
can_comment?: "anyone" | "relations_only" | "no_one" | null;
|
|
20193
|
+
/** @description Company page id to post as. */
|
|
20194
|
+
post_as?: string | null;
|
|
20195
|
+
/** @description When Curviate publishes the Draft (UTC, whole minute), or null. It goes out up to 20 seconds after this time. A failed Draft has null here; the time that failed is failure.scheduled_at. */
|
|
20196
|
+
scheduled_at: string | null;
|
|
20197
|
+
/** @description Why the last scheduled publish failed; present on failed Drafts only. */
|
|
20198
|
+
failure: {
|
|
20199
|
+
/**
|
|
20200
|
+
* @description Why it failed. outcome_unknown: the platform gave no usable answer, so the post may be live; check the account's posts before you publish again. missed: Curviate could not start within an hour of the time. platform_error and rate_limited: 3 attempts over about 15 minutes all failed.
|
|
20201
|
+
* @enum {string}
|
|
20202
|
+
*/
|
|
20203
|
+
code?: "platform_error" | "rate_limited" | "account_unavailable" | "media_rejected" | "budget_exhausted" | "outside_activity_window" | "no_active_seat" | "not_publishable" | "platform_rejected" | "missed" | "outcome_unknown";
|
|
20204
|
+
/** @description What went wrong and what to do next. Never contains post text. */
|
|
20205
|
+
message?: string;
|
|
20206
|
+
/** @description When it failed. */
|
|
20207
|
+
failed_at?: string;
|
|
20208
|
+
/** @description The time that failed to publish. */
|
|
20209
|
+
scheduled_at?: string;
|
|
20210
|
+
} | null;
|
|
20211
|
+
/** @description Creation time. */
|
|
20212
|
+
created_at: string;
|
|
20213
|
+
/** @description Last change. */
|
|
20214
|
+
updated_at: string;
|
|
20215
|
+
safety_warning?: components["schemas"]["SafetyWarning"];
|
|
20216
|
+
};
|
|
20217
|
+
};
|
|
20218
|
+
};
|
|
20219
|
+
/** @description Invalid input. Media rules: up to 20 images (JPEG, PNG, GIF, WEBP, at most 6012 x 6012 px), or one MP4 video, or one PDF, never mixed. scheduled_at must be an ISO 8601 date-time with an offset, 5 minutes to 365 days ahead after truncation to the minute. */
|
|
20220
|
+
400: {
|
|
20221
|
+
headers: {
|
|
20222
|
+
[name: string]: unknown;
|
|
20223
|
+
};
|
|
20224
|
+
content: {
|
|
20225
|
+
"application/json": components["schemas"]["Error"];
|
|
20226
|
+
};
|
|
20227
|
+
};
|
|
20228
|
+
/** @description Missing or invalid API key. */
|
|
20229
|
+
401: {
|
|
20230
|
+
headers: {
|
|
20231
|
+
[name: string]: unknown;
|
|
20232
|
+
};
|
|
20233
|
+
content: {
|
|
20234
|
+
"application/json": components["schemas"]["Error"];
|
|
20235
|
+
};
|
|
20236
|
+
};
|
|
20237
|
+
/** @description Forbidden. NO_ACTIVE_SEAT: the account is not attached to an active seat. */
|
|
20238
|
+
403: {
|
|
20239
|
+
headers: {
|
|
20240
|
+
[name: string]: unknown;
|
|
20241
|
+
};
|
|
20242
|
+
content: {
|
|
20243
|
+
"application/json": components["schemas"]["Error"];
|
|
20244
|
+
};
|
|
20245
|
+
};
|
|
20246
|
+
/** @description The account_id is not one of yours (ACCOUNT_NOT_FOUND). */
|
|
20247
|
+
404: {
|
|
20248
|
+
headers: {
|
|
20249
|
+
[name: string]: unknown;
|
|
20250
|
+
};
|
|
20251
|
+
content: {
|
|
20252
|
+
"application/json": components["schemas"]["Error"];
|
|
20253
|
+
};
|
|
20254
|
+
};
|
|
20255
|
+
/** @description The account is disconnected (REAUTH_REQUIRED). Reconnect it, or choose another account. */
|
|
20256
|
+
409: {
|
|
20257
|
+
headers: {
|
|
20258
|
+
[name: string]: unknown;
|
|
20259
|
+
};
|
|
20260
|
+
content: {
|
|
20261
|
+
"application/json": components["schemas"]["Error"];
|
|
20262
|
+
};
|
|
20263
|
+
};
|
|
20264
|
+
/** @description A file is over its size limit: 5 MiB per image, and 5 MiB per file sent inline. */
|
|
20265
|
+
413: {
|
|
20266
|
+
headers: {
|
|
20267
|
+
[name: string]: unknown;
|
|
20268
|
+
};
|
|
20269
|
+
content: {
|
|
20270
|
+
"application/json": components["schemas"]["Error"];
|
|
20271
|
+
};
|
|
20272
|
+
};
|
|
20273
|
+
/** @description DRAFT_LIMIT_REACHED: the bucket (one account, or Drafts with no account) already holds 50 Drafts. MEDIA_QUOTA_EXCEEDED: the media would take the bucket past its 2 GiB quota; nothing is stored. ACCOUNT_REQUIRED / DRAFT_NOT_PUBLISHABLE: scheduling needs an account and text. SCHEDULE_CONFLICT: another scheduled Draft on the account is less than 5 minutes away; the message names it. */
|
|
20274
|
+
422: {
|
|
20275
|
+
headers: {
|
|
20276
|
+
[name: string]: unknown;
|
|
20277
|
+
};
|
|
20278
|
+
content: {
|
|
20279
|
+
"application/json": components["schemas"]["Error"];
|
|
20280
|
+
};
|
|
20281
|
+
};
|
|
20282
|
+
/** @description BUDGET_EXHAUSTED with reason activity_window: the scheduled time is outside the account's activity window and the account enforces it. Nothing is saved. */
|
|
20283
|
+
429: {
|
|
20284
|
+
headers: {
|
|
20285
|
+
"RateLimit-Policy": components["headers"]["RateLimit-Policy"];
|
|
20286
|
+
RateLimit: components["headers"]["RateLimit"];
|
|
20287
|
+
"Retry-After": components["headers"]["Retry-After"];
|
|
20288
|
+
[name: string]: unknown;
|
|
20289
|
+
};
|
|
20290
|
+
content: {
|
|
20291
|
+
"application/json": components["schemas"]["Error"];
|
|
20292
|
+
};
|
|
20293
|
+
};
|
|
20294
|
+
};
|
|
20295
|
+
};
|
|
20296
|
+
getV1DraftsId: {
|
|
20297
|
+
parameters: {
|
|
20298
|
+
query?: never;
|
|
20299
|
+
header?: never;
|
|
20300
|
+
path: {
|
|
20301
|
+
/** @description Draft id (drf_...). */
|
|
20302
|
+
id: string;
|
|
20303
|
+
};
|
|
20304
|
+
cookie?: never;
|
|
20305
|
+
};
|
|
20306
|
+
requestBody?: never;
|
|
20307
|
+
responses: {
|
|
20308
|
+
/** @description The Draft. */
|
|
20309
|
+
200: {
|
|
20310
|
+
headers: {
|
|
20311
|
+
"RateLimit-Policy": components["headers"]["RateLimit-Policy"];
|
|
20312
|
+
RateLimit: components["headers"]["RateLimit"];
|
|
20313
|
+
[name: string]: unknown;
|
|
20314
|
+
};
|
|
20315
|
+
content: {
|
|
20316
|
+
"application/json": {
|
|
20317
|
+
/**
|
|
20318
|
+
* @description Response type discriminator.
|
|
20319
|
+
* @enum {string}
|
|
20320
|
+
*/
|
|
20321
|
+
object: "draft";
|
|
20322
|
+
/** @description Draft id (drf_...). */
|
|
20323
|
+
id: string;
|
|
20324
|
+
/** @description The account this Draft will publish as, or null for none yet. */
|
|
20325
|
+
account_id: string | null;
|
|
20326
|
+
/**
|
|
20327
|
+
* @description Derived: failed if failure is set, else scheduled if scheduled_at is set, else draft.
|
|
20328
|
+
* @enum {string}
|
|
20329
|
+
*/
|
|
20330
|
+
status: "draft" | "scheduled" | "failed";
|
|
20331
|
+
/** @description Post body text. May be empty or null while drafting. */
|
|
20332
|
+
text: string | null;
|
|
20333
|
+
/** @description Media, in post order. */
|
|
20334
|
+
attachments: {
|
|
20335
|
+
/** @description Attachment id (att_...). Send {id} in a PATCH attachments list to keep it. */
|
|
20336
|
+
id: string;
|
|
20337
|
+
/** @description The file's type. */
|
|
20338
|
+
content_type: string;
|
|
20339
|
+
/** @description File name. */
|
|
20340
|
+
filename: string;
|
|
20341
|
+
/** @description Stored size in bytes. */
|
|
20342
|
+
size_bytes: number;
|
|
20343
|
+
/** @description Signed download link to the stored file, valid for 1 hour. Read the Draft again for a fresh one. Null when the stored file is unavailable. */
|
|
20344
|
+
url: string | null;
|
|
20345
|
+
}[];
|
|
20346
|
+
/** @description A post to quote or repost when published. */
|
|
20347
|
+
quoted_post_id?: string | null;
|
|
20348
|
+
/**
|
|
20349
|
+
* @description Who can read the post once published.
|
|
20350
|
+
* @enum {string|null}
|
|
20351
|
+
*/
|
|
20352
|
+
can_read?: "anyone" | "relations_only" | null;
|
|
20353
|
+
/**
|
|
20354
|
+
* @description Who may comment once published.
|
|
20355
|
+
* @enum {string|null}
|
|
20356
|
+
*/
|
|
20357
|
+
can_comment?: "anyone" | "relations_only" | "no_one" | null;
|
|
20358
|
+
/** @description Company page id to post as. */
|
|
20359
|
+
post_as?: string | null;
|
|
20360
|
+
/** @description When Curviate publishes the Draft (UTC, whole minute), or null. It goes out up to 20 seconds after this time. A failed Draft has null here; the time that failed is failure.scheduled_at. */
|
|
20361
|
+
scheduled_at: string | null;
|
|
20362
|
+
/** @description Why the last scheduled publish failed; present on failed Drafts only. */
|
|
20363
|
+
failure: {
|
|
20364
|
+
/**
|
|
20365
|
+
* @description Why it failed. outcome_unknown: the platform gave no usable answer, so the post may be live; check the account's posts before you publish again. missed: Curviate could not start within an hour of the time. platform_error and rate_limited: 3 attempts over about 15 minutes all failed.
|
|
20366
|
+
* @enum {string}
|
|
20367
|
+
*/
|
|
20368
|
+
code?: "platform_error" | "rate_limited" | "account_unavailable" | "media_rejected" | "budget_exhausted" | "outside_activity_window" | "no_active_seat" | "not_publishable" | "platform_rejected" | "missed" | "outcome_unknown";
|
|
20369
|
+
/** @description What went wrong and what to do next. Never contains post text. */
|
|
20370
|
+
message?: string;
|
|
20371
|
+
/** @description When it failed. */
|
|
20372
|
+
failed_at?: string;
|
|
20373
|
+
/** @description The time that failed to publish. */
|
|
20374
|
+
scheduled_at?: string;
|
|
20375
|
+
} | null;
|
|
20376
|
+
/** @description Creation time. */
|
|
20377
|
+
created_at: string;
|
|
20378
|
+
/** @description Last change. */
|
|
20379
|
+
updated_at: string;
|
|
20380
|
+
safety_warning?: components["schemas"]["SafetyWarning"];
|
|
20381
|
+
};
|
|
20382
|
+
};
|
|
20383
|
+
};
|
|
20384
|
+
/** @description Missing or invalid API key. */
|
|
20385
|
+
401: {
|
|
20386
|
+
headers: {
|
|
20387
|
+
[name: string]: unknown;
|
|
20388
|
+
};
|
|
20389
|
+
content: {
|
|
20390
|
+
"application/json": components["schemas"]["Error"];
|
|
20391
|
+
};
|
|
20392
|
+
};
|
|
20393
|
+
/** @description No Draft with this id among yours (RESOURCE_NOT_FOUND). */
|
|
20394
|
+
404: {
|
|
20395
|
+
headers: {
|
|
20396
|
+
[name: string]: unknown;
|
|
20397
|
+
};
|
|
20398
|
+
content: {
|
|
20399
|
+
"application/json": components["schemas"]["Error"];
|
|
20400
|
+
};
|
|
20401
|
+
};
|
|
20402
|
+
/** @description Rate limited, slow down and retry after the hinted delay. */
|
|
20403
|
+
429: {
|
|
20404
|
+
headers: {
|
|
20405
|
+
"RateLimit-Policy": components["headers"]["RateLimit-Policy"];
|
|
20406
|
+
RateLimit: components["headers"]["RateLimit"];
|
|
20407
|
+
"Retry-After": components["headers"]["Retry-After"];
|
|
20408
|
+
[name: string]: unknown;
|
|
20409
|
+
};
|
|
20410
|
+
content: {
|
|
20411
|
+
"application/json": components["schemas"]["Error"];
|
|
20412
|
+
};
|
|
20413
|
+
};
|
|
20414
|
+
};
|
|
20415
|
+
};
|
|
20416
|
+
deleteV1DraftsId: {
|
|
20417
|
+
parameters: {
|
|
20418
|
+
query?: never;
|
|
20419
|
+
header?: never;
|
|
20420
|
+
path: {
|
|
20421
|
+
/** @description Draft id (drf_...). */
|
|
20422
|
+
id: string;
|
|
20423
|
+
};
|
|
20424
|
+
cookie?: never;
|
|
20425
|
+
};
|
|
20426
|
+
requestBody?: never;
|
|
20427
|
+
responses: {
|
|
20428
|
+
/** @description Draft and its media deleted. No response body. */
|
|
20429
|
+
204: {
|
|
20430
|
+
headers: {
|
|
20431
|
+
"RateLimit-Policy": components["headers"]["RateLimit-Policy"];
|
|
20432
|
+
RateLimit: components["headers"]["RateLimit"];
|
|
20433
|
+
[name: string]: unknown;
|
|
20434
|
+
};
|
|
20435
|
+
content?: never;
|
|
20436
|
+
};
|
|
20437
|
+
/** @description Missing or invalid API key. */
|
|
20438
|
+
401: {
|
|
20439
|
+
headers: {
|
|
20440
|
+
[name: string]: unknown;
|
|
20441
|
+
};
|
|
20442
|
+
content: {
|
|
20443
|
+
"application/json": components["schemas"]["Error"];
|
|
20444
|
+
};
|
|
20445
|
+
};
|
|
20446
|
+
/** @description No Draft with this id among yours (RESOURCE_NOT_FOUND). */
|
|
20447
|
+
404: {
|
|
20448
|
+
headers: {
|
|
20449
|
+
[name: string]: unknown;
|
|
20450
|
+
};
|
|
20451
|
+
content: {
|
|
20452
|
+
"application/json": components["schemas"]["Error"];
|
|
20453
|
+
};
|
|
20454
|
+
};
|
|
20455
|
+
/** @description DRAFT_PUBLISHING: a publish of this Draft is in flight. Read it again in a few seconds. */
|
|
20456
|
+
409: {
|
|
20457
|
+
headers: {
|
|
20458
|
+
[name: string]: unknown;
|
|
20459
|
+
};
|
|
20460
|
+
content: {
|
|
20461
|
+
"application/json": components["schemas"]["Error"];
|
|
20462
|
+
};
|
|
20463
|
+
};
|
|
20464
|
+
/** @description Rate limited, slow down and retry after the hinted delay. */
|
|
20465
|
+
429: {
|
|
20466
|
+
headers: {
|
|
20467
|
+
"RateLimit-Policy": components["headers"]["RateLimit-Policy"];
|
|
20468
|
+
RateLimit: components["headers"]["RateLimit"];
|
|
20469
|
+
"Retry-After": components["headers"]["Retry-After"];
|
|
20470
|
+
[name: string]: unknown;
|
|
20471
|
+
};
|
|
20472
|
+
content: {
|
|
20473
|
+
"application/json": components["schemas"]["Error"];
|
|
20474
|
+
};
|
|
20475
|
+
};
|
|
20476
|
+
};
|
|
20477
|
+
};
|
|
20478
|
+
patchV1DraftsId: {
|
|
20479
|
+
parameters: {
|
|
20480
|
+
query?: never;
|
|
20481
|
+
header?: never;
|
|
20482
|
+
path: {
|
|
20483
|
+
/** @description Draft id (drf_...). */
|
|
20484
|
+
id: string;
|
|
20485
|
+
};
|
|
20486
|
+
cookie?: never;
|
|
20487
|
+
};
|
|
20488
|
+
requestBody: {
|
|
20489
|
+
content: {
|
|
20490
|
+
"application/json": {
|
|
20491
|
+
/** @description The account (acc_...) this Draft will publish as, or null for none yet. A Draft belongs to at most one account. */
|
|
20492
|
+
account_id?: string | null;
|
|
20493
|
+
/** @description When Curviate publishes this Draft: an ISO 8601 date-time with an offset, at least 5 minutes and at most 365 days ahead, stored in UTC truncated to the minute. Scheduling needs an account and text. Curviate publishes it up to 20 seconds after this time, and keeps scheduled posts on one account at least 5 minutes apart. null unschedules. */
|
|
20494
|
+
scheduled_at?: string | null;
|
|
20495
|
+
/** @description Post body text, up to 3000 characters. May be empty while drafting; publishing needs at least one character. */
|
|
20496
|
+
text?: string | null;
|
|
20497
|
+
/** @description A post to quote or repost when published, the same as on create post. Checked at publish time. */
|
|
20498
|
+
quoted_post_id?: string | null;
|
|
20499
|
+
/**
|
|
20500
|
+
* @description Who can read the post once published.
|
|
20501
|
+
* @enum {string|null}
|
|
20502
|
+
*/
|
|
20503
|
+
can_read?: "anyone" | "relations_only" | null;
|
|
20504
|
+
/**
|
|
20505
|
+
* @description Who may comment once published.
|
|
20506
|
+
* @enum {string|null}
|
|
20507
|
+
*/
|
|
20508
|
+
can_comment?: "anyone" | "relations_only" | "no_one" | null;
|
|
20509
|
+
/** @description Company page id to post as; the account must administer it. Checked at publish time. */
|
|
20510
|
+
post_as?: string | null;
|
|
20511
|
+
/** @description Replaces the whole list. Each item is {id} to keep an existing attachment, or a new base64 object. Attachments left out are deleted. */
|
|
20512
|
+
attachments?: ({
|
|
20513
|
+
/** @description An attachment already on this Draft (att_...), kept as is. */
|
|
20514
|
+
id: string;
|
|
20515
|
+
} | {
|
|
20516
|
+
/** @description Base64-encoded file bytes. */
|
|
20517
|
+
content: string;
|
|
20518
|
+
/** @description The file's type: image/jpeg, image/png, image/gif, image/webp, video/mp4 or application/pdf. */
|
|
20519
|
+
content_type: string;
|
|
20520
|
+
/** @description File name. */
|
|
20521
|
+
filename: string;
|
|
20522
|
+
})[];
|
|
20523
|
+
};
|
|
20524
|
+
};
|
|
20525
|
+
};
|
|
20526
|
+
responses: {
|
|
20527
|
+
/** @description The updated Draft. scheduled_at schedules, reschedules or (null) unschedules; changing it or the account cancels a pending publish and its retries. Unscheduling alone needs no active seat. With scheduled_at, the response carries safety_warning (reason activity_window) when the time is outside the account's activity window and its posture is warn; under enforce the request is refused instead (429 BUDGET_EXHAUSTED, reason activity_window) and nothing is saved. */
|
|
20528
|
+
200: {
|
|
20529
|
+
headers: {
|
|
20530
|
+
"RateLimit-Policy": components["headers"]["RateLimit-Policy"];
|
|
20531
|
+
RateLimit: components["headers"]["RateLimit"];
|
|
20532
|
+
[name: string]: unknown;
|
|
20533
|
+
};
|
|
20534
|
+
content: {
|
|
20535
|
+
"application/json": {
|
|
20536
|
+
/**
|
|
20537
|
+
* @description Response type discriminator.
|
|
20538
|
+
* @enum {string}
|
|
20539
|
+
*/
|
|
20540
|
+
object: "draft";
|
|
20541
|
+
/** @description Draft id (drf_...). */
|
|
20542
|
+
id: string;
|
|
20543
|
+
/** @description The account this Draft will publish as, or null for none yet. */
|
|
20544
|
+
account_id: string | null;
|
|
20545
|
+
/**
|
|
20546
|
+
* @description Derived: failed if failure is set, else scheduled if scheduled_at is set, else draft.
|
|
20547
|
+
* @enum {string}
|
|
20548
|
+
*/
|
|
20549
|
+
status: "draft" | "scheduled" | "failed";
|
|
20550
|
+
/** @description Post body text. May be empty or null while drafting. */
|
|
20551
|
+
text: string | null;
|
|
20552
|
+
/** @description Media, in post order. */
|
|
20553
|
+
attachments: {
|
|
20554
|
+
/** @description Attachment id (att_...). Send {id} in a PATCH attachments list to keep it. */
|
|
20555
|
+
id: string;
|
|
20556
|
+
/** @description The file's type. */
|
|
20557
|
+
content_type: string;
|
|
20558
|
+
/** @description File name. */
|
|
20559
|
+
filename: string;
|
|
20560
|
+
/** @description Stored size in bytes. */
|
|
20561
|
+
size_bytes: number;
|
|
20562
|
+
/** @description Signed download link to the stored file, valid for 1 hour. Read the Draft again for a fresh one. Null when the stored file is unavailable. */
|
|
20563
|
+
url: string | null;
|
|
20564
|
+
}[];
|
|
20565
|
+
/** @description A post to quote or repost when published. */
|
|
20566
|
+
quoted_post_id?: string | null;
|
|
20567
|
+
/**
|
|
20568
|
+
* @description Who can read the post once published.
|
|
20569
|
+
* @enum {string|null}
|
|
20570
|
+
*/
|
|
20571
|
+
can_read?: "anyone" | "relations_only" | null;
|
|
20572
|
+
/**
|
|
20573
|
+
* @description Who may comment once published.
|
|
20574
|
+
* @enum {string|null}
|
|
20575
|
+
*/
|
|
20576
|
+
can_comment?: "anyone" | "relations_only" | "no_one" | null;
|
|
20577
|
+
/** @description Company page id to post as. */
|
|
20578
|
+
post_as?: string | null;
|
|
20579
|
+
/** @description When Curviate publishes the Draft (UTC, whole minute), or null. It goes out up to 20 seconds after this time. A failed Draft has null here; the time that failed is failure.scheduled_at. */
|
|
20580
|
+
scheduled_at: string | null;
|
|
20581
|
+
/** @description Why the last scheduled publish failed; present on failed Drafts only. */
|
|
20582
|
+
failure: {
|
|
20583
|
+
/**
|
|
20584
|
+
* @description Why it failed. outcome_unknown: the platform gave no usable answer, so the post may be live; check the account's posts before you publish again. missed: Curviate could not start within an hour of the time. platform_error and rate_limited: 3 attempts over about 15 minutes all failed.
|
|
20585
|
+
* @enum {string}
|
|
20586
|
+
*/
|
|
20587
|
+
code?: "platform_error" | "rate_limited" | "account_unavailable" | "media_rejected" | "budget_exhausted" | "outside_activity_window" | "no_active_seat" | "not_publishable" | "platform_rejected" | "missed" | "outcome_unknown";
|
|
20588
|
+
/** @description What went wrong and what to do next. Never contains post text. */
|
|
20589
|
+
message?: string;
|
|
20590
|
+
/** @description When it failed. */
|
|
20591
|
+
failed_at?: string;
|
|
20592
|
+
/** @description The time that failed to publish. */
|
|
20593
|
+
scheduled_at?: string;
|
|
20594
|
+
} | null;
|
|
20595
|
+
/** @description Creation time. */
|
|
20596
|
+
created_at: string;
|
|
20597
|
+
/** @description Last change. */
|
|
20598
|
+
updated_at: string;
|
|
20599
|
+
safety_warning?: components["schemas"]["SafetyWarning"];
|
|
20600
|
+
};
|
|
20601
|
+
};
|
|
20602
|
+
};
|
|
20603
|
+
/** @description Invalid input. Media rules: up to 20 images (JPEG, PNG, GIF, WEBP, at most 6012 x 6012 px), or one MP4 video, or one PDF, never mixed. Also: an attachment id that is not on this Draft. scheduled_at must be an ISO 8601 date-time with an offset, 5 minutes to 365 days ahead after truncation to the minute. */
|
|
20604
|
+
400: {
|
|
20605
|
+
headers: {
|
|
20606
|
+
[name: string]: unknown;
|
|
20607
|
+
};
|
|
20608
|
+
content: {
|
|
20609
|
+
"application/json": components["schemas"]["Error"];
|
|
20610
|
+
};
|
|
20611
|
+
};
|
|
20612
|
+
/** @description Missing or invalid API key. */
|
|
20613
|
+
401: {
|
|
20614
|
+
headers: {
|
|
20615
|
+
[name: string]: unknown;
|
|
20616
|
+
};
|
|
20617
|
+
content: {
|
|
20618
|
+
"application/json": components["schemas"]["Error"];
|
|
20619
|
+
};
|
|
20620
|
+
};
|
|
20621
|
+
/** @description Forbidden. NO_ACTIVE_SEAT: the account is not attached to an active seat. */
|
|
20622
|
+
403: {
|
|
20623
|
+
headers: {
|
|
20624
|
+
[name: string]: unknown;
|
|
20625
|
+
};
|
|
20626
|
+
content: {
|
|
20627
|
+
"application/json": components["schemas"]["Error"];
|
|
20628
|
+
};
|
|
20629
|
+
};
|
|
20630
|
+
/** @description No such Draft (RESOURCE_NOT_FOUND), or the account_id is not one of yours (ACCOUNT_NOT_FOUND). */
|
|
19785
20631
|
404: {
|
|
19786
20632
|
headers: {
|
|
19787
20633
|
[name: string]: unknown;
|
|
@@ -19790,7 +20636,34 @@ interface operations {
|
|
|
19790
20636
|
"application/json": components["schemas"]["Error"];
|
|
19791
20637
|
};
|
|
19792
20638
|
};
|
|
19793
|
-
/** @description
|
|
20639
|
+
/** @description DRAFT_PUBLISHING: a publish of this Draft is in flight. Read it again in a few seconds. Or the target account is disconnected (REAUTH_REQUIRED). */
|
|
20640
|
+
409: {
|
|
20641
|
+
headers: {
|
|
20642
|
+
[name: string]: unknown;
|
|
20643
|
+
};
|
|
20644
|
+
content: {
|
|
20645
|
+
"application/json": components["schemas"]["Error"];
|
|
20646
|
+
};
|
|
20647
|
+
};
|
|
20648
|
+
/** @description A file is over its size limit: 5 MiB per image, and 5 MiB per file sent inline. */
|
|
20649
|
+
413: {
|
|
20650
|
+
headers: {
|
|
20651
|
+
[name: string]: unknown;
|
|
20652
|
+
};
|
|
20653
|
+
content: {
|
|
20654
|
+
"application/json": components["schemas"]["Error"];
|
|
20655
|
+
};
|
|
20656
|
+
};
|
|
20657
|
+
/** @description DRAFT_LIMIT_REACHED: the bucket (one account, or Drafts with no account) already holds 50 Drafts. MEDIA_QUOTA_EXCEEDED: the media would take the bucket past its 2 GiB quota; nothing is stored. ACCOUNT_REQUIRED: a scheduled Draft cannot drop its account; unschedule it first. ACCOUNT_REQUIRED / DRAFT_NOT_PUBLISHABLE: scheduling needs an account and text. SCHEDULE_CONFLICT: another scheduled Draft on the account is less than 5 minutes away; the message names it. */
|
|
20658
|
+
422: {
|
|
20659
|
+
headers: {
|
|
20660
|
+
[name: string]: unknown;
|
|
20661
|
+
};
|
|
20662
|
+
content: {
|
|
20663
|
+
"application/json": components["schemas"]["Error"];
|
|
20664
|
+
};
|
|
20665
|
+
};
|
|
20666
|
+
/** @description BUDGET_EXHAUSTED with reason activity_window: the scheduled time is outside the account's activity window and the account enforces it. Nothing is saved. */
|
|
19794
20667
|
429: {
|
|
19795
20668
|
headers: {
|
|
19796
20669
|
"RateLimit-Policy": components["headers"]["RateLimit-Policy"];
|
|
@@ -19802,8 +20675,42 @@ interface operations {
|
|
|
19802
20675
|
"application/json": components["schemas"]["Error"];
|
|
19803
20676
|
};
|
|
19804
20677
|
};
|
|
19805
|
-
|
|
19806
|
-
|
|
20678
|
+
};
|
|
20679
|
+
};
|
|
20680
|
+
postV1DraftsIdPublish: {
|
|
20681
|
+
parameters: {
|
|
20682
|
+
query?: never;
|
|
20683
|
+
header?: never;
|
|
20684
|
+
path: {
|
|
20685
|
+
/** @description Draft id (drf_...). */
|
|
20686
|
+
id: string;
|
|
20687
|
+
};
|
|
20688
|
+
cookie?: never;
|
|
20689
|
+
};
|
|
20690
|
+
requestBody?: never;
|
|
20691
|
+
responses: {
|
|
20692
|
+
/** @description Published. The Draft and its media are deleted and a publish record is written. No webhook is sent: this response is the result. */
|
|
20693
|
+
201: {
|
|
20694
|
+
headers: {
|
|
20695
|
+
"RateLimit-Policy": components["headers"]["RateLimit-Policy"];
|
|
20696
|
+
RateLimit: components["headers"]["RateLimit"];
|
|
20697
|
+
[name: string]: unknown;
|
|
20698
|
+
};
|
|
20699
|
+
content: {
|
|
20700
|
+
"application/json": {
|
|
20701
|
+
/**
|
|
20702
|
+
* @description Response type discriminator.
|
|
20703
|
+
* @enum {string}
|
|
20704
|
+
*/
|
|
20705
|
+
object: "post_created";
|
|
20706
|
+
/** @description The published post's id. */
|
|
20707
|
+
id: string | null;
|
|
20708
|
+
safety_warning?: components["schemas"]["SafetyWarning"];
|
|
20709
|
+
};
|
|
20710
|
+
};
|
|
20711
|
+
};
|
|
20712
|
+
/** @description Missing or invalid API key. */
|
|
20713
|
+
401: {
|
|
19807
20714
|
headers: {
|
|
19808
20715
|
[name: string]: unknown;
|
|
19809
20716
|
};
|
|
@@ -19811,8 +20718,8 @@ interface operations {
|
|
|
19811
20718
|
"application/json": components["schemas"]["Error"];
|
|
19812
20719
|
};
|
|
19813
20720
|
};
|
|
19814
|
-
/** @description
|
|
19815
|
-
|
|
20721
|
+
/** @description Forbidden. NO_ACTIVE_SEAT: the account is not attached to an active seat. */
|
|
20722
|
+
403: {
|
|
19816
20723
|
headers: {
|
|
19817
20724
|
[name: string]: unknown;
|
|
19818
20725
|
};
|
|
@@ -19820,8 +20727,8 @@ interface operations {
|
|
|
19820
20727
|
"application/json": components["schemas"]["Error"];
|
|
19821
20728
|
};
|
|
19822
20729
|
};
|
|
19823
|
-
/** @description
|
|
19824
|
-
|
|
20730
|
+
/** @description No Draft with this id among yours (RESOURCE_NOT_FOUND). */
|
|
20731
|
+
404: {
|
|
19825
20732
|
headers: {
|
|
19826
20733
|
[name: string]: unknown;
|
|
19827
20734
|
};
|
|
@@ -19829,7 +20736,46 @@ interface operations {
|
|
|
19829
20736
|
"application/json": components["schemas"]["Error"];
|
|
19830
20737
|
};
|
|
19831
20738
|
};
|
|
19832
|
-
/** @description
|
|
20739
|
+
/** @description DRAFT_PUBLISHING: a publish of this Draft is in flight. Read it again in a few seconds. */
|
|
20740
|
+
409: {
|
|
20741
|
+
headers: {
|
|
20742
|
+
[name: string]: unknown;
|
|
20743
|
+
};
|
|
20744
|
+
content: {
|
|
20745
|
+
"application/json": components["schemas"]["Error"];
|
|
20746
|
+
};
|
|
20747
|
+
};
|
|
20748
|
+
/** @description ACCOUNT_REQUIRED: the Draft has no account. DRAFT_NOT_PUBLISHABLE: a content gap, the message names the field (for example text: empty). The Draft is unchanged. */
|
|
20749
|
+
422: {
|
|
20750
|
+
headers: {
|
|
20751
|
+
[name: string]: unknown;
|
|
20752
|
+
};
|
|
20753
|
+
content: {
|
|
20754
|
+
"application/json": components["schemas"]["Error"];
|
|
20755
|
+
};
|
|
20756
|
+
};
|
|
20757
|
+
/** @description An account-safety limit or a platform rate limit refused the publish. The Draft is unchanged. */
|
|
20758
|
+
429: {
|
|
20759
|
+
headers: {
|
|
20760
|
+
"RateLimit-Policy": components["headers"]["RateLimit-Policy"];
|
|
20761
|
+
RateLimit: components["headers"]["RateLimit"];
|
|
20762
|
+
"Retry-After": components["headers"]["Retry-After"];
|
|
20763
|
+
[name: string]: unknown;
|
|
20764
|
+
};
|
|
20765
|
+
content: {
|
|
20766
|
+
"application/json": components["schemas"]["Error"];
|
|
20767
|
+
};
|
|
20768
|
+
};
|
|
20769
|
+
/** @description The platform refused or failed the publish. The Draft is unchanged; the error says whether a retry can help. */
|
|
20770
|
+
502: {
|
|
20771
|
+
headers: {
|
|
20772
|
+
[name: string]: unknown;
|
|
20773
|
+
};
|
|
20774
|
+
content: {
|
|
20775
|
+
"application/json": components["schemas"]["Error"];
|
|
20776
|
+
};
|
|
20777
|
+
};
|
|
20778
|
+
/** @description PLATFORM_ERROR: the platform did not answer in time. The Draft is unchanged, but the post may still have been published: check the account's posts before publishing again. */
|
|
19833
20779
|
504: {
|
|
19834
20780
|
headers: {
|
|
19835
20781
|
[name: string]: unknown;
|
|
@@ -19840,6 +20786,201 @@ interface operations {
|
|
|
19840
20786
|
};
|
|
19841
20787
|
};
|
|
19842
20788
|
};
|
|
20789
|
+
postV1DraftsIdAttachments: {
|
|
20790
|
+
parameters: {
|
|
20791
|
+
query: {
|
|
20792
|
+
/** @description The file's name, kept with the attachment. */
|
|
20793
|
+
filename: string;
|
|
20794
|
+
};
|
|
20795
|
+
header?: never;
|
|
20796
|
+
path: {
|
|
20797
|
+
/** @description Draft id (drf_...). */
|
|
20798
|
+
id: string;
|
|
20799
|
+
};
|
|
20800
|
+
cookie?: never;
|
|
20801
|
+
};
|
|
20802
|
+
requestBody: {
|
|
20803
|
+
content: {
|
|
20804
|
+
"video/mp4": string;
|
|
20805
|
+
"application/pdf": string;
|
|
20806
|
+
"image/jpeg": string;
|
|
20807
|
+
"image/png": string;
|
|
20808
|
+
"image/gif": string;
|
|
20809
|
+
"image/webp": string;
|
|
20810
|
+
};
|
|
20811
|
+
};
|
|
20812
|
+
responses: {
|
|
20813
|
+
/** @description The Draft, with the new attachment last in attachments[]. */
|
|
20814
|
+
201: {
|
|
20815
|
+
headers: {
|
|
20816
|
+
"RateLimit-Policy": components["headers"]["RateLimit-Policy"];
|
|
20817
|
+
RateLimit: components["headers"]["RateLimit"];
|
|
20818
|
+
[name: string]: unknown;
|
|
20819
|
+
};
|
|
20820
|
+
content: {
|
|
20821
|
+
"application/json": {
|
|
20822
|
+
/**
|
|
20823
|
+
* @description Response type discriminator.
|
|
20824
|
+
* @enum {string}
|
|
20825
|
+
*/
|
|
20826
|
+
object: "draft";
|
|
20827
|
+
/** @description Draft id (drf_...). */
|
|
20828
|
+
id: string;
|
|
20829
|
+
/** @description The account this Draft will publish as, or null for none yet. */
|
|
20830
|
+
account_id: string | null;
|
|
20831
|
+
/**
|
|
20832
|
+
* @description Derived: failed if failure is set, else scheduled if scheduled_at is set, else draft.
|
|
20833
|
+
* @enum {string}
|
|
20834
|
+
*/
|
|
20835
|
+
status: "draft" | "scheduled" | "failed";
|
|
20836
|
+
/** @description Post body text. May be empty or null while drafting. */
|
|
20837
|
+
text: string | null;
|
|
20838
|
+
/** @description Media, in post order. */
|
|
20839
|
+
attachments: {
|
|
20840
|
+
/** @description Attachment id (att_...). Send {id} in a PATCH attachments list to keep it. */
|
|
20841
|
+
id: string;
|
|
20842
|
+
/** @description The file's type. */
|
|
20843
|
+
content_type: string;
|
|
20844
|
+
/** @description File name. */
|
|
20845
|
+
filename: string;
|
|
20846
|
+
/** @description Stored size in bytes. */
|
|
20847
|
+
size_bytes: number;
|
|
20848
|
+
/** @description Signed download link to the stored file, valid for 1 hour. Read the Draft again for a fresh one. Null when the stored file is unavailable. */
|
|
20849
|
+
url: string | null;
|
|
20850
|
+
}[];
|
|
20851
|
+
/** @description A post to quote or repost when published. */
|
|
20852
|
+
quoted_post_id?: string | null;
|
|
20853
|
+
/**
|
|
20854
|
+
* @description Who can read the post once published.
|
|
20855
|
+
* @enum {string|null}
|
|
20856
|
+
*/
|
|
20857
|
+
can_read?: "anyone" | "relations_only" | null;
|
|
20858
|
+
/**
|
|
20859
|
+
* @description Who may comment once published.
|
|
20860
|
+
* @enum {string|null}
|
|
20861
|
+
*/
|
|
20862
|
+
can_comment?: "anyone" | "relations_only" | "no_one" | null;
|
|
20863
|
+
/** @description Company page id to post as. */
|
|
20864
|
+
post_as?: string | null;
|
|
20865
|
+
/** @description When Curviate publishes the Draft (UTC, whole minute), or null. It goes out up to 20 seconds after this time. A failed Draft has null here; the time that failed is failure.scheduled_at. */
|
|
20866
|
+
scheduled_at: string | null;
|
|
20867
|
+
/** @description Why the last scheduled publish failed; present on failed Drafts only. */
|
|
20868
|
+
failure: {
|
|
20869
|
+
/**
|
|
20870
|
+
* @description Why it failed. outcome_unknown: the platform gave no usable answer, so the post may be live; check the account's posts before you publish again. missed: Curviate could not start within an hour of the time. platform_error and rate_limited: 3 attempts over about 15 minutes all failed.
|
|
20871
|
+
* @enum {string}
|
|
20872
|
+
*/
|
|
20873
|
+
code?: "platform_error" | "rate_limited" | "account_unavailable" | "media_rejected" | "budget_exhausted" | "outside_activity_window" | "no_active_seat" | "not_publishable" | "platform_rejected" | "missed" | "outcome_unknown";
|
|
20874
|
+
/** @description What went wrong and what to do next. Never contains post text. */
|
|
20875
|
+
message?: string;
|
|
20876
|
+
/** @description When it failed. */
|
|
20877
|
+
failed_at?: string;
|
|
20878
|
+
/** @description The time that failed to publish. */
|
|
20879
|
+
scheduled_at?: string;
|
|
20880
|
+
} | null;
|
|
20881
|
+
/** @description Creation time. */
|
|
20882
|
+
created_at: string;
|
|
20883
|
+
/** @description Last change. */
|
|
20884
|
+
updated_at: string;
|
|
20885
|
+
safety_warning?: components["schemas"]["SafetyWarning"];
|
|
20886
|
+
};
|
|
20887
|
+
};
|
|
20888
|
+
};
|
|
20889
|
+
/** @description Invalid input. Media rules: up to 20 images (JPEG, PNG, GIF, WEBP, at most 6012 x 6012 px), or one MP4 video, or one PDF, never mixed. Also: an empty file, a filename missing, or a body that did not carry exactly its Content-Length (a truncated upload; nothing is kept). */
|
|
20890
|
+
400: {
|
|
20891
|
+
headers: {
|
|
20892
|
+
[name: string]: unknown;
|
|
20893
|
+
};
|
|
20894
|
+
content: {
|
|
20895
|
+
"application/json": components["schemas"]["Error"];
|
|
20896
|
+
};
|
|
20897
|
+
};
|
|
20898
|
+
/** @description Missing or invalid API key. */
|
|
20899
|
+
401: {
|
|
20900
|
+
headers: {
|
|
20901
|
+
[name: string]: unknown;
|
|
20902
|
+
};
|
|
20903
|
+
content: {
|
|
20904
|
+
"application/json": components["schemas"]["Error"];
|
|
20905
|
+
};
|
|
20906
|
+
};
|
|
20907
|
+
/** @description Forbidden. NO_ACTIVE_SEAT: the account is not attached to an active seat. */
|
|
20908
|
+
403: {
|
|
20909
|
+
headers: {
|
|
20910
|
+
[name: string]: unknown;
|
|
20911
|
+
};
|
|
20912
|
+
content: {
|
|
20913
|
+
"application/json": components["schemas"]["Error"];
|
|
20914
|
+
};
|
|
20915
|
+
};
|
|
20916
|
+
/** @description No Draft with this id among yours (RESOURCE_NOT_FOUND). */
|
|
20917
|
+
404: {
|
|
20918
|
+
headers: {
|
|
20919
|
+
[name: string]: unknown;
|
|
20920
|
+
};
|
|
20921
|
+
content: {
|
|
20922
|
+
"application/json": components["schemas"]["Error"];
|
|
20923
|
+
};
|
|
20924
|
+
};
|
|
20925
|
+
/** @description DRAFT_PUBLISHING: a publish of this Draft is in flight. Read it again in a few seconds. */
|
|
20926
|
+
409: {
|
|
20927
|
+
headers: {
|
|
20928
|
+
[name: string]: unknown;
|
|
20929
|
+
};
|
|
20930
|
+
content: {
|
|
20931
|
+
"application/json": components["schemas"]["Error"];
|
|
20932
|
+
};
|
|
20933
|
+
};
|
|
20934
|
+
/** @description INVALID_REQUEST: Content-Length is required; a chunked upload is not accepted. */
|
|
20935
|
+
411: {
|
|
20936
|
+
headers: {
|
|
20937
|
+
[name: string]: unknown;
|
|
20938
|
+
};
|
|
20939
|
+
content: {
|
|
20940
|
+
"application/json": components["schemas"]["Error"];
|
|
20941
|
+
};
|
|
20942
|
+
};
|
|
20943
|
+
/** @description PAYLOAD_TOO_LARGE: the file is over its type's limit: 5 MiB per image, 50 MiB for a video, 50 MiB for a PDF. */
|
|
20944
|
+
413: {
|
|
20945
|
+
headers: {
|
|
20946
|
+
[name: string]: unknown;
|
|
20947
|
+
};
|
|
20948
|
+
content: {
|
|
20949
|
+
"application/json": components["schemas"]["Error"];
|
|
20950
|
+
};
|
|
20951
|
+
};
|
|
20952
|
+
/** @description UNSUPPORTED_MEDIA_TYPE: Content-Type is not one of the accepted file types (JSON and multipart bodies included). */
|
|
20953
|
+
415: {
|
|
20954
|
+
headers: {
|
|
20955
|
+
[name: string]: unknown;
|
|
20956
|
+
};
|
|
20957
|
+
content: {
|
|
20958
|
+
"application/json": components["schemas"]["Error"];
|
|
20959
|
+
};
|
|
20960
|
+
};
|
|
20961
|
+
/** @description MEDIA_QUOTA_EXCEEDED: the file would take the bucket past its 2 GiB quota; nothing is stored. */
|
|
20962
|
+
422: {
|
|
20963
|
+
headers: {
|
|
20964
|
+
[name: string]: unknown;
|
|
20965
|
+
};
|
|
20966
|
+
content: {
|
|
20967
|
+
"application/json": components["schemas"]["Error"];
|
|
20968
|
+
};
|
|
20969
|
+
};
|
|
20970
|
+
/** @description Rate limited, slow down and retry after the hinted delay. */
|
|
20971
|
+
429: {
|
|
20972
|
+
headers: {
|
|
20973
|
+
"RateLimit-Policy": components["headers"]["RateLimit-Policy"];
|
|
20974
|
+
RateLimit: components["headers"]["RateLimit"];
|
|
20975
|
+
"Retry-After": components["headers"]["Retry-After"];
|
|
20976
|
+
[name: string]: unknown;
|
|
20977
|
+
};
|
|
20978
|
+
content: {
|
|
20979
|
+
"application/json": components["schemas"]["Error"];
|
|
20980
|
+
};
|
|
20981
|
+
};
|
|
20982
|
+
};
|
|
20983
|
+
};
|
|
19843
20984
|
getV1AccountIdRecruiterProfilesUserId: {
|
|
19844
20985
|
parameters: {
|
|
19845
20986
|
query?: {
|
|
@@ -30217,7 +31358,7 @@ interface operations {
|
|
|
30217
31358
|
* @description The event source this webhook subscribes to.
|
|
30218
31359
|
* @enum {string}
|
|
30219
31360
|
*/
|
|
30220
|
-
source?: "messaging" | "user" | "account_status";
|
|
31361
|
+
source?: "messaging" | "user" | "account_status" | "post";
|
|
30221
31362
|
/** @description The URL that receives delivery POST requests. */
|
|
30222
31363
|
request_url?: string;
|
|
30223
31364
|
name?: string | null;
|
|
@@ -30379,6 +31520,30 @@ interface operations {
|
|
|
30379
31520
|
}[];
|
|
30380
31521
|
/** @description Account-status events to subscribe to (default: all 12 lifecycle events) */
|
|
30381
31522
|
events?: ("account.created" | "account.connected" | "account.synced" | "account.reconnected" | "account.reconnect_needed" | "account.restricted" | "account.creation_failed" | "account.disconnected" | "account.error" | "account.paused" | "account.connecting" | "account.permission_revoked" | "account.initial_sync.running" | "account.initial_sync.completed" | "account.initial_sync.failed")[];
|
|
31523
|
+
} | {
|
|
31524
|
+
/** @constant */
|
|
31525
|
+
source: "post";
|
|
31526
|
+
/** @description HTTPS URL that receives webhook deliveries. Must be a publicly reachable host on the default https port; private, loopback and link-local addresses are rejected. */
|
|
31527
|
+
request_url: string;
|
|
31528
|
+
/** @description Human-readable name for this webhook (1-100 chars) */
|
|
31529
|
+
name?: string;
|
|
31530
|
+
/** @description Per-account targeting. Required and non-empty; each id must be an acc_-prefixed id owned by the tenant. */
|
|
31531
|
+
account_ids: string[];
|
|
31532
|
+
/**
|
|
31533
|
+
* @description A disabled webhook is created but delivers nothing
|
|
31534
|
+
* @default true
|
|
31535
|
+
*/
|
|
31536
|
+
enabled?: boolean;
|
|
31537
|
+
/**
|
|
31538
|
+
* @description Custom headers added to each delivery POST. Names must be valid HTTP header names and values must be printable ASCII (no line breaks or control characters). Reserved names are rejected at registration; they include Content-Type, User-Agent, Host, any Curviate-* or Sec-* name, and the hop-by-hop headers. At most 10 headers, 1024 characters per value, 4096 bytes in total. Custom headers are not covered by the delivery signature, so treat them as a hint, not as proof of origin. Values are encrypted at rest and are never returned by a read. A read shows the header name plus a 8-character keyed fingerprint of the value, which carries no part of the value and no indication of its length. It is deterministic within your account, so a fingerprint confirms a rotation took effect and tells you whether two of your webhooks carry the same credential; fingerprints are not comparable across accounts. The header name is what identifies which credential is configured.
|
|
31539
|
+
* @default []
|
|
31540
|
+
*/
|
|
31541
|
+
headers?: {
|
|
31542
|
+
key: string;
|
|
31543
|
+
value: string;
|
|
31544
|
+
}[];
|
|
31545
|
+
/** @description Post events to subscribe to (default: both post.published and post.publish_failed) */
|
|
31546
|
+
events?: ("post.published" | "post.publish_failed")[];
|
|
30382
31547
|
};
|
|
30383
31548
|
};
|
|
30384
31549
|
};
|
|
@@ -30403,7 +31568,7 @@ interface operations {
|
|
|
30403
31568
|
* @description The event source this webhook subscribes to.
|
|
30404
31569
|
* @enum {string}
|
|
30405
31570
|
*/
|
|
30406
|
-
source?: "messaging" | "user" | "account_status";
|
|
31571
|
+
source?: "messaging" | "user" | "account_status" | "post";
|
|
30407
31572
|
/** @description The URL that receives delivery POST requests. */
|
|
30408
31573
|
request_url?: string;
|
|
30409
31574
|
/** @description Human-readable label. */
|
|
@@ -30421,7 +31586,7 @@ interface operations {
|
|
|
30421
31586
|
}[];
|
|
30422
31587
|
/** @description Canonical event names this webhook subscribes to. */
|
|
30423
31588
|
events?: string[];
|
|
30424
|
-
/** @description Field-remapping keys for the delivery payload (messaging and user sources only). */
|
|
31589
|
+
/** @description Field-remapping keys for the delivery payload (messaging and user sources only; post and account_status have none). */
|
|
30425
31590
|
data?: string[];
|
|
30426
31591
|
/**
|
|
30427
31592
|
* @description HMAC signing secret, 64 hexadecimal characters, returned exactly once at creation. Store it securely.
|
|
@@ -30523,7 +31688,7 @@ interface operations {
|
|
|
30523
31688
|
object?: "webhook_event_catalogue";
|
|
30524
31689
|
/** @description Event types grouped by source. */
|
|
30525
31690
|
sources?: {
|
|
30526
|
-
/** @description Event source group (messaging, user, account_status, recruiter, sales_nav). */
|
|
31691
|
+
/** @description Event source group (messaging, user, account_status, post, recruiter, sales_nav). */
|
|
30527
31692
|
source?: string;
|
|
30528
31693
|
events?: {
|
|
30529
31694
|
/** @description Canonical event name. */
|
|
@@ -30681,7 +31846,7 @@ interface operations {
|
|
|
30681
31846
|
* @description The event source this webhook subscribes to (immutable).
|
|
30682
31847
|
* @enum {string}
|
|
30683
31848
|
*/
|
|
30684
|
-
source?: "messaging" | "user" | "account_status";
|
|
31849
|
+
source?: "messaging" | "user" | "account_status" | "post";
|
|
30685
31850
|
/** @description The URL that receives delivery POST requests. */
|
|
30686
31851
|
request_url?: string;
|
|
30687
31852
|
/** @description Human-readable label. */
|
|
@@ -30699,7 +31864,7 @@ interface operations {
|
|
|
30699
31864
|
}[];
|
|
30700
31865
|
/** @description Canonical event names this webhook subscribes to. */
|
|
30701
31866
|
events?: string[];
|
|
30702
|
-
/** @description Field-remapping keys for the delivery payload (messaging and user sources only). */
|
|
31867
|
+
/** @description Field-remapping keys for the delivery payload (messaging and user sources only; post and account_status have none). */
|
|
30703
31868
|
data?: string[];
|
|
30704
31869
|
/** @description First 8 characters of the signing secret. The full secret is never returned on edit, it is preserved unchanged. */
|
|
30705
31870
|
secret_prefix?: string;
|
|
@@ -30877,7 +32042,7 @@ interface operations {
|
|
|
30877
32042
|
* @description The event source this webhook subscribes to (immutable).
|
|
30878
32043
|
* @enum {string}
|
|
30879
32044
|
*/
|
|
30880
|
-
source?: "messaging" | "user" | "account_status";
|
|
32045
|
+
source?: "messaging" | "user" | "account_status" | "post";
|
|
30881
32046
|
/** @description The URL that receives delivery POST requests. */
|
|
30882
32047
|
request_url?: string;
|
|
30883
32048
|
/** @description Human-readable label. */
|
|
@@ -30895,7 +32060,7 @@ interface operations {
|
|
|
30895
32060
|
}[];
|
|
30896
32061
|
/** @description Canonical event names this webhook subscribes to. */
|
|
30897
32062
|
events?: string[];
|
|
30898
|
-
/** @description Field-remapping keys for the delivery payload (messaging and user sources only). */
|
|
32063
|
+
/** @description Field-remapping keys for the delivery payload (messaging and user sources only; post and account_status have none). */
|
|
30899
32064
|
data?: string[];
|
|
30900
32065
|
/** @description First 8 characters of the signing secret. The full secret is never returned on edit, it is preserved unchanged. */
|
|
30901
32066
|
secret_prefix?: string;
|
|
@@ -34621,13 +35786,149 @@ declare class WebhooksResource {
|
|
|
34621
35786
|
delete(id: string): Promise<WebhookDeleteResult>;
|
|
34622
35787
|
}
|
|
34623
35788
|
|
|
35789
|
+
/**
|
|
35790
|
+
* Drafts resource: 7 methods (root-scoped).
|
|
35791
|
+
*
|
|
35792
|
+
* A Draft is a stored, editable, unpublished post. Give it an account and a
|
|
35793
|
+
* `scheduled_at` and Curviate publishes it for you at that time. Scheduling
|
|
35794
|
+
* never changes the id, so one Draft is one object from first save to publish.
|
|
35795
|
+
*
|
|
35796
|
+
* Root-scoped like `webhooks`: a Draft's account is optional, so there is no
|
|
35797
|
+
* `account_id` path segment. `account_id` is a field of the Draft.
|
|
35798
|
+
*
|
|
35799
|
+
* `POST /v1/{account_id}/posts` (`posts.create`) publishes immediately and does
|
|
35800
|
+
* not schedule. To schedule, create a Draft with `scheduled_at`.
|
|
35801
|
+
*
|
|
35802
|
+
* `delete` resolves with nothing (the API answers 204). `list` returns Drafts
|
|
35803
|
+
* and, with `status: ["published"]`, publish records (never Drafts).
|
|
35804
|
+
*/
|
|
35805
|
+
|
|
35806
|
+
type DraftCreateBody = paths["/v1/drafts"]["post"]["requestBody"]["content"]["application/json"];
|
|
35807
|
+
type DraftCreateResult = paths["/v1/drafts"]["post"]["responses"]["201"]["content"]["application/json"];
|
|
35808
|
+
type DraftListParams = NonNullable<paths["/v1/drafts"]["get"]["parameters"]["query"]>;
|
|
35809
|
+
type DraftListResult = paths["/v1/drafts"]["get"]["responses"]["200"]["content"]["application/json"];
|
|
35810
|
+
type DraftGetResult = paths["/v1/drafts/{id}"]["get"]["responses"]["200"]["content"]["application/json"];
|
|
35811
|
+
type DraftUpdateBody = paths["/v1/drafts/{id}"]["patch"]["requestBody"]["content"]["application/json"];
|
|
35812
|
+
type DraftUpdateResult = paths["/v1/drafts/{id}"]["patch"]["responses"]["200"]["content"]["application/json"];
|
|
35813
|
+
/** Delete-draft resolves with nothing: the API answers 204 with no body. */
|
|
35814
|
+
type DraftDeleteResult = void;
|
|
35815
|
+
type DraftPublishResult = paths["/v1/drafts/{id}/publish"]["post"]["responses"]["201"]["content"]["application/json"];
|
|
35816
|
+
/** The file types the upload route accepts as the raw body. */
|
|
35817
|
+
type DraftAttachmentContentType = keyof NonNullable<paths["/v1/drafts/{id}/attachments"]["post"]["requestBody"]>["content"];
|
|
35818
|
+
type DraftUploadResult = paths["/v1/drafts/{id}/attachments"]["post"]["responses"]["201"]["content"]["application/json"];
|
|
35819
|
+
/** Options for {@link DraftsResource.uploadAttachment}. */
|
|
35820
|
+
interface DraftUploadOptions {
|
|
35821
|
+
/** The file's name, kept with the attachment. 1 to 255 characters. */
|
|
35822
|
+
filename: string;
|
|
35823
|
+
/**
|
|
35824
|
+
* The file's type. Optional when `data` is a `Blob`/`File` that carries one.
|
|
35825
|
+
* Anything outside {@link DraftAttachmentContentType} is refused with
|
|
35826
|
+
* `415 UNSUPPORTED_MEDIA_TYPE`.
|
|
35827
|
+
*/
|
|
35828
|
+
contentType?: DraftAttachmentContentType;
|
|
35829
|
+
}
|
|
35830
|
+
declare class DraftsResource {
|
|
35831
|
+
protected readonly ctx: RequestContext;
|
|
35832
|
+
constructor(ctx: RequestContext);
|
|
35833
|
+
/**
|
|
35834
|
+
* Store a Draft. Every field is optional, `account_id` and `text` included.
|
|
35835
|
+
* `POST /v1/drafts`
|
|
35836
|
+
*
|
|
35837
|
+
* With `scheduled_at` (ISO 8601 with offset, between 5 minutes and 365 days
|
|
35838
|
+
* ahead) the Draft is scheduled in the same call and needs an account and
|
|
35839
|
+
* publishable text. Up to 50 Drafts and 2 GiB of media per account, and per
|
|
35840
|
+
* no-account. A retry creates a second Draft.
|
|
35841
|
+
*
|
|
35842
|
+
* @example
|
|
35843
|
+
* const draft = await curviate.drafts.create({
|
|
35844
|
+
* account_id: "acc_01J8Z3K9P0Q1R2S3T4V5W6X7Y8",
|
|
35845
|
+
* text: "Three things we learned shipping our first agent integration.",
|
|
35846
|
+
* scheduled_at: "2026-10-12T09:00:00+02:00",
|
|
35847
|
+
* });
|
|
35848
|
+
* // draft.status === "scheduled"
|
|
35849
|
+
*/
|
|
35850
|
+
create(body?: DraftCreateBody): Promise<DraftCreateResult>;
|
|
35851
|
+
/**
|
|
35852
|
+
* List Drafts, cursor-paginated. `GET /v1/drafts`
|
|
35853
|
+
*
|
|
35854
|
+
* `status` defaults to `["draft", "scheduled", "failed"]`; add `"published"`
|
|
35855
|
+
* to include publish records (`object: "publish_record"`, never Drafts).
|
|
35856
|
+
* `account_id` is an `acc_` id or `"none"`. `from`/`to` are a half-open
|
|
35857
|
+
* `[from, to)` range on each item's own date.
|
|
35858
|
+
*
|
|
35859
|
+
* @example
|
|
35860
|
+
* const page = await curviate.drafts.list({ status: ["scheduled"], order: "asc" });
|
|
35861
|
+
*/
|
|
35862
|
+
list(params?: DraftListParams): Promise<DraftListResult>;
|
|
35863
|
+
/**
|
|
35864
|
+
* Return one Draft, with a fresh signed link (valid 1 hour) per attachment.
|
|
35865
|
+
* `GET /v1/drafts/{id}`
|
|
35866
|
+
*
|
|
35867
|
+
* @example
|
|
35868
|
+
* const draft = await curviate.drafts.get("drf_01J8Z3K9P0Q1R2S3T4V5W6X7Y8");
|
|
35869
|
+
*/
|
|
35870
|
+
get(id: string): Promise<DraftGetResult>;
|
|
35871
|
+
/**
|
|
35872
|
+
* Partial update: an omitted field is left as is, `null` clears it.
|
|
35873
|
+
* `PATCH /v1/drafts/{id}`
|
|
35874
|
+
*
|
|
35875
|
+
* `attachments` replaces the whole list (`{ id }` keeps a file, a base64
|
|
35876
|
+
* object adds one, anything left out is deleted). `scheduled_at` schedules,
|
|
35877
|
+
* reschedules or, with `null`, unschedules. Editing a `failed` Draft clears
|
|
35878
|
+
* its `failure`. A Draft being published answers `409 DRAFT_PUBLISHING`.
|
|
35879
|
+
*
|
|
35880
|
+
* @example
|
|
35881
|
+
* await curviate.drafts.update(id, { scheduled_at: null }); // unschedule
|
|
35882
|
+
*/
|
|
35883
|
+
update(id: string, body: DraftUpdateBody): Promise<DraftUpdateResult>;
|
|
35884
|
+
/**
|
|
35885
|
+
* Delete the Draft and its stored media (bodyless, 204).
|
|
35886
|
+
* `DELETE /v1/drafts/{id}`
|
|
35887
|
+
*
|
|
35888
|
+
* @example
|
|
35889
|
+
* await curviate.drafts.delete(id);
|
|
35890
|
+
*/
|
|
35891
|
+
delete(id: string): Promise<DraftDeleteResult>;
|
|
35892
|
+
/**
|
|
35893
|
+
* Publish the Draft now, under the same rules and safety limits as
|
|
35894
|
+
* `posts.create`. `POST /v1/drafts/{id}/publish`
|
|
35895
|
+
*
|
|
35896
|
+
* Success deletes the Draft and its media, writes a publish record and
|
|
35897
|
+
* returns `{ object: "post_created", id }`; no webhook is sent. A known
|
|
35898
|
+
* failure leaves the Draft unchanged. A `504` or `502` whose message says
|
|
35899
|
+
* the outcome is unknown means the post may be live: check the account's
|
|
35900
|
+
* posts before retrying.
|
|
35901
|
+
*
|
|
35902
|
+
* @example
|
|
35903
|
+
* const { id: postId } = await curviate.drafts.publish(draftId);
|
|
35904
|
+
*/
|
|
35905
|
+
publish(id: string): Promise<DraftPublishResult>;
|
|
35906
|
+
/**
|
|
35907
|
+
* Add one file to the Draft as the raw request body, for media too large to
|
|
35908
|
+
* send inline: an MP4 video or a PDF, each up to 50 MiB. An image is capped at 5 MiB on
|
|
35909
|
+
* every route. One file per call.
|
|
35910
|
+
* `POST /v1/drafts/{id}/attachments?filename=...`
|
|
35911
|
+
*
|
|
35912
|
+
* Small files (up to 5 MiB) can instead ride inline in `create` / `update`
|
|
35913
|
+
* as base64. Resolves with the Draft, the new attachment last.
|
|
35914
|
+
*
|
|
35915
|
+
* @example
|
|
35916
|
+
* const bytes = await readFile("clip.mp4");
|
|
35917
|
+
* const draft = await curviate.drafts.uploadAttachment(id, bytes, {
|
|
35918
|
+
* filename: "clip.mp4",
|
|
35919
|
+
* contentType: "video/mp4",
|
|
35920
|
+
* });
|
|
35921
|
+
*/
|
|
35922
|
+
uploadAttachment(id: string, data: Blob | ArrayBuffer | Uint8Array, options: DraftUploadOptions): Promise<DraftUploadResult>;
|
|
35923
|
+
}
|
|
35924
|
+
|
|
34624
35925
|
/**
|
|
34625
35926
|
* Resource namespace assembly.
|
|
34626
35927
|
*
|
|
34627
35928
|
* The surface is split cleanly in two, with no overlap:
|
|
34628
|
-
* - **Root-scoped** (`accounts`, `auth`, `webhooks`) hang off the root client
|
|
34629
|
-
* only. Connected-account management, connect/reconnect,
|
|
34630
|
-
* registration are tenant-wide concerns, not per-account ones; they carry no
|
|
35929
|
+
* - **Root-scoped** (`accounts`, `auth`, `webhooks`, `drafts`) hang off the root client
|
|
35930
|
+
* only. Connected-account management, connect/reconnect, webhook
|
|
35931
|
+
* registration and Drafts (a Draft's account is optional) are tenant-wide concerns, not per-account ones; they carry no
|
|
34631
35932
|
* `account_id` path segment.
|
|
34632
35933
|
* - **Account-scoped** (everything else) hang off `curviate.account(id)` only.
|
|
34633
35934
|
* Every one of their paths leads with the fixed `account_id` segment, so they
|
|
@@ -34657,13 +35958,14 @@ interface ResourceNamespaces {
|
|
|
34657
35958
|
jobs: JobsResource;
|
|
34658
35959
|
companies: CompaniesResource;
|
|
34659
35960
|
webhooks: WebhooksResource;
|
|
35961
|
+
drafts: DraftsResource;
|
|
34660
35962
|
}
|
|
34661
35963
|
/**
|
|
34662
|
-
* The account-scoped accessor surface, every namespace except the
|
|
34663
|
-
* root-only ones (`accounts`, `auth`, `webhooks`). The fixed `account_id` is
|
|
35964
|
+
* The account-scoped accessor surface, every namespace except the four
|
|
35965
|
+
* root-only ones (`accounts`, `auth`, `webhooks`, `drafts`). The fixed `account_id` is
|
|
34664
35966
|
* injected by the bound context as the leading path segment.
|
|
34665
35967
|
*/
|
|
34666
|
-
type AccountScopedNamespaces = Omit<ResourceNamespaces, "accounts" | "auth" | "webhooks">;
|
|
35968
|
+
type AccountScopedNamespaces = Omit<ResourceNamespaces, "accounts" | "auth" | "webhooks" | "drafts">;
|
|
34667
35969
|
|
|
34668
35970
|
/**
|
|
34669
35971
|
* The Curviate client.
|
|
@@ -34684,6 +35986,7 @@ declare class Curviate {
|
|
|
34684
35986
|
readonly accounts: AccountsResource;
|
|
34685
35987
|
readonly auth: AuthResource;
|
|
34686
35988
|
readonly webhooks: WebhooksResource;
|
|
35989
|
+
readonly drafts: DraftsResource;
|
|
34687
35990
|
constructor(config: CurviateConfig);
|
|
34688
35991
|
/**
|
|
34689
35992
|
* Return an account-scoped accessor that fixes `account_id` on every call,
|
|
@@ -34787,7 +36090,7 @@ declare class Curviate {
|
|
|
34787
36090
|
* A code the API NEVER emitted is a different case and goes immediately, since
|
|
34788
36091
|
* no deployment can be sending it: `RATE_LIMITED` went that way in 0.30.0.
|
|
34789
36092
|
*/
|
|
34790
|
-
declare const ERROR_CODES: readonly ["UNAUTHORIZED", "INVALID_REQUEST", "UNSUPPORTED_MEDIA_TYPE", "PAYLOAD_TOO_LARGE", "ACCOUNT_NOT_FOUND", "ACCOUNT_RESTRICTED", "ACCOUNT_ALREADY_LINKED", "RESOURCE_NOT_FOUND", "NOT_STORED", "RESOURCE_ACCESS_RESTRICTED", "FILTER_CANDIDATES_REQUIRED", "NO_ACTIVE_SEAT", "LINKEDIN_FEATURE_NOT_SUBSCRIBED", "BETA_NOT_ENABLED", "RATE_LIMIT_ACCOUNT", "RATE_LIMIT_TENANT", "PLATFORM_RATE_LIMIT", "BUDGET_EXHAUSTED", "PLATFORM_ERROR", "PLATFORM_NOT_IMPLEMENTED", "LINKEDIN_OPERATION_NOT_SUPPORTED", "CHECKPOINT_NOT_FOUND", "CHECKPOINT_EXPIRED", "CHECKPOINT_INVALID_CODE", "CHECKPOINT_MAX_ATTEMPTS", "CHECKPOINT_ALREADY_RESOLVED", "CHECKPOINT_UNSUPPORTED", "CONNECTION_IN_PROGRESS", "CONNECTION_LOCATION_REQUIRED", "CONNECTION_LOCATION_UNAVAILABLE", "REAUTH_REQUIRED", "LINKEDIN_AUTH_FAILED", "LINKEDIN_SESSION_EVICTED", "LINKEDIN_RATE_LIMITED", "LINKEDIN_COOKIE_INVALID", "LINKEDIN_SERVICE_UNAVAILABLE", "MESSAGE_WINDOW_EXPIRED", "RECIPIENT_UNREACHABLE", "CONNECTION_REQUEST_CONFLICT", "PAYMENT_REQUIRED", "PAYMENT_FAILED", "SUBSCRIPTION_BUSY", "SUBSCRIPTION_NOT_FOUND", "SEAT_NOT_FOUND", "SEAT_CANCELLED", "NOT_FOUND", "REACTION_NOT_FOUND", "SUBSTRATE_LINK_FAILED", "SUBSTRATE_CAP_REACHED", "BILLING_CHECKOUT_FAILED", "BILLING_PORTAL_UNAVAILABLE", "ACCOUNT_DISPUTED", "ACCOUNT_LINKING_DISABLED", "PERIOD_LOCKED", "SEAT_NOT_EMPTY", "SEAT_PROVISIONAL", "SUBSCRIPTION_ALREADY_EXISTS", "ALREADY_CANCELLED", "CANCELLATION_ALREADY_EFFECTIVE", "INVALID_CANCELLATION_SOURCE", "TRIAL_EXPIRED", "TRIAL_SEAT_LIMIT", "TRIAL_ACTIVE_SEAT_LIMIT", "TRIAL_IDENTITY_ALREADY_USED", "TRIAL_IDENTITY_UNRESOLVED", "ADMIN_BYPASS", "STRIPE_DRIFT_DETECTED", "INTERNAL"];
|
|
36093
|
+
declare const ERROR_CODES: readonly ["UNAUTHORIZED", "INVALID_REQUEST", "UNSUPPORTED_MEDIA_TYPE", "PAYLOAD_TOO_LARGE", "ACCOUNT_NOT_FOUND", "ACCOUNT_RESTRICTED", "ACCOUNT_ALREADY_LINKED", "RESOURCE_NOT_FOUND", "NOT_STORED", "RESOURCE_ACCESS_RESTRICTED", "FILTER_CANDIDATES_REQUIRED", "NO_ACTIVE_SEAT", "LINKEDIN_FEATURE_NOT_SUBSCRIBED", "BETA_NOT_ENABLED", "RATE_LIMIT_ACCOUNT", "RATE_LIMIT_TENANT", "PLATFORM_RATE_LIMIT", "BUDGET_EXHAUSTED", "PLATFORM_ERROR", "PLATFORM_NOT_IMPLEMENTED", "LINKEDIN_OPERATION_NOT_SUPPORTED", "CHECKPOINT_NOT_FOUND", "CHECKPOINT_EXPIRED", "CHECKPOINT_INVALID_CODE", "CHECKPOINT_MAX_ATTEMPTS", "CHECKPOINT_ALREADY_RESOLVED", "CHECKPOINT_UNSUPPORTED", "CONNECTION_IN_PROGRESS", "CONNECTION_LOCATION_REQUIRED", "CONNECTION_LOCATION_UNAVAILABLE", "REAUTH_REQUIRED", "LINKEDIN_AUTH_FAILED", "LINKEDIN_SESSION_EVICTED", "LINKEDIN_RATE_LIMITED", "LINKEDIN_COOKIE_INVALID", "LINKEDIN_SERVICE_UNAVAILABLE", "MESSAGE_WINDOW_EXPIRED", "RECIPIENT_UNREACHABLE", "CONNECTION_REQUEST_CONFLICT", "PAYMENT_REQUIRED", "PAYMENT_FAILED", "SUBSCRIPTION_BUSY", "SUBSCRIPTION_NOT_FOUND", "SEAT_NOT_FOUND", "SEAT_CANCELLED", "NOT_FOUND", "REACTION_NOT_FOUND", "SUBSTRATE_LINK_FAILED", "SUBSTRATE_CAP_REACHED", "BILLING_CHECKOUT_FAILED", "BILLING_PORTAL_UNAVAILABLE", "ACCOUNT_DISPUTED", "ACCOUNT_LINKING_DISABLED", "PERIOD_LOCKED", "SEAT_NOT_EMPTY", "SEAT_PROVISIONAL", "SUBSCRIPTION_ALREADY_EXISTS", "ALREADY_CANCELLED", "CANCELLATION_ALREADY_EFFECTIVE", "INVALID_CANCELLATION_SOURCE", "TRIAL_EXPIRED", "TRIAL_SEAT_LIMIT", "TRIAL_ACTIVE_SEAT_LIMIT", "TRIAL_IDENTITY_ALREADY_USED", "TRIAL_IDENTITY_UNRESOLVED", "ADMIN_BYPASS", "STRIPE_DRIFT_DETECTED", "DRAFT_LIMIT_REACHED", "MEDIA_QUOTA_EXCEEDED", "ACCOUNT_REQUIRED", "DRAFT_NOT_PUBLISHABLE", "SCHEDULE_CONFLICT", "DRAFT_PUBLISHING", "INTERNAL"];
|
|
34791
36094
|
/**
|
|
34792
36095
|
* The complete set of error codes observable by API callers.
|
|
34793
36096
|
*
|
|
@@ -35086,6 +36389,31 @@ interface AccountPayload extends EventPayloadBase {
|
|
|
35086
36389
|
*/
|
|
35087
36390
|
external_id?: string | null;
|
|
35088
36391
|
}
|
|
36392
|
+
/**
|
|
36393
|
+
* Payload of `post.published`: a scheduled Draft went out. Carries ids and
|
|
36394
|
+
* times only, never the post text or media.
|
|
36395
|
+
*/
|
|
36396
|
+
interface PostPublishedPayload extends EventPayloadBase {
|
|
36397
|
+
draft_id: string;
|
|
36398
|
+
/** The published post's id; `null` when none was returned. */
|
|
36399
|
+
post_id: string | null;
|
|
36400
|
+
scheduled_at: string;
|
|
36401
|
+
published_at: string;
|
|
36402
|
+
/** Present when a warn-posture safety limit was breached by this publish. */
|
|
36403
|
+
safety_warning?: unknown;
|
|
36404
|
+
}
|
|
36405
|
+
/**
|
|
36406
|
+
* Payload of `post.publish_failed`: a scheduled Draft could not be published.
|
|
36407
|
+
* `failure_code` `outcome_unknown` means the post may be live: check the
|
|
36408
|
+
* account's posts before retrying. Never carries the post text or media.
|
|
36409
|
+
*/
|
|
36410
|
+
interface PostPublishFailedPayload extends EventPayloadBase {
|
|
36411
|
+
draft_id: string;
|
|
36412
|
+
/** The time that failed (the Draft's own `scheduled_at` is cleared on failure). */
|
|
36413
|
+
scheduled_at: string;
|
|
36414
|
+
failure_code: string;
|
|
36415
|
+
failure_message: string;
|
|
36416
|
+
}
|
|
35089
36417
|
/**
|
|
35090
36418
|
* Delivery metadata that accompanies every Curviate webhook event.
|
|
35091
36419
|
*
|
|
@@ -35219,6 +36547,12 @@ type CurviateEvent = CurviateEventEnvelope & ({
|
|
|
35219
36547
|
} | {
|
|
35220
36548
|
event: "account.initial_sync.failed";
|
|
35221
36549
|
data: AccountPayload;
|
|
36550
|
+
} | {
|
|
36551
|
+
event: "post.published";
|
|
36552
|
+
data: PostPublishedPayload;
|
|
36553
|
+
} | {
|
|
36554
|
+
event: "post.publish_failed";
|
|
36555
|
+
data: PostPublishFailedPayload;
|
|
35222
36556
|
});
|
|
35223
36557
|
/**
|
|
35224
36558
|
* Options for {@link constructEvent}.
|
|
@@ -35278,4 +36612,4 @@ interface ConstructEventOptions {
|
|
|
35278
36612
|
*/
|
|
35279
36613
|
declare function constructEvent(rawBody: string | Buffer, signatureHeader: string, secret: string, opts?: ConstructEventOptions): Promise<CurviateEvent>;
|
|
35280
36614
|
|
|
35281
|
-
export { type AccountDetail, type AccountListPage, type AccountListParams, type AccountPayload, type AccountScopedNamespaces, type AccountUpdateBody, type AccountUpdateResult, type AuthIntentBody, type ConnectionCountry, type ConnectionLocation, type ConnectionLocationSource, type ConnectionPayload, type ConstructEventOptions, Curviate, type CurviateConfig, CurviateError, type CurviateErrorInit, type CurviateErrorJSON, type CurviateEvent, type CurviateEventEnvelope, ERROR_CODES, type ErrorCode, type EventPayloadBase, type MessagePayload, type ResolvedConfig, type ResourceNamespaces, type RetryHint, type SafetyHint, type SafetyReason, type SeatList, WebhookSignatureError, type components, constructEvent, isCurviateError, type operations, type paths };
|
|
36615
|
+
export { type AccountDetail, type AccountListPage, type AccountListParams, type AccountPayload, type AccountScopedNamespaces, type AccountUpdateBody, type AccountUpdateResult, type AuthIntentBody, type ConnectionCountry, type ConnectionLocation, type ConnectionLocationSource, type ConnectionPayload, type ConstructEventOptions, Curviate, type CurviateConfig, CurviateError, type CurviateErrorInit, type CurviateErrorJSON, type CurviateEvent, type CurviateEventEnvelope, type DraftAttachmentContentType, type DraftCreateBody, type DraftCreateResult, type DraftDeleteResult, type DraftGetResult, type DraftListParams, type DraftListResult, type DraftPublishResult, type DraftUpdateBody, type DraftUpdateResult, type DraftUploadOptions, type DraftUploadResult, ERROR_CODES, type ErrorCode, type EventPayloadBase, type MessagePayload, type PostPublishFailedPayload, type PostPublishedPayload, type ResolvedConfig, type ResourceNamespaces, type RetryHint, type SafetyHint, type SafetyReason, type SeatList, WebhookSignatureError, type components, constructEvent, isCurviateError, type operations, type paths };
|