Postia API
PT
Consola

Referência da API

URL base: https://pub.postia.app/v1

Envie a sua chave como Authorization: Bearer KEY. As descrições abaixo provêm do documento OpenAPI e estão em inglês.

Documento OpenAPI

Conta

GET/v1/me

The key, its account, its rate and its credits

Needs no scope.

Scope: Sem scope necessário

curl -X GET https://pub.postia.app/v1/me \
  -H "Authorization: Bearer $POSTIA_API_KEY"
const res = await fetch("https://pub.postia.app/v1/me", {
  method: "GET",
  headers: {
    Authorization: `Bearer ${process.env.POSTIA_API_KEY}`,
  },
});
const data = await res.json();
import os, requests

res = requests.get(
    "https://pub.postia.app/v1/me",
    headers={
        "Authorization": f"Bearer {os.environ['POSTIA_API_KEY']}",
    },
)
data = res.json()
using System.Net.Http.Headers;

var http = new HttpClient();
http.DefaultRequestHeaders.Authorization =
    new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("POSTIA_API_KEY"));
var req = new HttpRequestMessage(HttpMethod.Get, "https://pub.postia.app/v1/me");
var res = await http.SendAsync(req);
var data = await res.Content.ReadAsStringAsync();
import java.net.URI;
import java.net.http.*;

var req = HttpRequest.newBuilder(URI.create("https://pub.postia.app/v1/me"))
    .header("Authorization", "Bearer " + System.getenv("POSTIA_API_KEY"))
    .method("GET", HttpRequest.BodyPublishers.noBody())
    .build();
var res = HttpClient.newHttpClient().send(req, HttpResponse.BodyHandlers.ofString());
String data = res.body();
<?php
$ch = curl_init('https://pub.postia.app/v1/me');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('POSTIA_API_KEY'),
    ],
]);
$data = json_decode(curl_exec($ch), true);
req, _ := http.NewRequest("GET", "https://pub.postia.app/v1/me", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("POSTIA_API_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
	panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
require 'net/http'
require 'json'

uri = URI('https://pub.postia.app/v1/me')
req = Net::HTTP::Get.new(uri)
req['Authorization'] = "Bearer #{ENV['POSTIA_API_KEY']}"
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |h| h.request(req) }
data = JSON.parse(res.body)

Resposta 200

The caller.

{
  "account": {
    "id": "0191c1a4-8e2b-7c3d-9a10-5b7c2f1d3e44",
    "status": "active"
  },
  "key": {
    "prefix": "pst_live_Ab12",
    "mode": "live",
    "scopes": [
      "posts:read",
      "posts:write"
    ],
    "expires_at": null
  },
  "limits": {
    "requests_per_second": 5
  },
  "credits": 20
}

GET/v1/channels

The channels connected to the key owner's Postia

Scope: channels:read

curl -X GET https://pub.postia.app/v1/channels \
  -H "Authorization: Bearer $POSTIA_API_KEY"
const res = await fetch("https://pub.postia.app/v1/channels", {
  method: "GET",
  headers: {
    Authorization: `Bearer ${process.env.POSTIA_API_KEY}`,
  },
});
const data = await res.json();
import os, requests

res = requests.get(
    "https://pub.postia.app/v1/channels",
    headers={
        "Authorization": f"Bearer {os.environ['POSTIA_API_KEY']}",
    },
)
data = res.json()
using System.Net.Http.Headers;

var http = new HttpClient();
http.DefaultRequestHeaders.Authorization =
    new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("POSTIA_API_KEY"));
var req = new HttpRequestMessage(HttpMethod.Get, "https://pub.postia.app/v1/channels");
var res = await http.SendAsync(req);
var data = await res.Content.ReadAsStringAsync();
import java.net.URI;
import java.net.http.*;

var req = HttpRequest.newBuilder(URI.create("https://pub.postia.app/v1/channels"))
    .header("Authorization", "Bearer " + System.getenv("POSTIA_API_KEY"))
    .method("GET", HttpRequest.BodyPublishers.noBody())
    .build();
var res = HttpClient.newHttpClient().send(req, HttpResponse.BodyHandlers.ofString());
String data = res.body();
<?php
$ch = curl_init('https://pub.postia.app/v1/channels');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('POSTIA_API_KEY'),
    ],
]);
$data = json_decode(curl_exec($ch), true);
req, _ := http.NewRequest("GET", "https://pub.postia.app/v1/channels", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("POSTIA_API_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
	panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
require 'net/http'
require 'json'

uri = URI('https://pub.postia.app/v1/channels')
req = Net::HTTP::Get.new(uri)
req['Authorization'] = "Bearer #{ENV['POSTIA_API_KEY']}"
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |h| h.request(req) }
data = JSON.parse(res.body)

Resposta 200

The channels, with the ids posts are sent to.

{
  "data": [
    {
      "channel_id": "0191c1a4-1111-7000-8000-000000000001",
      "network": "telegram",
      "title": "Postia news",
      "active": true
    }
  ]
}

Posts

GET/v1/posts

The posts, newest first

Pages are followed with next_cursor.

Scope: posts:read

Parâmetros

NomeEmTipoDescrição
limitqueryinteger
cursorquerystringThe next_cursor of the previous page. Opaque; one that was edited is a 400.
statusquerystring (draft, scheduled, publishing, published, partiallyFailed, failed, canceled)
qquerystringWords in the text or title.
curl -X GET https://pub.postia.app/v1/posts \
  -H "Authorization: Bearer $POSTIA_API_KEY"
const res = await fetch("https://pub.postia.app/v1/posts", {
  method: "GET",
  headers: {
    Authorization: `Bearer ${process.env.POSTIA_API_KEY}`,
  },
});
const data = await res.json();
import os, requests

res = requests.get(
    "https://pub.postia.app/v1/posts",
    headers={
        "Authorization": f"Bearer {os.environ['POSTIA_API_KEY']}",
    },
)
data = res.json()
using System.Net.Http.Headers;

var http = new HttpClient();
http.DefaultRequestHeaders.Authorization =
    new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("POSTIA_API_KEY"));
var req = new HttpRequestMessage(HttpMethod.Get, "https://pub.postia.app/v1/posts");
var res = await http.SendAsync(req);
var data = await res.Content.ReadAsStringAsync();
import java.net.URI;
import java.net.http.*;

var req = HttpRequest.newBuilder(URI.create("https://pub.postia.app/v1/posts"))
    .header("Authorization", "Bearer " + System.getenv("POSTIA_API_KEY"))
    .method("GET", HttpRequest.BodyPublishers.noBody())
    .build();
var res = HttpClient.newHttpClient().send(req, HttpResponse.BodyHandlers.ofString());
String data = res.body();
<?php
$ch = curl_init('https://pub.postia.app/v1/posts');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('POSTIA_API_KEY'),
    ],
]);
$data = json_decode(curl_exec($ch), true);
req, _ := http.NewRequest("GET", "https://pub.postia.app/v1/posts", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("POSTIA_API_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
	panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
require 'net/http'
require 'json'

uri = URI('https://pub.postia.app/v1/posts')
req = Net::HTTP::Get.new(uri)
req['Authorization'] = "Bearer #{ENV['POSTIA_API_KEY']}"
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |h| h.request(req) }
data = JSON.parse(res.body)

Resposta 200

A page of posts.

POST/v1/posts

Create a draft, or schedule or publish it in one call

Without schedule_at or publish the post is a draft. schedule_at and publish cannot be combined. If scheduling or publishing is refused (no channel, plan limit, a time in the past) no draft is left behind.

Scope: posts:write

Parâmetros

NomeEmTipoDescrição
Idempotency-Keyheaderstring1 to 255 characters. Kept for 24 hours.

Corpo do pedido

NomeTipoDescrição
textstring
titlestring/null
channel_idsarray
append_signatureboolean
signature_idstring/null (uuid)
watermark_idstring/null (uuid)
folder_idstring/null (uuid)
settingsarrayPer-network settings, layered over the channel defaults.
cross_postobject/null
repeatobject/null{"times": ["09:00"], "every": 1, "unit": "day"}.
channel_overridesarray
channel_set_idstring (uuid)
schedule_atstringISO 8601 with an offset.
publishboolean
curl -X POST https://pub.postia.app/v1/posts \
  -H "Authorization: Bearer $POSTIA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text": "Hello from the API", "channel_ids": ["0191c1a4-1111-7000-8000-000000000001"], "schedule_at": "2026-12-24T09:00:00Z"}'
