Publishing
Publish media
Publish a finished media container to your Instagram account.
POST
/
meta
/
v25.0
/
{instagramAccountId}
/
media_publish
Publish media
curl --request POST \
--url https://gateway.hookmyapp.com/meta/v25.0/{instagramAccountId}/media_publish \
--header 'Content-Type: application/json' \
--data '
{
"creation_id": "<string>"
}
'import requests
url = "https://gateway.hookmyapp.com/meta/v25.0/{instagramAccountId}/media_publish"
payload = { "creation_id": "<string>" }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({creation_id: '<string>'})
};
fetch('https://gateway.hookmyapp.com/meta/v25.0/{instagramAccountId}/media_publish', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://gateway.hookmyapp.com/meta/v25.0/{instagramAccountId}/media_publish",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'creation_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://gateway.hookmyapp.com/meta/v25.0/{instagramAccountId}/media_publish"
payload := strings.NewReader("{\n \"creation_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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))
}HttpResponse<String> response = Unirest.post("https://gateway.hookmyapp.com/meta/v25.0/{instagramAccountId}/media_publish")
.header("Content-Type", "application/json")
.body("{\n \"creation_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://gateway.hookmyapp.com/meta/v25.0/{instagramAccountId}/media_publish")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"creation_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyStep 3 of the publish flow. Publishes a container whose
The returned ID is the published media ID — use it for media insights and comments.
status_code is FINISHED.
Meta allows 50 publishes per rolling 24 hours, currently being raised to 100. Check live usage with GET /{instagramAccountId}/content_publishing_limit.
Authentication
Use thehmat_ channel token from GET /meta/channels/{id}/token or hookmyapp channels env <channel>. Do not use an hmok_ API key for this call.
Authorization: Bearer hmat_...
Path parameters
string
required
The connected Instagram account ID.
Request body
string
required
The
FINISHED container ID.Example
curl -X POST "https://gateway.hookmyapp.com/meta/v25.0/{INSTAGRAM_ACCOUNT_ID}/media_publish" \
-H "Authorization: Bearer hmat_..." \
-H "Content-Type: application/json" \
-d '{ "creation_id": "17900000000000001" }'
Successful response
{ "id": "17850000000000000" }
⌘I
Publish media
curl --request POST \
--url https://gateway.hookmyapp.com/meta/v25.0/{instagramAccountId}/media_publish \
--header 'Content-Type: application/json' \
--data '
{
"creation_id": "<string>"
}
'import requests
url = "https://gateway.hookmyapp.com/meta/v25.0/{instagramAccountId}/media_publish"
payload = { "creation_id": "<string>" }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({creation_id: '<string>'})
};
fetch('https://gateway.hookmyapp.com/meta/v25.0/{instagramAccountId}/media_publish', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://gateway.hookmyapp.com/meta/v25.0/{instagramAccountId}/media_publish",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'creation_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://gateway.hookmyapp.com/meta/v25.0/{instagramAccountId}/media_publish"
payload := strings.NewReader("{\n \"creation_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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))
}HttpResponse<String> response = Unirest.post("https://gateway.hookmyapp.com/meta/v25.0/{instagramAccountId}/media_publish")
.header("Content-Type", "application/json")
.body("{\n \"creation_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://gateway.hookmyapp.com/meta/v25.0/{instagramAccountId}/media_publish")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"creation_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body