Skip to main content

Quickstart

The TPC API is in alpha development. If you’re interested in using it for a production use case, contact support@promptingco.com to discuss your requirements.
You can make your first content request in under five minutes if you already have access to a TPC organization.

Step 1: Create an API key

Open your organization API key settings:
Create a key with these scopes:
Copy the key immediately. TPC shows the secret once.
Use a read-only key with only content:read until your integration needs to create, update, or delete content.

Step 2: Make your first request

Export your key and product ID:
List published content for the product:
A successful response returns ok: true. This example omits filter metadata and additional item fields:

Step 3: Parse the envelope

Every JSON endpoint returns an ApiResult<T>:
Handle both branches explicitly:

Step 4: Add pagination and filters

The content list endpoint accepts query-string filters:
Common filters:

Step 5: Create a page

Create a page with content:write:
Example response (organization and product scope omitted):
Check failedCount and failed even when ok is true: a batch can contain per-page failures. The id in each created item is a draft ID. Created pages land in the review queue. Approve and publish them with POST /api/v1/content/{draftId}/review ({"action": "approve"}) — approval queues publishing automatically — or browse the queue with GET /api/v1/content?productId=$TPC_PRODUCT_ID&status=pending_review.

Troubleshooting

Every response includes x-request-id. Include that value when you contact support.