const res = await fetch("https://pub.postia.app/v1/posts", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.POSTIA_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "text": "Hello from the API",
    "channel_ids": [
      "0191c1a4-1111-7000-8000-000000000001"
    ],
    "schedule_at": "2026-12-24T09:00:00Z"
  }),
});
const data = await res.json();
import os, requests

res = requests.post(
    "https://pub.postia.app/v1/posts",
    headers={
        "Authorization": f"Bearer {os.environ['POSTIA_API_KEY']}",
    },
    json={
        "text": "Hello from the API",
        "channel_ids": [
            "0191c1a4-1111-7000-8000-000000000001"
        ],
        "schedule_at": "2026-12-24T09:00:00Z"
    },
)
data = res.json()
using System.Net.Http.Headers;

var http = new HttpClient();
http.DefaultRequestHeaders.Authorization =
    new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("POSTIA_API_KEY"));
var req = new HttpRequestMessage(HttpMethod.Post, "https://pub.postia.app/v1/posts");
req.Content = new StringContent("{\"text\": \"Hello from the API\", \"channel_ids\": [\"0191c1a4-1111-7000-8000-000000000001\"], \"schedule_at\": \"2026-12-24T09:00:00Z\"}", System.Text.Encoding.UTF8, "application/json");
var res = await http.SendAsync(req);
var data = await res.Content.ReadAsStringAsync();
import java.net.URI;
import java.net.http.*;

var req = HttpRequest.newBuilder(URI.create("https://pub.postia.app/v1/posts"))
    .header("Authorization", "Bearer " + System.getenv("POSTIA_API_KEY"))
    .header("Content-Type", "application/json")
    .method("POST", HttpRequest.BodyPublishers.ofString("{\"text\": \"Hello from the API\", \"channel_ids\": [\"0191c1a4-1111-7000-8000-000000000001\"], \"schedule_at\": \"2026-12-24T09:00:00Z\"}"))
    .build();
var res = HttpClient.newHttpClient().send(req, HttpResponse.BodyHandlers.ofString());
String data = res.body();
<?php
$ch = curl_init('https://pub.postia.app/v1/posts');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('POSTIA_API_KEY'),
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => '{"text": "Hello from the API", "channel_ids": ["0191c1a4-1111-7000-8000-000000000001"], "schedule_at": "2026-12-24T09:00:00Z"}',
]);
$data = json_decode(curl_exec($ch), true);
req, _ := http.NewRequest("POST", "https://pub.postia.app/v1/posts", strings.NewReader(`{"text": "Hello from the API", "channel_ids": ["0191c1a4-1111-7000-8000-000000000001"], "schedule_at": "2026-12-24T09:00:00Z"}`))
req.Header.Set("Authorization", "Bearer "+os.Getenv("POSTIA_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
	panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
require 'net/http'
require 'json'

uri = URI('https://pub.postia.app/v1/posts')
req = Net::HTTP::Post.new(uri)
req['Authorization'] = "Bearer #{ENV['POSTIA_API_KEY']}"
req['Content-Type'] = 'application/json'
req.body = '{"text": "Hello from the API", "channel_ids": ["0191c1a4-1111-7000-8000-000000000001"], "schedule_at": "2026-12-24T09:00:00Z"}'
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |h| h.request(req) }
data = JSON.parse(res.body)

Resposta 201

The post.

GET/v1/posts/{post_id}

One post with its media and per-channel results

Scope: posts:read

Parâmetros

NomeEmTipoDescrição
post_id *pathstring (uuid)
curl -X GET https://pub.postia.app/v1/posts/POST_ID \
  -H "Authorization: Bearer $POSTIA_API_KEY"
const res = await fetch("https://pub.postia.app/v1/posts/POST_ID", {
  method: "GET",
  headers: {
    Authorization: `Bearer ${process.env.POSTIA_API_KEY}`,
  },
});
const data = await res.json();
import os, requests

res = requests.get(
    "https://pub.postia.app/v1/posts/POST_ID",
    headers={
        "Authorization": f"Bearer {os.environ['POSTIA_API_KEY']}",
    },
)
data = res.json()
using System.Net.Http.Headers;

var http = new HttpClient();
http.DefaultRequestHeaders.Authorization =
    new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("POSTIA_API_KEY"));
var req = new HttpRequestMessage(HttpMethod.Get, "https://pub.postia.app/v1/posts/POST_ID");
var res = await http.SendAsync(req);
var data = await res.Content.ReadAsStringAsync();
import java.net.URI;
import java.net.http.*;

var req = HttpRequest.newBuilder(URI.create("https://pub.postia.app/v1/posts/POST_ID"))
    .header("Authorization", "Bearer " + System.getenv("POSTIA_API_KEY"))
    .method("GET", HttpRequest.BodyPublishers.noBody())
    .build();
var res = HttpClient.newHttpClient().send(req, HttpResponse.BodyHandlers.ofString());
String data = res.body();
<?php
$ch = curl_init('https://pub.postia.app/v1/posts/POST_ID');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('POSTIA_API_KEY'),
    ],
]);
$data = json_decode(curl_exec($ch), true);
req, _ := http.NewRequest("GET", "https://pub.postia.app/v1/posts/POST_ID", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("POSTIA_API_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
	panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
require 'net/http'
require 'json'

uri = URI('https://pub.postia.app/v1/posts/POST_ID')
req = Net::HTTP::Get.new(uri)
req['Authorization'] = "Bearer #{ENV['POSTIA_API_KEY']}"
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |h| h.request(req) }
data = JSON.parse(res.body)

Resposta 200

The post.

PATCH/v1/posts/{post_id}

Change a draft

A field left out keeps what the post had; null clears title, signature_id, watermark_id, folder_id. Only drafts can be changed (422 otherwise).

Scope: posts:write

Parâmetros

NomeEmTipoDescrição
post_id *pathstring (uuid)
Idempotency-Keyheaderstring1 to 255 characters. Kept for 24 hours.

Corpo do pedido

NomeTipoDescrição
textstring
titlestring/null
channel_idsarray
append_signatureboolean
signature_idstring/null (uuid)
watermark_idstring/null (uuid)
folder_idstring/null (uuid)
settingsarrayPer-network settings, layered over the channel defaults.
cross_postobject/null
repeatobject/null{"times": ["09:00"], "every": 1, "unit": "day"}.
channel_overridesarray
curl -X PATCH https://pub.postia.app/v1/posts/POST_ID \
  -H "Authorization: Bearer $POSTIA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text": "Edited text"}'
