Skip to content

API Overview

Pidgr exposes a gRPC API built with Protocol Buffers. All services are available over both native gRPC (for backend services) and Connect-Web (for browser applications).

  • Package: pidgr.v1
  • Proto syntax: proto3
  • Transport: gRPC (HTTP/2) and Connect-Web (HTTP/1.1 + HTTP/2)
  • Serialization: Protocol Buffers (binary) or JSON
EnvironmentURL
Productionhttps://api.pidgr.com
Staginghttps://api-staging.pidgr.com

All API requests require authentication via one of:

Issued after passkey or email OTP authentication. Include in the Authorization header:

Authorization: Bearer eyJhbGciOiJSUzI1NiIs...

The JWT contains a custom:org_id claim that scopes all requests to the authenticated organization. You never need to pass org_id in request bodies.

For programmatic access (MCP server, CI/CD, integrations):

Authorization: Bearer pidgr_<key>

API keys are scoped to an organization and inherit permissions from the organization’s role system.

For browser and React Native clients, use Connect-Web:

import { createConnectTransport } from "@connectrpc/connect-web";
import { createClient } from "@connectrpc/connect";
import { CampaignService } from "@pidgr/proto/pidgr/v1/campaign_connect";
const transport = createConnectTransport({
baseUrl: "https://api.pidgr.com",
});
const client = createClient(CampaignService, transport);
const response = await client.listCampaigns({
pagination: { pageSize: 10 },
});

For Go backend services:

conn, err := grpc.NewClient("api.pidgr.com:443",
grpc.WithTransportCredentials(credentials.NewTLS(&tls.Config{})),
)
client := pidgrv1.NewCampaignServiceClient(conn)
resp, err := client.ListCampaigns(ctx, &pidgrv1.ListCampaignsRequest{
Pagination: &pidgrv1.Pagination{PageSize: 10},
})

List endpoints use cursor-based pagination:

// First page
const page1 = await client.listCampaigns({
pagination: { pageSize: 20 },
});
// Next page
const page2 = await client.listCampaigns({
pagination: { pageSize: 20, pageToken: page1.pagination.nextPageToken },
});

Response includes PaginationMeta with nextPageToken (empty when no more pages) and totalCount.

The API returns standard gRPC status codes:

CodeMeaning
OK (0)Success
INVALID_ARGUMENT (3)Invalid request fields
NOT_FOUND (5)Resource doesn’t exist
ALREADY_EXISTS (6)Duplicate resource
PERMISSION_DENIED (7)Insufficient permissions
UNAUTHENTICATED (16)Missing or invalid credentials
RESOURCE_EXHAUSTED (8)Rate limit exceeded
INTERNAL (13)Server error

Error details are sanitized in production — internal error messages are never exposed to clients.

API requests are rate-limited per organization:

  • Default: 100 requests/second per organization
  • Burst: 200 requests

When rate-limited, the API returns RESOURCE_EXHAUSTED with a Retry-After header.

ServiceDescription
ActionServiceUser action submission on delivered messages
ApiKeyServiceAPI key management
CampaignServiceCampaign lifecycle management
DeviceServiceDevice registration and push tokens
GroupServiceRecipient group management
HeatmapServiceTouch event ingestion and heatmap queries
InboxServiceMobile inbox sync and read tracking
MemberServiceUser management and profiles
OrganizationServiceOrganization CRUD
RenderServiceTemplate rendering (internal)
ReplayServiceSession recording replay
RoleServiceRole and permission management
SSOServiceSSO/SAML provider management
TeamServiceTeam management
TemplateServiceMessage template management