Skip to Content
DocsReferenceRPC Services

RPC Services

Complete service index for the Pug Connect RPC API. Generate typed clients from proto with buf generate.

Proto source: cotton/proto 

Public

No authentication required.

ServiceMethodsDescription
AuthServiceSignIn, SignInWithMagicLink, SignInWithOAuth, SignUp, RefreshTokenUser authentication

Dashboard (JWT + x-project-id)

Browser sessions for growth managers.

ServiceMethodsDescription
OrgsServiceCreate, Get, List, Update, InviteMember, ListMembers, RemoveMemberOrganization management
ProjectsServiceCreate, Get, List, Update, CreateApiKey, ListApiKeys, RevokeApiKeyProject CRUD and API keys
DashboardsServiceList, Get, Create, Update, Upsert, DeleteDashboard and tile management
OrgEmailProvidersServiceGet, Upsert, Delete, SendTestEmail provider configuration
CustomersServiceList, Get, UpdateCustomer (dashboard user) records

SDK (API key + x-project-id)

Client-side write access. Safe for browsers and mobile apps.

ServiceMethodsDescription
EventsServiceBatchCreateIngest event batches
ProfilesSDKServiceIdentify, AliasLink anonymous profiles, merge IDs

Shared (API key or JWT + x-project-id)

Server-side or trusted integrations.

ServiceMethodsDescription
InsightsServiceQueryRun analytics queries
ActivityServiceListRecent activity feeds
ProfilesServiceGet, List, DeleteProfile reads and soft-delete

Endpoint format

Connect RPC endpoints follow the pattern:

POST https://api.pug.sh/{package}.{version}.{Service}/{Method}

Examples:

POST /events.v1.EventsService/BatchCreate POST /insights.v1.InsightsService/Query POST /profiles.v1.ProfilesSDKService/Identify POST /dashboards.v1.DashboardsService/Upsert

Generate clients

git clone git@github.com:fivebitsio/cotton.git cd cotton buf generate

Supported languages: TypeScript, Go, Python, Java, and others via Buf .

TypeScript example

npm install @connectrpc/connect @connectrpc/connect-web @bufbuild/protobuf
import { createClient } from '@connectrpc/connect' import { createConnectTransport } from '@connectrpc/connect-web' import { EventsService } from './gen/events/v1/events_connect' const transport = createConnectTransport({ baseUrl: 'https://api.pug.sh' }) const client = createClient(EventsService, transport)

See Authentication for auth interceptors.

Service documentation

PageService
Events APIEventsService
Profiles APIProfilesSDKService, ProfilesService
Insights APIInsightsService
Dashboards APIDashboardsService
Orgs & ProjectsOrgsService, ProjectsService

This page will be auto-generated from proto in a future docs pipeline. Method signatures may change — refer to proto source for the authoritative schema.

Further reading

Last updated on