const res = await fetch("https://pub.postia.app/v1/posts/POST_ID", {
  method: "PATCH",
  headers: {
    Authorization: `Bearer ${process.env.POSTIA_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "text": "Edited text"
  }),
});
const data = await res.json();
import os, requests

res = requests.patch(
    "https://pub.postia.app/v1/posts/POST_ID",
    headers={
        "Authorization": f"Bearer {os.environ['POSTIA_API_KEY']}",
    },
    json={
        "text": "Edited text"
    },
)
data = res.json()
using System.Net.Http.Headers;

var http = new HttpClient();
http.DefaultRequestHeaders.Authorization =
    new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("POSTIA_API_KEY"));
var req = new HttpRequestMessage(HttpMethod.Patch, "https://pub.postia.app/v1/posts/POST_ID");
req.Content = new StringContent("{\"text\": \"Edited text\"}", System.Text.Encoding.UTF8, "application/json");
var res = await http.SendAsync(req);
var data = await res.Content.ReadAsStringAsync();
import java.net.URI;
import java.net.http.*;

var req = HttpRequest.newBuilder(URI.create("https://pub.postia.app/v1/posts/POST_ID"))
    .header("Authorization", "Bearer " + System.getenv("POSTIA_API_KEY"))
    .header("Content-Type", "application/json")
    .method("PATCH", HttpRequest.BodyPublishers.ofString("{\"text\": \"Edited text\"}"))
    .build();
var res = HttpClient.newHttpClient().send(req, HttpResponse.BodyHandlers.ofString());
String data = res.body();
<?php
$ch = curl_init('https://pub.postia.app/v1/posts/POST_ID');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'PATCH',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('POSTIA_API_KEY'),
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => '{"text": "Edited text"}',
]);
$data = json_decode(curl_exec($ch), true);
req, _ := http.NewRequest("PATCH", "https://pub.postia.app/v1/posts/POST_ID", strings.NewReader(`{"text": "Edited text"}`))
req.Header.Set("Authorization", "Bearer "+os.Getenv("POSTIA_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
	panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
require 'net/http'
require 'json'

uri = URI('https://pub.postia.app/v1/posts/POST_ID')
req = Net::HTTP::Patch.new(uri)
req['Authorization'] = "Bearer #{ENV['POSTIA_API_KEY']}"
req['Content-Type'] = 'application/json'
req.body = '{"text": "Edited text"}'
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |h| h.request(req) }
data = JSON.parse(res.body)

Resposta 200

The post.

DELETE/v1/posts/{post_id}

Delete a post

Scope: posts:write

Parâmetros

NomeEmTipoDescrição
post_id *pathstring (uuid)
curl -X DELETE https://pub.postia.app/v1/posts/POST_ID \
  -H "Authorization: Bearer $POSTIA_API_KEY"
const res = await fetch("https://pub.postia.app/v1/posts/POST_ID", {
  method: "DELETE",
  headers: {
    Authorization: `Bearer ${process.env.POSTIA_API_KEY}`,
  },
});
const data = await res.json();
import os, requests

res = requests.delete(
    "https://pub.postia.app/v1/posts/POST_ID",
    headers={
        "Authorization": f"Bearer {os.environ['POSTIA_API_KEY']}",
    },
)
data = res.json()
using System.Net.Http.Headers;

var http = new HttpClient();
http.DefaultRequestHeaders.Authorization =
    new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("POSTIA_API_KEY"));
var req = new HttpRequestMessage(HttpMethod.Delete, "https://pub.postia.app/v1/posts/POST_ID");
var res = await http.SendAsync(req);
var data = await res.Content.ReadAsStringAsync();
import java.net.URI;
import java.net.http.*;

var req = HttpRequest.newBuilder(URI.create("https://pub.postia.app/v1/posts/POST_ID"))
    .header("Authorization", "Bearer " + System.getenv("POSTIA_API_KEY"))
    .method("DELETE", HttpRequest.BodyPublishers.noBody())
    .build();
var res = HttpClient.newHttpClient().send(req, HttpResponse.BodyHandlers.ofString());
String data = res.body();
<?php
$ch = curl_init('https://pub.postia.app/v1/posts/POST_ID');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'DELETE',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('POSTIA_API_KEY'),
    ],
]);
$data = json_decode(curl_exec($ch), true);
req, _ := http.NewRequest("DELETE", "https://pub.postia.app/v1/posts/POST_ID", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("POSTIA_API_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
	panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
require 'net/http'
require 'json'

uri = URI('https://pub.postia.app/v1/posts/POST_ID')
req = Net::HTTP::Delete.new(uri)
req['Authorization'] = "Bearer #{ENV['POSTIA_API_KEY']}"
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |h| h.request(req) }
data = JSON.parse(res.body)

Resposta 200

Deleted.

POST/v1/posts/{post_id}/publish

Send a draft out now

Delivery is asynchronous: read the post for per-channel results.

Scope: posts:write

Parâmetros

NomeEmTipoDescrição
post_id *pathstring (uuid)
Idempotency-Keyheaderstring1 to 255 characters. Kept for 24 hours.
curl -X POST https://pub.postia.app/v1/posts/POST_ID/publish \
  -H "Authorization: Bearer $POSTIA_API_KEY"
const res = await fetch("https://pub.postia.app/v1/posts/POST_ID/publish", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.POSTIA_API_KEY}`,
  },
});
const data = await res.json();
import os, requests

res = requests.post(
    "https://pub.postia.app/v1/posts/POST_ID/publish",
    headers={
        "Authorization": f"Bearer {os.environ['POSTIA_API_KEY']}",
    },
)
data = res.json()
using System.Net.Http.Headers;

var http = new HttpClient();
http.DefaultRequestHeaders.Authorization =
    new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("POSTIA_API_KEY"));
var req = new HttpRequestMessage(HttpMethod.Post, "https://pub.postia.app/v1/posts/POST_ID/publish");
var res = await http.SendAsync(req);
var data = await res.Content.ReadAsStringAsync();
import java.net.URI;
import java.net.http.*;

var req = HttpRequest.newBuilder(URI.create("https://pub.postia.app/v1/posts/POST_ID/publish"))
    .header("Authorization", "Bearer " + System.getenv("POSTIA_API_KEY"))
    .method("POST", HttpRequest.BodyPublishers.noBody())
    .build();
var res = HttpClient.newHttpClient().send(req, HttpResponse.BodyHandlers.ofString());
String data = res.body();
<?php
$ch = curl_init('https://pub.postia.app/v1/posts/POST_ID/publish');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('POSTIA_API_KEY'),
    ],
]);
$data = json_decode(curl_exec($ch), true);
req, _ := http.NewRequest("POST", "https://pub.postia.app/v1/posts/POST_ID/publish", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("POSTIA_API_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
	panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
require 'net/http'
require 'json'

uri = URI('https://pub.postia.app/v1/posts/POST_ID/publish')
req = Net::HTTP::Post.new(uri)
req['Authorization'] = "Bearer #{ENV['POSTIA_API_KEY']}"
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |h| h.request(req) }
data = JSON.parse(res.body)

Resposta 200

The post.

POST/v1/posts/{post_id}/schedule

Schedule a draft

Scope: posts:write

Parâmetros

NomeEmTipoDescrição
post_id *pathstring (uuid)
Idempotency-Keyheaderstring1 to 255 characters. Kept for 24 hours.

Corpo do pedido

NomeTipoDescrição
schedule_at *stringISO 8601 with an offset.
curl -X POST https://pub.postia.app/v1/posts/POST_ID/schedule \
  -H "Authorization: Bearer $POSTIA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"schedule_at": "2026-12-24T09:00:00Z"}'
const res = await fetch("https://pub.postia.app/v1/posts/POST_ID/schedule", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.POSTIA_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "schedule_at": "2026-12-24T09:00:00Z"
  }),
});
const data = await res.json();
import os, requests

res = requests.post(
    "https://pub.postia.app/v1/posts/POST_ID/schedule",
    headers={
        "Authorization": f"Bearer {os.environ['POSTIA_API_KEY']}",
    },
    json={
        "schedule_at": "2026-12-24T09:00:00Z"
    },
)
data = res.json()
using System.Net.Http.Headers;

var http = new HttpClient();
http.DefaultRequestHeaders.Authorization =
    new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("POSTIA_API_KEY"));
