Create Publish Flow
Interface description: Create a multi-platform publishing Flow; one request can create multiple single-platform tasks.
Before calling this endpoint, read the complete publishing flow guide. items[n].accountId must come from the account list endpoint. content.media[n].url must be a real, publicly accessible media URL; do not copy the placeholder from the example. We recommend following the asset upload guide: generate an upload signature, upload the file, confirm the upload, then use the confirmation response data.url. You may also use another real media URL that the service can access and parse directly. An inaccessible or unparseable URL returns 15051 (media_unreachable). publishAt must be a future ISO 8601 timestamp. After success, use data.flowId to query the flow and data.tasks[n].id to publish now, retry, cancel, or update the publish time. This endpoint creates real publishing tasks, so verify the parameters before sending.
Quota: Publishing API calls across all platforms share a total allowance of 1,000 free calls per month, and the allowance resets monthly. Check your current usage and remaining allowance on the China site API Key page or the international site API Key page. X/Twitter publishing counts toward this allowance and also incurs an additional fee charged by X/Twitter; see Social Publishing pricing for details. Support for overage API requests will be added; once available, they will be charged at 1.5 credits per request.
curl --request POST \
--url https://aitoearn.cn/api/v2/channels/publish/flows \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"content": {
"title": "publish-demo-video",
"body": "Publish a video using the AiToEarn API.",
"media": [
{
"url": "https://assets.aitoearn.cn/6a3b48b5ec793a848a671de1/ai/video/doubao-seedance-2-0-260128/202607/I-lRTCBUkjE43NRd77eWC.mp4"
}
],
"cover": {
"url": "https://assets.aitoearn.cn/6a3b48b5ec793a848a671de1/ai/images/gpt-image-2/202607/GlhuS1TEyXtDAyumLezfo.png"
}
},
"publishAt": "2030-01-01T00:00:00.000Z",
"items": [
{
"platform": "douyin",
"accountId": "account-id-from-accounts-list"
}
]
}
'import requests
url = "https://aitoearn.cn/api/v2/channels/publish/flows"
payload = {
"content": {
"title": "publish-demo-video",
"body": "Publish a video using the AiToEarn API.",
"media": [{ "url": "https://assets.aitoearn.cn/6a3b48b5ec793a848a671de1/ai/video/doubao-seedance-2-0-260128/202607/I-lRTCBUkjE43NRd77eWC.mp4" }],
"cover": { "url": "https://assets.aitoearn.cn/6a3b48b5ec793a848a671de1/ai/images/gpt-image-2/202607/GlhuS1TEyXtDAyumLezfo.png" }
},
"publishAt": "2030-01-01T00:00:00.000Z",
"items": [
{
"platform": "douyin",
"accountId": "account-id-from-accounts-list"
}
]
}
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
content: {
title: 'publish-demo-video',
body: JSON.stringify('Publish a video using the AiToEarn API.'),
media: [
{
url: 'https://assets.aitoearn.cn/6a3b48b5ec793a848a671de1/ai/video/doubao-seedance-2-0-260128/202607/I-lRTCBUkjE43NRd77eWC.mp4'
}
],
cover: {
url: 'https://assets.aitoearn.cn/6a3b48b5ec793a848a671de1/ai/images/gpt-image-2/202607/GlhuS1TEyXtDAyumLezfo.png'
}
},
publishAt: '2030-01-01T00:00:00.000Z',
items: [{platform: 'douyin', accountId: 'account-id-from-accounts-list'}]
})
};
fetch('https://aitoearn.cn/api/v2/channels/publish/flows', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://aitoearn.cn/api/v2/channels/publish/flows"
payload := strings.NewReader("{\n \"content\": {\n \"title\": \"publish-demo-video\",\n \"body\": \"Publish a video using the AiToEarn API.\",\n \"media\": [\n {\n \"url\": \"https://assets.aitoearn.cn/6a3b48b5ec793a848a671de1/ai/video/doubao-seedance-2-0-260128/202607/I-lRTCBUkjE43NRd77eWC.mp4\"\n }\n ],\n \"cover\": {\n \"url\": \"https://assets.aitoearn.cn/6a3b48b5ec793a848a671de1/ai/images/gpt-image-2/202607/GlhuS1TEyXtDAyumLezfo.png\"\n }\n },\n \"publishAt\": \"2030-01-01T00:00:00.000Z\",\n \"items\": [\n {\n \"platform\": \"douyin\",\n \"accountId\": \"account-id-from-accounts-list\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Api-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"code": 0,
"message": "Request succeeded",
"data": {
"flowId": "string",
"tasks": [
{
"id": "string",
"accountId": "string",
"platform": "string",
"status": "number",
"publishTime": "string",
"platformWorkId": "string",
"workLink": "string",
"linkStatus": "string",
"linkError": "string",
"linkMeta": "object",
"errorMsg": "string"
}
]
},
"requestId": "string"
}Authorizations
Need to get API Key from AiToEarn. Click to go to "API Key Obtaining Tutorial".
Body
Share content across platforms
Hide child attributes
Hide child attributes
title
text
Main media list
Hide child attributes
Hide child attributes
Media URL
cover
Hide child attributes
Hide child attributes
Cover URL
Target release time
Platform release items
1- Option 1
- Option 2
- Option 3
- Option 4
- Option 5
- Option 6
- Option 7
- Option 8
- Option 9
- Option 10
- Option 11
- Option 12
- Option 13
- Option 14
Hide child attributes
Hide child attributes
platform
bilibili Bilibili publishing options
- Option 1
- Option 2
Hide child attributes
Hide child attributes
Partition ID
0 < x <= 9007199254740991Whether to allow reprinting 0-allowed, 1-not allowed
0, 1 Topic ID
0 < x <= 9007199254740991Submission activity ID
0 < x <= 90071992547409911-original, 2-reprinted
1 Reprint source
Account ID
Platform coverage
Hide child attributes
Hide child attributes
title override
Text coverage
Main media list coverage
Hide child attributes
Hide child attributes
Media URL
Cover coverage, passing null means clearing the cover
Hide child attributes
Hide child attributes
Cover URL
External flow ID
Response
The request has been processed by the service. Business success is determined by whether the response body has code === 0.
Business status code. 0 means success; non-zero means a business error.
Response message.
Hide child attributes
Hide child attributes
Hide child attributes
Hide child attributes
Request ID.
Error response timestamp in Unix milliseconds.
curl --request POST \
--url https://aitoearn.cn/api/v2/channels/publish/flows \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"content": {
"title": "publish-demo-video",
"body": "Publish a video using the AiToEarn API.",
"media": [
{
"url": "https://assets.aitoearn.cn/6a3b48b5ec793a848a671de1/ai/video/doubao-seedance-2-0-260128/202607/I-lRTCBUkjE43NRd77eWC.mp4"
}
],
"cover": {
"url": "https://assets.aitoearn.cn/6a3b48b5ec793a848a671de1/ai/images/gpt-image-2/202607/GlhuS1TEyXtDAyumLezfo.png"
}
},
"publishAt": "2030-01-01T00:00:00.000Z",
"items": [
{
"platform": "douyin",
"accountId": "account-id-from-accounts-list"
}
]
}
'import requests
url = "https://aitoearn.cn/api/v2/channels/publish/flows"
payload = {
"content": {
"title": "publish-demo-video",
"body": "Publish a video using the AiToEarn API.",
"media": [{ "url": "https://assets.aitoearn.cn/6a3b48b5ec793a848a671de1/ai/video/doubao-seedance-2-0-260128/202607/I-lRTCBUkjE43NRd77eWC.mp4" }],
"cover": { "url": "https://assets.aitoearn.cn/6a3b48b5ec793a848a671de1/ai/images/gpt-image-2/202607/GlhuS1TEyXtDAyumLezfo.png" }
},
"publishAt": "2030-01-01T00:00:00.000Z",
"items": [
{
"platform": "douyin",
"accountId": "account-id-from-accounts-list"
}
]
}
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
content: {
title: 'publish-demo-video',
body: JSON.stringify('Publish a video using the AiToEarn API.'),
media: [
{
url: 'https://assets.aitoearn.cn/6a3b48b5ec793a848a671de1/ai/video/doubao-seedance-2-0-260128/202607/I-lRTCBUkjE43NRd77eWC.mp4'
}
],
cover: {
url: 'https://assets.aitoearn.cn/6a3b48b5ec793a848a671de1/ai/images/gpt-image-2/202607/GlhuS1TEyXtDAyumLezfo.png'
}
},
publishAt: '2030-01-01T00:00:00.000Z',
items: [{platform: 'douyin', accountId: 'account-id-from-accounts-list'}]
})
};
fetch('https://aitoearn.cn/api/v2/channels/publish/flows', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://aitoearn.cn/api/v2/channels/publish/flows"
payload := strings.NewReader("{\n \"content\": {\n \"title\": \"publish-demo-video\",\n \"body\": \"Publish a video using the AiToEarn API.\",\n \"media\": [\n {\n \"url\": \"https://assets.aitoearn.cn/6a3b48b5ec793a848a671de1/ai/video/doubao-seedance-2-0-260128/202607/I-lRTCBUkjE43NRd77eWC.mp4\"\n }\n ],\n \"cover\": {\n \"url\": \"https://assets.aitoearn.cn/6a3b48b5ec793a848a671de1/ai/images/gpt-image-2/202607/GlhuS1TEyXtDAyumLezfo.png\"\n }\n },\n \"publishAt\": \"2030-01-01T00:00:00.000Z\",\n \"items\": [\n {\n \"platform\": \"douyin\",\n \"accountId\": \"account-id-from-accounts-list\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Api-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"code": 0,
"message": "Request succeeded",
"data": {
"flowId": "string",
"tasks": [
{
"id": "string",
"accountId": "string",
"platform": "string",
"status": "number",
"publishTime": "string",
"platformWorkId": "string",
"workLink": "string",
"linkStatus": "string",
"linkError": "string",
"linkMeta": "object",
"errorMsg": "string"
}
]
},
"requestId": "string"
}
