@smartlyqofficial/node 0.1.1
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/LICENSE +21 -0
- package/README.md +369 -0
- package/dist/index.cjs +969 -0
- package/dist/index.d.cts +7306 -0
- package/dist/index.d.ts +7306 -0
- package/dist/index.js +914 -0
- package/package.json +63 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 SmartlyQ
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,369 @@
|
|
|
1
|
+
# SmartlyQ Node.js SDK
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@smartlyqofficial/node)
|
|
4
|
+
|
|
5
|
+
The official Node.js SDK for the [SmartlyQ API](https://docs.smartlyq.com) - social posting and scheduling, AI content generation (articles, images, video, audio, presentations), SEO research, CRM, chatbots, and more, from one API key.
|
|
6
|
+
|
|
7
|
+
- **Fully typed** - request and response types for every endpoint, generated from the OpenAPI spec.
|
|
8
|
+
- **Zero dependencies** - built on the native `fetch` (Node 18+).
|
|
9
|
+
- **Batteries included** - automatic retries with backoff, idempotency keys, request timeouts, typed errors.
|
|
10
|
+
|
|
11
|
+
## Installation
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install @smartlyqofficial/node
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Quickstart
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
import SmartlyQ from '@smartlyqofficial/node';
|
|
21
|
+
|
|
22
|
+
const sq = new SmartlyQ({ apiKey: process.env.SMARTLYQ_API_KEY });
|
|
23
|
+
|
|
24
|
+
// Who am I?
|
|
25
|
+
const me = await sq.account.getMe();
|
|
26
|
+
|
|
27
|
+
// Generate an image with AI
|
|
28
|
+
const image = await sq.images.generate({ prompt: 'A minimalist product shot of a smart speaker' });
|
|
29
|
+
|
|
30
|
+
// Publish a social post
|
|
31
|
+
const post = await sq.social.createPost({
|
|
32
|
+
text: 'Hello from the SmartlyQ SDK!',
|
|
33
|
+
account_ids: ['acc_123'],
|
|
34
|
+
});
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Get an API key from your [Developer Dashboard](https://app.smartlyq.com). Keys look like `sqk_live_...` (production) or `sqk_test_...` (sandbox - free simulated responses, no charges).
|
|
38
|
+
|
|
39
|
+
## Configuration
|
|
40
|
+
|
|
41
|
+
```ts
|
|
42
|
+
const sq = new SmartlyQ({
|
|
43
|
+
apiKey: 'sqk_live_...', // or set SMARTLYQ_API_KEY
|
|
44
|
+
timeout: 60_000, // per-request timeout in ms
|
|
45
|
+
maxRetries: 2, // automatic retries on 429/5xx
|
|
46
|
+
});
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Per-request options are accepted as the last argument of every method:
|
|
50
|
+
|
|
51
|
+
```ts
|
|
52
|
+
await sq.social.createPost(body, {
|
|
53
|
+
idempotencyKey: 'my-unique-key', // safe retries for writes
|
|
54
|
+
profileId: 'prof_123', // act on behalf of a managed Profile
|
|
55
|
+
timeout: 10_000,
|
|
56
|
+
});
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Async jobs
|
|
60
|
+
|
|
61
|
+
Generation endpoints (articles, images, videos, audio) are asynchronous: they return a job. Poll it until it completes:
|
|
62
|
+
|
|
63
|
+
```ts
|
|
64
|
+
const { data } = await sq.videos.generate({ prompt: 'A 5s product teaser', model: 'standard' });
|
|
65
|
+
|
|
66
|
+
let job = await sq.jobs.get(data.job_id);
|
|
67
|
+
while (job.data.status === 'processing' || job.data.status === 'queued') {
|
|
68
|
+
await new Promise((r) => setTimeout(r, 3000));
|
|
69
|
+
job = await sq.jobs.get(data.job_id);
|
|
70
|
+
}
|
|
71
|
+
console.log(job.data.result);
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Error handling
|
|
75
|
+
|
|
76
|
+
Every non-2xx response throws a typed `SmartlyQError`:
|
|
77
|
+
|
|
78
|
+
```ts
|
|
79
|
+
import { SmartlyQError } from '@smartlyqofficial/node';
|
|
80
|
+
|
|
81
|
+
try {
|
|
82
|
+
await sq.articles.generate({ topic: 'AI trends' });
|
|
83
|
+
} catch (err) {
|
|
84
|
+
if (err instanceof SmartlyQError) {
|
|
85
|
+
console.error(err.status, err.code, err.message, err.requestId);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## API Reference
|
|
91
|
+
|
|
92
|
+
All methods below are available on the client. Full request/response documentation lives at [docs.smartlyq.com](https://docs.smartlyq.com).
|
|
93
|
+
|
|
94
|
+
<!-- BEGIN GENERATED REFERENCE -->
|
|
95
|
+
|
|
96
|
+
### Account
|
|
97
|
+
|
|
98
|
+
| Method | Endpoint | Description |
|
|
99
|
+
| --- | --- | --- |
|
|
100
|
+
| `sq.account.getMe()` | `GET /me` | Get current user profile |
|
|
101
|
+
| `sq.account.getMeUsage(query?)` | `GET /me/usage` | Get usage summary |
|
|
102
|
+
| `sq.account.getMeBalance()` | `GET /me/balance` | Get wallet balance |
|
|
103
|
+
|
|
104
|
+
### AI Captain
|
|
105
|
+
|
|
106
|
+
| Method | Endpoint | Description |
|
|
107
|
+
| --- | --- | --- |
|
|
108
|
+
| `sq.captain.sendMessage(body)` | `POST /captain/messages` | Send AI Captain message |
|
|
109
|
+
| `sq.captain.listConversations(query?)` | `GET /captain/conversations` | List AI Captain conversations |
|
|
110
|
+
| `sq.captain.getConversation(conversationId)` | `GET /captain/conversations/{conversation_id}` | Get AI Captain conversation |
|
|
111
|
+
|
|
112
|
+
### Analytics
|
|
113
|
+
|
|
114
|
+
| Method | Endpoint | Description |
|
|
115
|
+
| --- | --- | --- |
|
|
116
|
+
| `sq.analytics.getOverview(query?)` | `GET /analytics/overview` | Get analytics overview |
|
|
117
|
+
| `sq.analytics.getPosts(query?)` | `GET /analytics/posts` | Get post analytics |
|
|
118
|
+
| `sq.analytics.getAccount(accountId, query?)` | `GET /analytics/accounts/{account_id}` | Get account analytics |
|
|
119
|
+
|
|
120
|
+
### Articles
|
|
121
|
+
|
|
122
|
+
| Method | Endpoint | Description |
|
|
123
|
+
| --- | --- | --- |
|
|
124
|
+
| `sq.articles.generate(body)` | `POST /articles/generate` | Generate article |
|
|
125
|
+
| `sq.articles.list(query?)` | `GET /articles` | List articles |
|
|
126
|
+
| `sq.articles.get(articleId)` | `GET /articles/{article_id}` | Get article |
|
|
127
|
+
| `sq.articles.delete(articleId)` | `DELETE /articles/{article_id}` | Delete article |
|
|
128
|
+
|
|
129
|
+
### Audio
|
|
130
|
+
|
|
131
|
+
| Method | Endpoint | Description |
|
|
132
|
+
| --- | --- | --- |
|
|
133
|
+
| `sq.audio.textToSpeech(body)` | `POST /audio/text-to-speech` | Text to speech |
|
|
134
|
+
| `sq.audio.speechToText(body)` | `POST /audio/speech-to-text` | Speech to text |
|
|
135
|
+
| `sq.audio.get(audioId)` | `GET /audio/{audio_id}` | Get audio |
|
|
136
|
+
|
|
137
|
+
### Chatbot
|
|
138
|
+
|
|
139
|
+
| Method | Endpoint | Description |
|
|
140
|
+
| --- | --- | --- |
|
|
141
|
+
| `sq.chatbots.list(query?)` | `GET /chatbots` | List chatbots |
|
|
142
|
+
| `sq.chatbots.create(body)` | `POST /chatbots` | Create chatbot |
|
|
143
|
+
| `sq.chatbots.get(id)` | `GET /chatbots/{id}` | Get chatbot |
|
|
144
|
+
| `sq.chatbots.update(id, body)` | `PATCH /chatbots/{id}` | Update chatbot |
|
|
145
|
+
| `sq.chatbots.delete(id)` | `DELETE /chatbots/{id}` | Delete chatbot |
|
|
146
|
+
| `sq.chatbots.train(id)` | `POST /chatbots/{id}/train` | Start chatbot training |
|
|
147
|
+
| `sq.chatbots.getTrainStatus(id)` | `GET /chatbots/{id}/train-status` | Get chatbot training status |
|
|
148
|
+
| `sq.chatbots.sendMessage(id, body)` | `POST /chatbots/{id}/messages` | Send chatbot message |
|
|
149
|
+
| `sq.chatbots.listConversations(id, query?)` | `GET /chatbots/{id}/conversations` | List chatbot conversations |
|
|
150
|
+
| `sq.chatbots.getConversationMessages(id, convId)` | `GET /chatbots/{id}/conversations/{conv_id}/messages` | Get conversation messages |
|
|
151
|
+
|
|
152
|
+
### Comments
|
|
153
|
+
|
|
154
|
+
| Method | Endpoint | Description |
|
|
155
|
+
| --- | --- | --- |
|
|
156
|
+
| `sq.comments.list(query?)` | `GET /social/comments` | List comments |
|
|
157
|
+
| `sq.comments.replyTo(commentId, body)` | `POST /social/comments/{comment_id}/reply` | Reply to a comment |
|
|
158
|
+
| `sq.comments.hide(commentId)` | `POST /social/comments/{comment_id}/hide` | Hide or unhide a comment |
|
|
159
|
+
| `sq.comments.delete(commentId)` | `DELETE /social/comments/{comment_id}` | Delete a comment |
|
|
160
|
+
|
|
161
|
+
### Content
|
|
162
|
+
|
|
163
|
+
| Method | Endpoint | Description |
|
|
164
|
+
| --- | --- | --- |
|
|
165
|
+
| `sq.content.rewrite(body)` | `POST /content/rewrite` | Rewrite content |
|
|
166
|
+
| `sq.content.generateCaption(body?)` | `POST /content/caption` | Generate a social caption |
|
|
167
|
+
|
|
168
|
+
### CRM Contacts
|
|
169
|
+
|
|
170
|
+
| Method | Endpoint | Description |
|
|
171
|
+
| --- | --- | --- |
|
|
172
|
+
| `sq.contacts.list(query?)` | `GET /contacts` | List contacts |
|
|
173
|
+
| `sq.contacts.create(body)` | `POST /contacts` | Create or upsert a contact |
|
|
174
|
+
| `sq.contacts.get(id)` | `GET /contacts/{id}` | Get a contact |
|
|
175
|
+
| `sq.contacts.update(id, body)` | `PATCH /contacts/{id}` | Update a contact |
|
|
176
|
+
| `sq.contacts.addTags(id, body)` | `POST /contacts/{id}/tags` | Add tags to a contact |
|
|
177
|
+
| `sq.contacts.removeTags(id, body)` | `DELETE /contacts/{id}/tags` | Remove tags from a contact |
|
|
178
|
+
| `sq.contacts.listNotes(id)` | `GET /contacts/{id}/notes` | List contact notes |
|
|
179
|
+
| `sq.contacts.addNote(id, body)` | `POST /contacts/{id}/notes` | Add a note to a contact |
|
|
180
|
+
| `sq.contacts.enroll(id, body)` | `POST /contacts/{id}/enroll` | Enroll a contact in an automation |
|
|
181
|
+
| `sq.contacts.addMessage(id, body)` | `POST /contacts/{id}/messages` | Log a message on a contact's timeline |
|
|
182
|
+
|
|
183
|
+
### CRM Custom Fields
|
|
184
|
+
|
|
185
|
+
| Method | Endpoint | Description |
|
|
186
|
+
| --- | --- | --- |
|
|
187
|
+
| `sq.customFields.list()` | `GET /custom-fields` | List custom fields |
|
|
188
|
+
| `sq.customFields.create(body)` | `POST /custom-fields` | Create a custom field |
|
|
189
|
+
| `sq.customFields.delete(id)` | `DELETE /custom-fields/{id}` | Delete a custom field |
|
|
190
|
+
|
|
191
|
+
### CRM Opportunities
|
|
192
|
+
|
|
193
|
+
| Method | Endpoint | Description |
|
|
194
|
+
| --- | --- | --- |
|
|
195
|
+
| `sq.opportunities.listPipelines()` | `GET /pipelines` | List pipelines |
|
|
196
|
+
| `sq.opportunities.createPipeline(body)` | `POST /pipelines` | Create a pipeline |
|
|
197
|
+
| `sq.opportunities.list(query?)` | `GET /opportunities` | List opportunities |
|
|
198
|
+
| `sq.opportunities.create(body)` | `POST /opportunities` | Create an opportunity |
|
|
199
|
+
| `sq.opportunities.get(id)` | `GET /opportunities/{id}` | Get an opportunity |
|
|
200
|
+
| `sq.opportunities.update(id, body)` | `PATCH /opportunities/{id}` | Update an opportunity |
|
|
201
|
+
| `sq.opportunities.delete(id)` | `DELETE /opportunities/{id}` | Delete an opportunity |
|
|
202
|
+
| `sq.opportunities.updateStatus(id, body)` | `POST /opportunities/{id}/status` | Update opportunity status |
|
|
203
|
+
|
|
204
|
+
### Direct Messages
|
|
205
|
+
|
|
206
|
+
| Method | Endpoint | Description |
|
|
207
|
+
| --- | --- | --- |
|
|
208
|
+
| `sq.messages.listConversations(query?)` | `GET /social/conversations` | List DM conversations |
|
|
209
|
+
| `sq.messages.list(conversationId, query?)` | `GET /social/conversations/{conversation_id}/messages` | List messages in a conversation |
|
|
210
|
+
| `sq.messages.send(conversationId, body)` | `POST /social/conversations/{conversation_id}/messages` | Send a direct message |
|
|
211
|
+
| `sq.messages.markConversationRead(conversationId)` | `POST /social/conversations/{conversation_id}/read` | Mark a conversation read |
|
|
212
|
+
|
|
213
|
+
### Images
|
|
214
|
+
|
|
215
|
+
| Method | Endpoint | Description |
|
|
216
|
+
| --- | --- | --- |
|
|
217
|
+
| `sq.images.generate(body)` | `POST /images/generate` | Generate image |
|
|
218
|
+
| `sq.images.list(query?)` | `GET /images` | List images |
|
|
219
|
+
| `sq.images.get(imageId)` | `GET /images/{image_id}` | Get image |
|
|
220
|
+
| `sq.images.delete(imageId)` | `DELETE /images/{image_id}` | Delete image |
|
|
221
|
+
|
|
222
|
+
### Jobs
|
|
223
|
+
|
|
224
|
+
| Method | Endpoint | Description |
|
|
225
|
+
| --- | --- | --- |
|
|
226
|
+
| `sq.jobs.list(query?)` | `GET /jobs` | List jobs |
|
|
227
|
+
| `sq.jobs.get(jobId)` | `GET /jobs/{job_id}` | Get job |
|
|
228
|
+
| `sq.jobs.cancel(jobId, body?)` | `POST /jobs/{job_id}/cancel` | Cancel job |
|
|
229
|
+
|
|
230
|
+
### Media
|
|
231
|
+
|
|
232
|
+
| Method | Endpoint | Description |
|
|
233
|
+
| --- | --- | --- |
|
|
234
|
+
| `sq.media.list(query?)` | `GET /media` | List media |
|
|
235
|
+
| `sq.media.get(mediaId)` | `GET /media/{media_id}` | Get media |
|
|
236
|
+
| `sq.media.delete(mediaId)` | `DELETE /media/{media_id}` | Delete media |
|
|
237
|
+
| `sq.media.getUploadUrl(body)` | `POST /media/upload-url` | Get presigned upload URL |
|
|
238
|
+
|
|
239
|
+
### Presentations
|
|
240
|
+
|
|
241
|
+
| Method | Endpoint | Description |
|
|
242
|
+
| --- | --- | --- |
|
|
243
|
+
| `sq.presentations.generate(body)` | `POST /presentations/generate` | Generate presentation |
|
|
244
|
+
| `sq.presentations.list(query?)` | `GET /presentations` | List presentations |
|
|
245
|
+
| `sq.presentations.get(presentationId)` | `GET /presentations/{presentation_id}` | Get presentation |
|
|
246
|
+
| `sq.presentations.delete(presentationId)` | `DELETE /presentations/{presentation_id}` | Delete presentation |
|
|
247
|
+
|
|
248
|
+
### Profiles
|
|
249
|
+
|
|
250
|
+
| Method | Endpoint | Description |
|
|
251
|
+
| --- | --- | --- |
|
|
252
|
+
| `sq.profiles.list(query?)` | `GET /profiles` | List profiles |
|
|
253
|
+
| `sq.profiles.create(body)` | `POST /profiles` | Create a profile |
|
|
254
|
+
| `sq.profiles.get(id)` | `GET /profiles/{id}` | Get a profile |
|
|
255
|
+
| `sq.profiles.delete(id, body)` | `DELETE /profiles/{id}` | Delete a profile |
|
|
256
|
+
| `sq.profiles.listAccounts(id)` | `GET /profiles/{id}/accounts` | List a profile's connected accounts |
|
|
257
|
+
| `sq.profiles.pause(id)` | `POST /profiles/{id}/pause` | Pause a profile |
|
|
258
|
+
| `sq.profiles.resume(id)` | `POST /profiles/{id}/resume` | Resume a profile |
|
|
259
|
+
| `sq.profiles.createConnectLink(id, body?)` | `POST /profiles/{id}/connect-link` | Create a hosted connect link |
|
|
260
|
+
| `sq.profiles.createConnectUrl(id, platform, body?)` | `POST /profiles/{id}/connect/{platform}` | Get a raw connect URL for one platform |
|
|
261
|
+
| `sq.profiles.getAccountBilling()` | `GET /me/account-billing` | Account billing summary |
|
|
262
|
+
|
|
263
|
+
### SEO
|
|
264
|
+
|
|
265
|
+
| Method | Endpoint | Description |
|
|
266
|
+
| --- | --- | --- |
|
|
267
|
+
| `sq.seo.keywordResearch(body)` | `POST /seo/keyword-research` | Keyword research |
|
|
268
|
+
| `sq.seo.serp(body)` | `POST /seo/serp` | Live SERP lookup |
|
|
269
|
+
| `sq.seo.keywordDifficulty(body)` | `POST /seo/keyword-difficulty` | Keyword difficulty |
|
|
270
|
+
| `sq.seo.rankedKeywords(body)` | `POST /seo/ranked-keywords` | Ranked keywords (rank tracking) |
|
|
271
|
+
| `sq.seo.domainOverview(body)` | `POST /seo/domain-overview` | Domain rank overview |
|
|
272
|
+
| `sq.seo.competitors(body)` | `POST /seo/competitors` | Organic competitors |
|
|
273
|
+
| `sq.seo.backlinksSummary(body)` | `POST /seo/backlinks-summary` | Backlink profile summary |
|
|
274
|
+
| `sq.seo.audit(body)` | `POST /seo/audit` | On-page SEO audit |
|
|
275
|
+
| `sq.seo.backlinkProspects(body)` | `POST /seo/backlink-prospects` | Backlink prospects (link gap) |
|
|
276
|
+
| `sq.seo.referringDomains(body)` | `POST /seo/referring-domains` | Referring domains |
|
|
277
|
+
| `sq.seo.backlinkAnchors(body)` | `POST /seo/backlink-anchors` | Backlink anchors |
|
|
278
|
+
| `sq.seo.spamScore(body)` | `POST /seo/spam-score` | Backlink spam score |
|
|
279
|
+
| `sq.seo.rankHistory(body)` | `POST /seo/rank-history` | Historical rank overview |
|
|
280
|
+
| `sq.seo.siteAudit(body)` | `POST /seo/site-audit` | Deep site audit |
|
|
281
|
+
| `sq.seo.brandLookup(body)` | `POST /seo/brand-lookup` | AI Visibility: brand lookup |
|
|
282
|
+
| `sq.seo.promptExplorer(body)` | `POST /seo/prompt-explorer` | AI Visibility: prompt explorer |
|
|
283
|
+
| `sq.seo.aiAudit(body)` | `POST /seo/ai-audit` | AI Visibility Audit (async) |
|
|
284
|
+
|
|
285
|
+
### Shorts
|
|
286
|
+
|
|
287
|
+
| Method | Endpoint | Description |
|
|
288
|
+
| --- | --- | --- |
|
|
289
|
+
| `sq.shorts.generate(body?)` | `POST /shorts/generate` | Generate viral shorts from a long video |
|
|
290
|
+
| `sq.shorts.list(query?)` | `GET /shorts` | List shorts jobs |
|
|
291
|
+
| `sq.shorts.get(uid)` | `GET /shorts/{uid}` | Get shorts job + clips |
|
|
292
|
+
|
|
293
|
+
### Social
|
|
294
|
+
|
|
295
|
+
| Method | Endpoint | Description |
|
|
296
|
+
| --- | --- | --- |
|
|
297
|
+
| `sq.social.listAccounts()` | `GET /social/accounts` | List social accounts |
|
|
298
|
+
| `sq.social.listPosts(query?)` | `GET /social/posts` | List social posts |
|
|
299
|
+
| `sq.social.createPost(body)` | `POST /social/posts` | Create post (publish immediately) |
|
|
300
|
+
| `sq.social.schedulePost(body)` | `POST /social/posts/schedule` | Schedule post |
|
|
301
|
+
| `sq.social.getPost(postId)` | `GET /social/posts/{post_id}` | Get social post |
|
|
302
|
+
| `sq.social.updatePost(postId, body)` | `PATCH /social/posts/{post_id}` | Update social post |
|
|
303
|
+
| `sq.social.deletePost(postId)` | `DELETE /social/posts/{post_id}` | Delete social post |
|
|
304
|
+
| `sq.social.disconnectAccount(accountId)` | `DELETE /social/accounts/{account_id}` | Disconnect a social account |
|
|
305
|
+
| `sq.social.getAccountHealth(accountId)` | `GET /social/accounts/{account_id}/health` | Account health |
|
|
306
|
+
| `sq.social.getAccountReconnectUrl(accountId)` | `GET /social/accounts/{account_id}/reconnect-url` | Account reconnect URL |
|
|
307
|
+
| `sq.social.pauseAccount(accountId)` | `POST /social/accounts/{account_id}/pause` | Pause posting to an account |
|
|
308
|
+
| `sq.social.resumeAccount(accountId)` | `POST /social/accounts/{account_id}/resume` | Resume posting to an account |
|
|
309
|
+
| `sq.social.retryPost(postId, body)` | `POST /social/posts/{post_id}/retry` | Retry publishing a post |
|
|
310
|
+
| `sq.social.connectAccountStatus(platform)` | `GET /social/connect/{platform}` | Poll headless connection status |
|
|
311
|
+
| `sq.social.connectAccount(platform, body?)` | `POST /social/connect/{platform}` | Start headless account connection |
|
|
312
|
+
|
|
313
|
+
### URLs
|
|
314
|
+
|
|
315
|
+
| Method | Endpoint | Description |
|
|
316
|
+
| --- | --- | --- |
|
|
317
|
+
| `sq.urls.shorten(body)` | `POST /urls/shorten` | Shorten URL |
|
|
318
|
+
| `sq.urls.list(query?)` | `GET /urls` | List short URLs |
|
|
319
|
+
| `sq.urls.get(urlId)` | `GET /urls/{url_id}` | Get short URL |
|
|
320
|
+
| `sq.urls.delete(urlId)` | `DELETE /urls/{url_id}` | Delete short URL |
|
|
321
|
+
| `sq.urls.getStats(urlId)` | `GET /urls/{url_id}/stats` | Get short URL stats |
|
|
322
|
+
|
|
323
|
+
### Videos
|
|
324
|
+
|
|
325
|
+
| Method | Endpoint | Description |
|
|
326
|
+
| --- | --- | --- |
|
|
327
|
+
| `sq.videos.listModels()` | `GET /videos/models` | List available video models |
|
|
328
|
+
| `sq.videos.generate(body)` | `POST /videos/generate` | Generate video |
|
|
329
|
+
| `sq.videos.list(query?)` | `GET /videos` | List videos |
|
|
330
|
+
| `sq.videos.get(videoId)` | `GET /videos/{video_id}` | Get video |
|
|
331
|
+
| `sq.videos.delete(videoId)` | `DELETE /videos/{video_id}` | Delete video |
|
|
332
|
+
| `sq.videos.generateHook(body?)` | `POST /videos/hook` | Generate a viral hook line |
|
|
333
|
+
| `sq.videos.suggestBroll(body)` | `POST /videos/broll-suggest` | Suggest B-roll moments |
|
|
334
|
+
| `sq.videos.suggestEmphasis(body)` | `POST /videos/emphasis` | Suggest on-screen emphasis |
|
|
335
|
+
| `sq.videos.generateViralThumbnail(body)` | `POST /videos/viral-thumbnail` | Generate a viral thumbnail |
|
|
336
|
+
|
|
337
|
+
### Webhooks
|
|
338
|
+
|
|
339
|
+
| Method | Endpoint | Description |
|
|
340
|
+
| --- | --- | --- |
|
|
341
|
+
| `sq.webhooks.list()` | `GET /webhooks` | List webhooks |
|
|
342
|
+
| `sq.webhooks.create(body)` | `POST /webhooks` | Create webhook |
|
|
343
|
+
| `sq.webhooks.delete(id)` | `DELETE /webhooks/{id}` | Delete webhook |
|
|
344
|
+
|
|
345
|
+
### Workspaces
|
|
346
|
+
|
|
347
|
+
| Method | Endpoint | Description |
|
|
348
|
+
| --- | --- | --- |
|
|
349
|
+
| `sq.workspaces.list()` | `GET /workspaces` | List workspaces (sub-accounts) |
|
|
350
|
+
| `sq.workspaces.create(body)` | `POST /workspaces` | Create a workspace (sub-account) |
|
|
351
|
+
| `sq.workspaces.bulkAction(body)` | `POST /workspaces/bulk` | Bulk sub-account action |
|
|
352
|
+
| `sq.workspaces.get(id)` | `GET /workspaces/{id}` | Get a workspace (sub-account) |
|
|
353
|
+
| `sq.workspaces.delete(id, body)` | `DELETE /workspaces/{id}` | Delete a workspace (sub-account) |
|
|
354
|
+
| `sq.workspaces.disableSaas(id, body?)` | `POST /workspaces/{id}/disable-saas` | Disable SaaS mode for a workspace |
|
|
355
|
+
| `sq.workspaces.pause(id)` | `POST /workspaces/{id}/pause` | Pause (suspend) a workspace |
|
|
356
|
+
| `sq.workspaces.resume(id)` | `POST /workspaces/{id}/resume` | Resume a paused workspace |
|
|
357
|
+
| `sq.workspaces.getSubscription(id)` | `GET /workspaces/{id}/subscription` | Get a sub-account's subscription |
|
|
358
|
+
| `sq.workspaces.getWallet(id)` | `GET /workspaces/{id}/wallet` | Get a sub-account's wallet balance |
|
|
359
|
+
| `sq.workspaces.listSaasPlans()` | `GET /saas/plans` | List SaaS plans |
|
|
360
|
+
| `sq.workspaces.getSaasPlan(id)` | `GET /saas/plans/{id}` | Get a SaaS plan |
|
|
361
|
+
<!-- END GENERATED REFERENCE -->
|
|
362
|
+
|
|
363
|
+
## Regeneration
|
|
364
|
+
|
|
365
|
+
This SDK is generated from the [SmartlyQ OpenAPI spec](https://docs.smartlyq.com). When the spec changes, CI regenerates the client, README, and tests, bumps the version, and publishes to npm automatically.
|
|
366
|
+
|
|
367
|
+
## License
|
|
368
|
+
|
|
369
|
+
MIT
|