var req = new HttpRequestMessage(HttpMethod.Post, "https://pub.postia.app/v1/posts/POST_ID/schedule");
req.Content = new StringContent("{\"schedule_at\": \"2026-12-24T09:00:00Z\"}", System.Text.Encoding.UTF8, "application/json");
var res = await http.SendAsync(req);
var data = await res.Content.ReadAsStringAsync();
import java.net.URI;
import java.net.http.*;

var req = HttpRequest.newBuilder(URI.create("https://pub.postia.app/v1/posts/POST_ID/schedule"))
    .header("Authorization", "Bearer " + System.getenv("POSTIA_API_KEY"))
    .header("Content-Type", "application/json")
    .method("POST", HttpRequest.BodyPublishers.ofString("{\"schedule_at\": \"2026-12-24T09:00:00Z\"}"))
    .build();
var res = HttpClient.newHttpClient().send(req, HttpResponse.BodyHandlers.ofString());
String data = res.body();
<?php
$ch = curl_init('https://pub.postia.app/v1/posts/POST_ID/schedule');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('POSTIA_API_KEY'),
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => '{"schedule_at": "2026-12-24T09:00:00Z"}',
]);
$data = json_decode(curl_exec($ch), true);
req, _ := http.NewRequest("POST", "https://pub.postia.app/v1/posts/POST_ID/schedule", strings.NewReader(`{"schedule_at": "2026-12-24T09:00:00Z"}`))
req.Header.Set("Authorization", "Bearer "+os.Getenv("POSTIA_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
	panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
require 'net/http'
require 'json'

uri = URI('https://pub.postia.app/v1/posts/POST_ID/schedule')
req = Net::HTTP::Post.new(uri)
req['Authorization'] = "Bearer #{ENV['POSTIA_API_KEY']}"
req['Content-Type'] = 'application/json'
req.body = '{"schedule_at": "2026-12-24T09:00:00Z"}'
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |h| h.request(req) }
data = JSON.parse(res.body)

Resposta 200

The post.

Multimédia

POST/v1/media/uploads

Get a presigned URL to upload a file to a post

PUT the file's bytes to upload_url, then call /v1/media/uploads/{upload_id}/complete. Size limits are the app's.

Scope: media:write

Parâmetros

NomeEmTipoDescrição
Idempotency-Keyheaderstring1 to 255 characters. Kept for 24 hours.

Corpo do pedido

NomeTipoDescrição
post_id *string (uuid)
file_name *string
byte_sizeinteger
asstring (cover)A video's cover picture.
curl -X POST https://pub.postia.app/v1/media/uploads \
  -H "Authorization: Bearer $POSTIA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"post_id": "0191c1a4-8e2b-7c3d-9a10-5b7c2f1d3e44", "file_name": "photo.jpg"}'
const res = await fetch("https://pub.postia.app/v1/media/uploads", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.POSTIA_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "post_id": "0191c1a4-8e2b-7c3d-9a10-5b7c2f1d3e44",
    "file_name": "photo.jpg"
  }),
});
const data = await res.json();
import os, requests

res = requests.post(
    "https://pub.postia.app/v1/media/uploads",
    headers={
        "Authorization": f"Bearer {os.environ['POSTIA_API_KEY']}",
    },
    json={
        "post_id": "0191c1a4-8e2b-7c3d-9a10-5b7c2f1d3e44",
        "file_name": "photo.jpg"
    },
)
data = res.json()
using System.Net.Http.Headers;

var http = new HttpClient();
http.DefaultRequestHeaders.Authorization =
    new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("POSTIA_API_KEY"));
var req = new HttpRequestMessage(HttpMethod.Post, "https://pub.postia.app/v1/media/uploads");
req.Content = new StringContent("{\"post_id\": \"0191c1a4-8e2b-7c3d-9a10-5b7c2f1d3e44\", \"file_name\": \"photo.jpg\"}", System.Text.Encoding.UTF8, "application/json");
var res = await http.SendAsync(req);
var data = await res.Content.ReadAsStringAsync();
import java.net.URI;
import java.net.http.*;

var req = HttpRequest.newBuilder(URI.create("https://pub.postia.app/v1/media/uploads"))
    .header("Authorization", "Bearer " + System.getenv("POSTIA_API_KEY"))
    .header("Content-Type", "application/json")
    .method("POST", HttpRequest.BodyPublishers.ofString("{\"post_id\": \"0191c1a4-8e2b-7c3d-9a10-5b7c2f1d3e44\", \"file_name\": \"photo.jpg\"}"))
    .build();
var res = HttpClient.newHttpClient().send(req, HttpResponse.BodyHandlers.ofString());
String data = res.body();
<?php
$ch = curl_init('https://pub.postia.app/v1/media/uploads');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('POSTIA_API_KEY'),
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => '{"post_id": "0191c1a4-8e2b-7c3d-9a10-5b7c2f1d3e44", "file_name": "photo.jpg"}',
]);
$data = json_decode(curl_exec($ch), true);
req, _ := http.NewRequest("POST", "https://pub.postia.app/v1/media/uploads", strings.NewReader(`{"post_id": "0191c1a4-8e2b-7c3d-9a10-5b7c2f1d3e44", "file_name": "photo.jpg"}`))
req.Header.Set("Authorization", "Bearer "+os.Getenv("POSTIA_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
	panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
require 'net/http'
require 'json'

uri = URI('https://pub.postia.app/v1/media/uploads')
req = Net::HTTP::Post.new(uri)
req['Authorization'] = "Bearer #{ENV['POSTIA_API_KEY']}"
req['Content-Type'] = 'application/json'
req.body = '{"post_id": "0191c1a4-8e2b-7c3d-9a10-5b7c2f1d3e44", "file_name": "photo.jpg"}'
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |h| h.request(req) }
data = JSON.parse(res.body)

Resposta 201

Where to upload.

POST/v1/media/uploads/{upload_id}/complete

Attach an uploaded file to its post

Returns the post.

Scope: media:write

Parâmetros

NomeEmTipoDescrição
upload_id *pathstring
Idempotency-Keyheaderstring1 to 255 characters. Kept for 24 hours.

Corpo do pedido

NomeTipoDescrição
post_id *string (uuid)
asstring (cover)
altstring/null
file_namestring
curl -X POST https://pub.postia.app/v1/media/uploads/UPLOAD_ID/complete \
  -H "Authorization: Bearer $POSTIA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"post_id": "0191c1a4-8e2b-7c3d-9a10-5b7c2f1d3e44"}'
const res = await fetch("https://pub.postia.app/v1/media/uploads/UPLOAD_ID/complete", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.POSTIA_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "post_id": "0191c1a4-8e2b-7c3d-9a10-5b7c2f1d3e44"
  }),
});
const data = await res.json();
import os, requests

res = requests.post(
    "https://pub.postia.app/v1/media/uploads/UPLOAD_ID/complete",
    headers={
        "Authorization": f"Bearer {os.environ['POSTIA_API_KEY']}",
    },
    json={
        "post_id": "0191c1a4-8e2b-7c3d-9a10-5b7c2f1d3e44"
    },
)
data = res.json()
using System.Net.Http.Headers;

var http = new HttpClient();
http.DefaultRequestHeaders.Authorization =
    new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("POSTIA_API_KEY"));
var req = new HttpRequestMessage(HttpMethod.Post, "https://pub.postia.app/v1/media/uploads/UPLOAD_ID/complete");
req.Content = new StringContent("{\"post_id\": \"0191c1a4-8e2b-7c3d-9a10-5b7c2f1d3e44\"}", System.Text.Encoding.UTF8, "application/json");
var res = await http.SendAsync(req);
var data = await res.Content.ReadAsStringAsync();
import java.net.URI;
import java.net.http.*;

var req = HttpRequest.newBuilder(URI.create("https://pub.postia.app/v1/media/uploads/UPLOAD_ID/complete"))
    .header("Authorization", "Bearer " + System.getenv("POSTIA_API_KEY"))
    .header("Content-Type", "application/json")
    .method("POST", HttpRequest.BodyPublishers.ofString("{\"post_id\": \"0191c1a4-8e2b-7c3d-9a10-5b7c2f1d3e44\"}"))
    .build();
