Endpoints
Authentication
All Wren API endpoints authenticate with thex-api-key header. Which kind of key you can use depends on the endpoint:
A personal access token acts as you, with your permissions. A workspace API key acts with the permissions granted to that key. Either way, the key needs access to the project you name.
Create a personal access token from your profile menu in Agent Studio, under Account › Personal access tokens. If you don’t see the tab, contact your PolyAI representative. Create a workspace API key from the API Keys tab. See API keys.
401 in any other.
Recommendations
A recommendation is something Wren found on a project that could be improved, with what happens, why, and where it stands.nextStep saying what it is waiting for:
nextStep is null once a recommendation is closed.
A few things worth knowing:
- The list shows open recommendations by default. Pass
all=trueor astatusfilter to include closed ones. - Recommendations saved for later are left out by default. Pass
saved=trueto list only those, orall=trueto include everything. - Snippets are illustrative.
conversationSnippetandchangeSnippetare short examples written to show the pattern. They are not transcripts of real calls. - Answers appear on a single recommendation only. While
nextStepisanswered, Get a recommendation returns each question with its answer. The list does not. - The API is read-only. Dismissing, commenting on, answering and approving a recommendation are done in Agent Studio.
Turns
Sending a turn starts a Wren run and streams it back as server-sent events. Runs can take many minutes, so keep the connection open and set your client’s read timeout accordingly. The Wren API guide covers modes, answering questions, continuing a conversation, and using Wren from your own agents.Error responses
Errors come back as JSON with an
error message:
Pagination
The list returnslimit recommendations at a time, 20 by default and at most 100. When there are more, pagination.hasMore is true and pagination.nextOffset is the offset to pass for the next page.
