API Triggers
API triggers let external systems request documentation updates from Promptless. Connect your CI/CD pipelines, custom automation tools, or any system that can make HTTP requests.
Use Cases
Section titled “Use Cases”API triggers work well when you want to:
- Integrate Promptless into CI/CD pipelines that run after deployments
- Build custom automation workflows that trigger documentation updates
- Connect external systems (ticketing, project management, custom tools) to Promptless
- Programmatically request documentation updates without using Slack or the dashboard
Setting Up API Triggers
Section titled “Setting Up API Triggers”1. Create an API Project
Section titled “1. Create an API Project”- Navigate to your Projects page
- Click New Project
- Select API as the trigger type
- Choose your doc collection
- Save the project
API projects don’t require source repository configuration. Promptless processes the instructions you send in the API request and uses your configured context sources to create documentation suggestions.
2. Generate an API Key
Section titled “2. Generate an API Key”API keys are managed in your organization’s Settings page.
- Navigate to Settings > API Access
- Click Generate Key to create a new API key
- Copy the key immediately—it’s only shown once
Warning
Store your API key securely. The full key is only displayed when first generated. Promptless stores only a hash of the key for validation.
Key Management
Section titled “Key Management”- One active key per organization: Each organization can have one active API key at a time
- Key rotation: Generating a new key immediately revokes the previous key
- Revocation: You can revoke your active key at any time from the Settings page
Tip
When rotating keys, update your integrations before generating a new key. The previous key stops working immediately when you create a new one.
Using the API
Section titled “Using the API”Endpoint
Section titled “Endpoint”POST /triggersAuthentication
Section titled “Authentication”Include your API key as a Bearer token in the Authorization header:
Authorization: Bearer sk-pl-your-api-keyThe bearer token determines which organization receives the trigger—no need to specify an organization ID in the URL.
Request Format
Section titled “Request Format”Send a JSON body with your documentation instructions:
{ "instructions": "Update the getting started guide with the new authentication flow", "context": { "ticket_id": "ENG-123", "requested_by": "deploy-bot" }}| Field | Type | Required | Description |
|---|---|---|---|
instructions | string | Yes | What you want Promptless to document. Be specific about which docs to update and what changes to make. |
context | object | No | Additional metadata to include with the request. This appears in trigger history for reference. |
Example Request
Section titled “Example Request”curl -X POST "https://api.gopromptless.ai/triggers" \ -H "Authorization: Bearer sk-pl-your-api-key" \ -H "Content-Type: application/json" \ -d '{ "instructions": "Document the new rate limiting feature added in v2.5", "context": { "release": "v2.5.0", "jira_ticket": "DOC-456" } }'Response
Section titled “Response”A successful request returns a 202 Accepted response:
{ "trigger_event_id": "abc123-..."}Error Responses
Section titled “Error Responses”| Status | Error | Description |
|---|---|---|
| 401 | authentication_failed | The API key is missing, invalid, or revoked |
| 409 | no_eligible_pipelines | No API projects are configured for your organization |
| 422 | Validation error | The request body is invalid (e.g., empty instructions) |
Viewing API Triggers
Section titled “Viewing API Triggers”API-triggered events appear in your dashboard with a distinct “API” label.
Trigger History
Section titled “Trigger History”View all API triggers on the Triggers page. API triggers show the submitted instructions and any context you included in the request.
Change History
Section titled “Change History”Filter by “API” source in Change History to see documentation suggestions that came from API requests.
How It Works
Section titled “How It Works”When you submit an API request:
- Validation: Promptless validates your API key and request format
- Routing: The request is routed to all API projects in your organization
- Processing: Promptless analyzes your instructions along with configured context sources
- Suggestion Creation: If documentation updates are needed, Promptless creates suggestions
Note
API triggers use the same processing pipeline as other trigger types. The suggestions appear in your dashboard and follow your configured auto-publish and notification settings.