var res = HttpClient.newHttpClient().send(req, HttpResponse.BodyHandlers.ofString());
String data = res.body();
<?php
$ch = curl_init('https://pub.postia.app/v1/media/uploads/UPLOAD_ID/complete');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('POSTIA_API_KEY'),
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => '{"post_id": "0191c1a4-8e2b-7c3d-9a10-5b7c2f1d3e44"}',
]);
$data = json_decode(curl_exec($ch), true);
req, _ := http.NewRequest("POST", "https://pub.postia.app/v1/media/uploads/UPLOAD_ID/complete", strings.NewReader(`{"post_id": "0191c1a4-8e2b-7c3d-9a10-5b7c2f1d3e44"}`))
req.Header.Set("Authorization", "Bearer "+os.Getenv("POSTIA_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
	panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
require 'net/http'
require 'json'

uri = URI('https://pub.postia.app/v1/media/uploads/UPLOAD_ID/complete')
req = Net::HTTP::Post.new(uri)
req['Authorization'] = "Bearer #{ENV['POSTIA_API_KEY']}"
req['Content-Type'] = 'application/json'
req.body = '{"post_id": "0191c1a4-8e2b-7c3d-9a10-5b7c2f1d3e44"}'
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |h| h.request(req) }
data = JSON.parse(res.body)

Resposta 200

The post.

POST/v1/media/from_url

Attach a file the server downloads from a public https address

https on port 443 only. The name is resolved by Postia and every address must be public: loopback, private, link-local, carrier-grade NAT, multicast and cloud metadata addresses are refused (422), and so is any redirect to one. The file is held to the same size limit as an upload.

Scope: media:write

Parâmetros

NomeEmTipoDescrição
Idempotency-Keyheaderstring1 to 255 characters. Kept for 24 hours.

Corpo do pedido

NomeTipoDescrição
post_id *string (uuid)
url *string (uri)
altstring/null
curl -X POST https://pub.postia.app/v1/media/from_url \
  -H "Authorization: Bearer $POSTIA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"post_id": "0191c1a4-8e2b-7c3d-9a10-5b7c2f1d3e44", "url": "https://example.com/"}'
const res = await fetch("https://pub.postia.app/v1/media/from_url", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.POSTIA_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "post_id": "0191c1a4-8e2b-7c3d-9a10-5b7c2f1d3e44",
    "url": "https://example.com/"
  }),
});
const data = await res.json();
import os, requests

res = requests.post(
    "https://pub.postia.app/v1/media/from_url",
    headers={
        "Authorization": f"Bearer {os.environ['POSTIA_API_KEY']}",
    },
    json={
        "post_id": "0191c1a4-8e2b-7c3d-9a10-5b7c2f1d3e44",
        "url": "https://example.com/"
    },
)
data = res.json()
using System.Net.Http.Headers;

var http = new HttpClient();
http.DefaultRequestHeaders.Authorization =
    new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("POSTIA_API_KEY"));
var req = new HttpRequestMessage(HttpMethod.Post, "https://pub.postia.app/v1/media/from_url");
req.Content = new StringContent("{\"post_id\": \"0191c1a4-8e2b-7c3d-9a10-5b7c2f1d3e44\", \"url\": \"https://example.com/\"}", System.Text.Encoding.UTF8, "application/json");
var res = await http.SendAsync(req);
var data = await res.Content.ReadAsStringAsync();
import java.net.URI;
import java.net.http.*;

var req = HttpRequest.newBuilder(URI.create("https://pub.postia.app/v1/media/from_url"))
    .header("Authorization", "Bearer " + System.getenv("POSTIA_API_KEY"))
    .header("Content-Type", "application/json")
    .method("POST", HttpRequest.BodyPublishers.ofString("{\"post_id\": \"0191c1a4-8e2b-7c3d-9a10-5b7c2f1d3e44\", \"url\": \"https://example.com/\"}"))
    .build();
var res = HttpClient.newHttpClient().send(req, HttpResponse.BodyHandlers.ofString());
String data = res.body();
<?php
$ch = curl_init('https://pub.postia.app/v1/media/from_url');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('POSTIA_API_KEY'),
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => '{"post_id": "0191c1a4-8e2b-7c3d-9a10-5b7c2f1d3e44", "url": "https://example.com/"}',
]);
$data = json_decode(curl_exec($ch), true);
req, _ := http.NewRequest("POST", "https://pub.postia.app/v1/media/from_url", strings.NewReader(`{"post_id": "0191c1a4-8e2b-7c3d-9a10-5b7c2f1d3e44", "url": "https://example.com/"}`))
req.Header.Set("Authorization", "Bearer "+os.Getenv("POSTIA_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
	panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
require 'net/http'
require 'json'

uri = URI('https://pub.postia.app/v1/media/from_url')
req = Net::HTTP::Post.new(uri)
req['Authorization'] = "Bearer #{ENV['POSTIA_API_KEY']}"
req['Content-Type'] = 'application/json'
req.body = '{"post_id": "0191c1a4-8e2b-7c3d-9a10-5b7c2f1d3e44", "url": "https://example.com/"}'
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |h| h.request(req) }
data = JSON.parse(res.body)

Resposta 200

The post.

Estatísticas

GET/v1/analytics

Publishing results and audience over the last days

Needs a plan with analytics.

Scope: analytics:read

Parâmetros

NomeEmTipoDescrição
daysqueryinteger
channel_idquerystringNarrows the audience to one channel's account.
curl -X GET https://pub.postia.app/v1/analytics \
  -H "Authorization: Bearer $POSTIA_API_KEY"
const res = await fetch("https://pub.postia.app/v1/analytics", {
  method: "GET",
  headers: {
    Authorization: `Bearer ${process.env.POSTIA_API_KEY}`,
  },
});
const data = await res.json();
import os, requests

res = requests.get(
    "https://pub.postia.app/v1/analytics",
    headers={
        "Authorization": f"Bearer {os.environ['POSTIA_API_KEY']}",
    },
)
data = res.json()
using System.Net.Http.Headers;

var http = new HttpClient();
http.DefaultRequestHeaders.Authorization =
    new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("POSTIA_API_KEY"));
var req = new HttpRequestMessage(HttpMethod.Get, "https://pub.postia.app/v1/analytics");
var res = await http.SendAsync(req);
var data = await res.Content.ReadAsStringAsync();
import java.net.URI;
import java.net.http.*;

var req = HttpRequest.newBuilder(URI.create("https://pub.postia.app/v1/analytics"))
    .header("Authorization", "Bearer " + System.getenv("POSTIA_API_KEY"))
    .method("GET", HttpRequest.BodyPublishers.noBody())
    .build();
var res = HttpClient.newHttpClient().send(req, HttpResponse.BodyHandlers.ofString());
String data = res.body();
<?php
$ch = curl_init('https://pub.postia.app/v1/analytics');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('POSTIA_API_KEY'),
    ],
]);
$data = json_decode(curl_exec($ch), true);
req, _ := http.NewRequest("GET", "https://pub.postia.app/v1/analytics", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("POSTIA_API_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
	panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
require 'net/http'
require 'json'

uri = URI('https://pub.postia.app/v1/analytics')
req = Net::HTTP::Get.new(uri)
req['Authorization'] = "Bearer #{ENV['POSTIA_API_KEY']}"
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |h| h.request(req) }
data = JSON.parse(res.body)

Resposta 200

Publishing counts and audience series.

Webhooks

GET/v1/webhooks

The webhook endpoints of this key or app

Scope: webhooks:manage

curl -X GET https://pub.postia.app/v1/webhooks \
  -H "Authorization: Bearer $POSTIA_API_KEY"
const res = await fetch("https://pub.postia.app/v1/webhooks", {
  method: "GET",
  headers: {
    Authorization: `Bearer ${process.env.POSTIA_API_KEY}`,
  },
});
const data = await res.json();
import os, requests

res = requests.get(
    "https://pub.postia.app/v1/webhooks",
    headers={
        "Authorization": f"Bearer {os.environ['POSTIA_API_KEY']}",
    },
)
data = res.json()
using System.Net.Http.Headers;

var http = new HttpClient();
http.DefaultRequestHeaders.Authorization =
    new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("POSTIA_API_KEY"));
var req = new HttpRequestMessage(HttpMethod.Get, "https://pub.postia.app/v1/webhooks");
var res = await http.SendAsync(req);
var data = await res.Content.ReadAsStringAsync();
import java.net.URI;
import java.net.http.*;

var req = HttpRequest.newBuilder(URI.create("https://pub.postia.app/v1/webhooks"))
    .header("Authorization", "Bearer " + System.getenv("POSTIA_API_KEY"))
    .method("GET", HttpRequest.BodyPublishers.noBody())
    .build();
var res = HttpClient.newHttpClient().send(req, HttpResponse.BodyHandlers.ofString());
String data = res.body();
<?php
$ch = curl_init('https://pub.postia.app/v1/webhooks');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('POSTIA_API_KEY'),
    ],
]);
$data = json_decode(curl_exec($ch), true);
req, _ := http.NewRequest("GET", "https://pub.postia.app/v1/webhooks", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("POSTIA_API_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
	panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
require 'net/http'
require 'json'

uri = URI('https://pub.postia.app/v1/webhooks')
req = Net::HTTP::Get.new(uri)
req['Authorization'] = "Bearer #{ENV['POSTIA_API_KEY']}"
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |h| h.request(req) }
data = JSON.parse(res.body)

Resposta 200

The endpoints. Secrets are not included.

POST/v1/webhooks

Add a webhook endpoint

An account keeps at most 20 endpoints; past that is a 422 plan_limit. The response carries the signing secret, shown only this once.

Scope: webhooks:manage

Parâmetros

NomeEmTipoDescrição
Idempotency-Keyheaderstring1 to 255 characters. Kept for 24 hours.

Corpo do pedido

NomeTipoDescrição
url *string (uri)https only, on port 443, resolving to a public address.
events *array
curl -X POST https://pub.postia.app/v1/webhooks \
  -H "Authorization: Bearer $POSTIA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com/", "events": []}'
const res = await fetch("https://pub.postia.app/v1/webhooks", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.POSTIA_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "url": "https://example.com/",
    "events": []
  }),
});
const data = await res.json();
import os, requests

res = requests.post(
    "https://pub.postia.app/v1/webhooks",
    headers={
        "Authorization": f"Bearer {os.environ['POSTIA_API_KEY']}",
    },
    json={
        "url": "https://example.com/",
        "events": []
    },
)
data = res.json()
using System.Net.Http.Headers;

var http = new HttpClient();
http.DefaultRequestHeaders.Authorization =
    new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("POSTIA_API_KEY"));
var req = new HttpRequestMessage(HttpMethod.Post, "https://pub.postia.app/v1/webhooks");
req.Content = new StringContent("{\"url\": \"https://example.com/\", \"events\": []}", System.Text.Encoding.UTF8, "application/json");
var res = await http.SendAsync(req);
var data = await res.Content.ReadAsStringAsync();
import java.net.URI;
import java.net.http.*;

var req = HttpRequest.newBuilder(URI.create("https://pub.postia.app/v1/webhooks"))
    .header("Authorization", "Bearer " + System.getenv("POSTIA_API_KEY"))
    .header("Content-Type", "application/json")
    .method("POST", HttpRequest.BodyPublishers.ofString("{\"url\": \"https://example.com/\", \"events\": []}"))
    .build();
var res = HttpClient.newHttpClient().send(req, HttpResponse.BodyHandlers.ofString());
String data = res.body();
<?php
$ch = curl_init('https://pub.postia.app/v1/webhooks');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('POSTIA_API_KEY'),
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => '{"url": "https://example.com/", "events": []}',
]);
$data = json_decode(curl_exec($ch), true);
req, _ := http.NewRequest("POST", "https://pub.postia.app/v1/webhooks", strings.NewReader(`{"url": "https://example.com/", "events": []}`))
req.Header.Set("Authorization", "Bearer "+os.Getenv("POSTIA_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
	panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
require 'net/http'
require 'json'

uri = URI('https://pub.postia.app/v1/webhooks')
req = Net::HTTP::Post.new(uri)
req['Authorization'] = "Bearer #{ENV['POSTIA_API_KEY']}"
req['Content-Type'] = 'application/json'
req.body = '{"url": "https://example.com/", "events": []}'
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |h| h.request(req) }
data = JSON.parse(res.body)

Resposta 201

The endpoint, with its secret.

GET/v1/webhooks/{webhook_id}

One webhook endpoint

Scope: webhooks:manage

Parâmetros

NomeEmTipoDescrição
webhook_id *pathstring (uuid)
curl -X GET https://pub.postia.app/v1/webhooks/WEBHOOK_ID \
  -H "Authorization: Bearer $POSTIA_API_KEY"
const res = await fetch("https://pub.postia.app/v1/webhooks/WEBHOOK_ID", {
  method: "GET",
  headers: {
    Authorization: `Bearer ${process.env.POSTIA_API_KEY}`,
  },
});
const data = await res.json();
import os, requests

res = requests.get(
    "https://pub.postia.app/v1/webhooks/WEBHOOK_ID",
    headers={
        "Authorization": f"Bearer {os.environ['POSTIA_API_KEY']}",
    },
)
data = res.json()
using System.Net.Http.Headers;

var http = new HttpClient();
http.DefaultRequestHeaders.Authorization =
    new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("POSTIA_API_KEY"));
var req = new HttpRequestMessage(HttpMethod.Get, "https://pub.postia.app/v1/webhooks/WEBHOOK_ID");
var res = await http.SendAsync(req);
var data = await res.Content.ReadAsStringAsync();
import java.net.URI;
import java.net.http.*;

var req = HttpRequest.newBuilder(URI.create("https://pub.postia.app/v1/webhooks/WEBHOOK_ID"))
    .header("Authorization", "Bearer " + System.getenv("POSTIA_API_KEY"))
    .method("GET", HttpRequest.BodyPublishers.noBody())
    .build();
var res = HttpClient.newHttpClient().send(req, HttpResponse.BodyHandlers.ofString());
String data = res.body();
<?php
$ch = curl_init('https://pub.postia.app/v1/webhooks/WEBHOOK_ID');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('POSTIA_API_KEY'),
    ],
]);
$data = json_decode(curl_exec($ch), true);
req, _ := http.NewRequest("GET", "https://pub.postia.app/v1/webhooks/WEBHOOK_ID", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("POSTIA_API_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
	panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
require 'net/http'
require 'json'

uri = URI('https://pub.postia.app/v1/webhooks/WEBHOOK_ID')
req = Net::HTTP::Get.new(uri)
req['Authorization'] = "Bearer #{ENV['POSTIA_API_KEY']}"
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |h| h.request(req) }
data = JSON.parse(res.body)

Resposta 200

The endpoint.

PATCH/v1/webhooks/{webhook_id}

Change an endpoint, or switch it back on

Setting active: true clears failing_since.

Scope: webhooks:manage

Parâmetros

NomeEmTipoDescrição
webhook_id *pathstring (uuid)
Idempotency-Keyheaderstring1 to 255 characters. Kept for 24 hours.

Corpo do pedido

NomeTipoDescrição
urlstring (uri)
eventsarray
activeboolean
curl -X PATCH https://pub.postia.app/v1/webhooks/WEBHOOK_ID \
  -H "Authorization: Bearer $POSTIA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
const res = await fetch("https://pub.postia.app/v1/webhooks/WEBHOOK_ID", {
  method: "PATCH",
  headers: {
    Authorization: `Bearer ${process.env.POSTIA_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({}),
});
const data = await res.json();
import os, requests

res = requests.patch(
    "https://pub.postia.app/v1/webhooks/WEBHOOK_ID",
    headers={
        "Authorization": f"Bearer {os.environ['POSTIA_API_KEY']}",
    },
    json={},
)
data = res.json()
using System.Net.Http.Headers;

var http = new HttpClient();
http.DefaultRequestHeaders.Authorization =
    new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("POSTIA_API_KEY"));
var req = new HttpRequestMessage(HttpMethod.Patch, "https://pub.postia.app/v1/webhooks/WEBHOOK_ID");
req.Content = new StringContent("{}", System.Text.Encoding.UTF8, "application/json");
var res = await http.SendAsync(req);
var data = await res.Content.ReadAsStringAsync();
import java.net.URI;
import java.net.http.*;

var req = HttpRequest.newBuilder(URI.create("https://pub.postia.app/v1/webhooks/WEBHOOK_ID"))
    .header("Authorization", "Bearer " + System.getenv("POSTIA_API_KEY"))
    .header("Content-Type", "application/json")
    .method("PATCH", HttpRequest.BodyPublishers.ofString("{}"))
    .build();
var res = HttpClient.newHttpClient().send(req, HttpResponse.BodyHandlers.ofString());
String data = res.body();
<?php
$ch = curl_init('https://pub.postia.app/v1/webhooks/WEBHOOK_ID');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'PATCH',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('POSTIA_API_KEY'),
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => '{}',
]);
$data = json_decode(curl_exec($ch), true);
req, _ := http.NewRequest("PATCH", "https://pub.postia.app/v1/webhooks/WEBHOOK_ID", strings.NewReader(`{}`))
req.Header.Set("Authorization", "Bearer "+os.Getenv("POSTIA_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
	panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
require 'net/http'
require 'json'

uri = URI('https://pub.postia.app/v1/webhooks/WEBHOOK_ID')
req = Net::HTTP::Patch.new(uri)
req['Authorization'] = "Bearer #{ENV['POSTIA_API_KEY']}"
req['Content-Type'] = 'application/json'
req.body = '{}'
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |h| h.request(req) }
data = JSON.parse(res.body)

Resposta 200

The endpoint.

DELETE/v1/webhooks/{webhook_id}

Delete an endpoint and its delivery history

Scope: webhooks:manage

Parâmetros

NomeEmTipoDescrição
webhook_id *pathstring (uuid)
curl -X DELETE https://pub.postia.app/v1/webhooks/WEBHOOK_ID \
  -H "Authorization: Bearer $POSTIA_API_KEY"
const res = await fetch("https://pub.postia.app/v1/webhooks/WEBHOOK_ID", {
  method: "DELETE",
  headers: {
    Authorization: `Bearer ${process.env.POSTIA_API_KEY}`,
  },
});
const data = await res.json();
import os, requests

res = requests.delete(
    "https://pub.postia.app/v1/webhooks/WEBHOOK_ID",
    headers={
        "Authorization": f"Bearer {os.environ['POSTIA_API_KEY']}",
    },
)
data = res.json()
using System.Net.Http.Headers;

var http = new HttpClient();
http.DefaultRequestHeaders.Authorization =
    new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("POSTIA_API_KEY"));
var req = new HttpRequestMessage(HttpMethod.Delete, "https://pub.postia.app/v1/webhooks/WEBHOOK_ID");
var res = await http.SendAsync(req);
var data = await res.Content.ReadAsStringAsync();
import java.net.URI;
import java.net.http.*;

var req = HttpRequest.newBuilder(URI.create("https://pub.postia.app/v1/webhooks/WEBHOOK_ID"))
    .header("Authorization", "Bearer " + System.getenv("POSTIA_API_KEY"))
    .method("DELETE", HttpRequest.BodyPublishers.noBody())
    .build();
var res = HttpClient.newHttpClient().send(req, HttpResponse.BodyHandlers.ofString());
String data = res.body();
<?php
$ch = curl_init('https://pub.postia.app/v1/webhooks/WEBHOOK_ID');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'DELETE',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('POSTIA_API_KEY'),
    ],
]);
$data = json_decode(curl_exec($ch), true);
req, _ := http.NewRequest("DELETE", "https://pub.postia.app/v1/webhooks/WEBHOOK_ID", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("POSTIA_API_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
	panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
require 'net/http'
require 'json'

uri = URI('https://pub.postia.app/v1/webhooks/WEBHOOK_ID')
req = Net::HTTP::Delete.new(uri)
req['Authorization'] = "Bearer #{ENV['POSTIA_API_KEY']}"
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |h| h.request(req) }
data = JSON.parse(res.body)

Resposta 200

Deleted.

POST/v1/webhooks/{webhook_id}/rotate_secret

Make a new signing secret

The old secret stops working at once; the new one is in the response and is not shown again.

Scope: webhooks:manage

Parâmetros

NomeEmTipoDescrição
webhook_id *pathstring (uuid)
Idempotency-Keyheaderstring1 to 255 characters. Kept for 24 hours.
curl -X POST https://pub.postia.app/v1/webhooks/WEBHOOK_ID/rotate_secret \
  -H "Authorization: Bearer $POSTIA_API_KEY"
const res = await fetch("https://pub.postia.app/v1/webhooks/WEBHOOK_ID/rotate_secret", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.POSTIA_API_KEY}`,
  },
});
const data = await res.json();
import os, requests

res = requests.post(
    "https://pub.postia.app/v1/webhooks/WEBHOOK_ID/rotate_secret",
    headers={
        "Authorization": f"Bearer {os.environ['POSTIA_API_KEY']}",
    },
)
data = res.json()
using System.Net.Http.Headers;

var http = new HttpClient();
http.DefaultRequestHeaders.Authorization =
    new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("POSTIA_API_KEY"));
var req = new HttpRequestMessage(HttpMethod.Post, "https://pub.postia.app/v1/webhooks/WEBHOOK_ID/rotate_secret");
var res = await http.SendAsync(req);
var data = await res.Content.ReadAsStringAsync();
import java.net.URI;
import java.net.http.*;

var req = HttpRequest.newBuilder(URI.create("https://pub.postia.app/v1/webhooks/WEBHOOK_ID/rotate_secret"))
    .header("Authorization", "Bearer " + System.getenv("POSTIA_API_KEY"))
    .method("POST", HttpRequest.BodyPublishers.noBody())
    .build();
var res = HttpClient.newHttpClient().send(req, HttpResponse.BodyHandlers.ofString());
String data = res.body();
<?php
$ch = curl_init('https://pub.postia.app/v1/webhooks/WEBHOOK_ID/rotate_secret');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('POSTIA_API_KEY'),
    ],
]);
$data = json_decode(curl_exec($ch), true);
req, _ := http.NewRequest("POST", "https://pub.postia.app/v1/webhooks/WEBHOOK_ID/rotate_secret", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("POSTIA_API_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
	panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
require 'net/http'
require 'json'

uri = URI('https://pub.postia.app/v1/webhooks/WEBHOOK_ID/rotate_secret')
req = Net::HTTP::Post.new(uri)
req['Authorization'] = "Bearer #{ENV['POSTIA_API_KEY']}"
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |h| h.request(req) }
data = JSON.parse(res.body)

Resposta 200

The endpoint, with its new secret.

POST/v1/webhooks/{webhook_id}/test

Send a `ping` event

Queues one delivery of a ping event, whatever the endpoint is subscribed to; read the outcome from the deliveries.

Scope: webhooks:manage

Parâmetros

NomeEmTipoDescrição
webhook_id *pathstring (uuid)
Idempotency-Keyheaderstring1 to 255 characters. Kept for 24 hours.
curl -X POST https://pub.postia.app/v1/webhooks/WEBHOOK_ID/test \
  -H "Authorization: Bearer $POSTIA_API_KEY"
const res = await fetch("https://pub.postia.app/v1/webhooks/WEBHOOK_ID/test", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.POSTIA_API_KEY}`,
  },
});
const data = await res.json();
import os, requests

res = requests.post(
    "https://pub.postia.app/v1/webhooks/WEBHOOK_ID/test",
    headers={
        "Authorization": f"Bearer {os.environ['POSTIA_API_KEY']}",
    },
)
data = res.json()
using System.Net.Http.Headers;

var http = new HttpClient();
http.DefaultRequestHeaders.Authorization =
    new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("POSTIA_API_KEY"));
var req = new HttpRequestMessage(HttpMethod.Post, "https://pub.postia.app/v1/webhooks/WEBHOOK_ID/test");
var res = await http.SendAsync(req);
var data = await res.Content.ReadAsStringAsync();
import java.net.URI;
import java.net.http.*;

var req = HttpRequest.newBuilder(URI.create("https://pub.postia.app/v1/webhooks/WEBHOOK_ID/test"))
    .header("Authorization", "Bearer " + System.getenv("POSTIA_API_KEY"))
    .method("POST", HttpRequest.BodyPublishers.noBody())
    .build();
var res = HttpClient.newHttpClient().send(req, HttpResponse.BodyHandlers.ofString());
String data = res.body();
<?php
$ch = curl_init('https://pub.postia.app/v1/webhooks/WEBHOOK_ID/test');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('POSTIA_API_KEY'),
    ],
]);
$data = json_decode(curl_exec($ch), true);
req, _ := http.NewRequest("POST", "https://pub.postia.app/v1/webhooks/WEBHOOK_ID/test", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("POSTIA_API_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
	panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
require 'net/http'
require 'json'

uri = URI('https://pub.postia.app/v1/webhooks/WEBHOOK_ID/test')
req = Net::HTTP::Post.new(uri)
req['Authorization'] = "Bearer #{ENV['POSTIA_API_KEY']}"
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |h| h.request(req) }
data = JSON.parse(res.body)

Resposta 202

The queued delivery.

GET/v1/webhooks/{webhook_id}/deliveries

What was sent to an endpoint, newest first

The last 30 days.

Scope: webhooks:manage

Parâmetros

NomeEmTipoDescrição
webhook_id *pathstring (uuid)
limitqueryinteger
cursorquerystring
curl -X GET https://pub.postia.app/v1/webhooks/WEBHOOK_ID/deliveries \
  -H "Authorization: Bearer $POSTIA_API_KEY"
const res = await fetch("https://pub.postia.app/v1/webhooks/WEBHOOK_ID/deliveries", {
  method: "GET",
  headers: {
    Authorization: `Bearer ${process.env.POSTIA_API_KEY}`,
  },
});
const data = await res.json();
import os, requests

res = requests.get(
    "https://pub.postia.app/v1/webhooks/WEBHOOK_ID/deliveries",
    headers={
        "Authorization": f"Bearer {os.environ['POSTIA_API_KEY']}",
    },
)
data = res.json()
using System.Net.Http.Headers;

var http = new HttpClient();
http.DefaultRequestHeaders.Authorization =
    new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("POSTIA_API_KEY"));
var req = new HttpRequestMessage(HttpMethod.Get, "https://pub.postia.app/v1/webhooks/WEBHOOK_ID/deliveries");
var res = await http.SendAsync(req);
var data = await res.Content.ReadAsStringAsync();
import java.net.URI;
import java.net.http.*;

var req = HttpRequest.newBuilder(URI.create("https://pub.postia.app/v1/webhooks/WEBHOOK_ID/deliveries"))
    .header("Authorization", "Bearer " + System.getenv("POSTIA_API_KEY"))
    .method("GET", HttpRequest.BodyPublishers.noBody())
    .build();
var res = HttpClient.newHttpClient().send(req, HttpResponse.BodyHandlers.ofString());
String data = res.body();
<?php
$ch = curl_init('https://pub.postia.app/v1/webhooks/WEBHOOK_ID/deliveries');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('POSTIA_API_KEY'),
    ],
]);
$data = json_decode(curl_exec($ch), true);
req, _ := http.NewRequest("GET", "https://pub.postia.app/v1/webhooks/WEBHOOK_ID/deliveries", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("POSTIA_API_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
	panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
require 'net/http'
require 'json'

uri = URI('https://pub.postia.app/v1/webhooks/WEBHOOK_ID/deliveries')
req = Net::HTTP::Get.new(uri)
req['Authorization'] = "Bearer #{ENV['POSTIA_API_KEY']}"
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |h| h.request(req) }
data = JSON.parse(res.body)

Resposta 200

A page of deliveries.

POST/v1/webhooks/{webhook_id}/deliveries/{delivery_id}/redeliver

Send an earlier event again

Queues a new delivery of the same event (same id) with a fresh signature.

Scope: webhooks:manage

Parâmetros

NomeEmTipoDescrição
webhook_id *pathstring (uuid)
delivery_id *pathstring (uuid)
Idempotency-Keyheaderstring1 to 255 characters. Kept for 24 hours.
curl -X POST https://pub.postia.app/v1/webhooks/WEBHOOK_ID/deliveries/DELIVERY_ID/redeliver \
  -H "Authorization: Bearer $POSTIA_API_KEY"
const res = await fetch("https://pub.postia.app/v1/webhooks/WEBHOOK_ID/deliveries/DELIVERY_ID/redeliver", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.POSTIA_API_KEY}`,
  },
});
const data = await res.json();
import os, requests

res = requests.post(
    "https://pub.postia.app/v1/webhooks/WEBHOOK_ID/deliveries/DELIVERY_ID/redeliver",
    headers={
        "Authorization": f"Bearer {os.environ['POSTIA_API_KEY']}",
    },
)
data = res.json()
using System.Net.Http.Headers;

var http = new HttpClient();
http.DefaultRequestHeaders.Authorization =
    new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("POSTIA_API_KEY"));
var req = new HttpRequestMessage(HttpMethod.Post, "https://pub.postia.app/v1/webhooks/WEBHOOK_ID/deliveries/DELIVERY_ID/redeliver");
var res = await http.SendAsync(req);
var data = await res.Content.ReadAsStringAsync();
import java.net.URI;
import java.net.http.*;

var req = HttpRequest.newBuilder(URI.create("https://pub.postia.app/v1/webhooks/WEBHOOK_ID/deliveries/DELIVERY_ID/redeliver"))
    .header("Authorization", "Bearer " + System.getenv("POSTIA_API_KEY"))
    .method("POST", HttpRequest.BodyPublishers.noBody())
    .build();
var res = HttpClient.newHttpClient().send(req, HttpResponse.BodyHandlers.ofString());
String data = res.body();
<?php
$ch = curl_init('https://pub.postia.app/v1/webhooks/WEBHOOK_ID/deliveries/DELIVERY_ID/redeliver');
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('POSTIA_API_KEY'),
    ],
]);
$data = json_decode(curl_exec($ch), true);
req, _ := http.NewRequest("POST", "https://pub.postia.app/v1/webhooks/WEBHOOK_ID/deliveries/DELIVERY_ID/redeliver", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("POSTIA_API_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
	panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
require 'net/http'
require 'json'

uri = URI('https://pub.postia.app/v1/webhooks/WEBHOOK_ID/deliveries/DELIVERY_ID/redeliver')
req = Net::HTTP::Post.new(uri)
req['Authorization'] = "Bearer #{ENV['POSTIA_API_KEY']}"
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |h| h.request(req) }
data = JSON.parse(res.body)

Resposta 202

The queued delivery.