Writer
App · 20 actions
Generate text and chat responses, run applications, and manage knowledge graphs and files.
Actions
| Action | What it does |
|---|---|
| Ask graph | Question. |
| Chat | Chat completion. |
| Create application job | Generate from application (async). |
| Create graph | Create graph. |
| Delete file | Delete file. |
| Delete graph | Delete graph. |
| Download file | Download file. |
| Generate from application | Generate from application. |
| Generate text | Text generation. |
| Get application | Application details. |
| Get application job | Retrieve a single job. |
| Get file | Retrieve file. |
| Get graph | Retrieve graph. |
| List application graphs | Retrieve graphs. |
| List application jobs | Retrieve all jobs. |
| List applications | List applications. |
| List files | List files. |
| List graphs | List graphs. |
| List models | List models. |
| Update graph | Update graph. |
Ask graph
Question.
Inputs
- Graph ids
graph_idslistRequired - The unique identifiers of the Knowledge Graphs to query.
- Subqueries
subqueriestrue/false - Specify whether to include subqueries.Default:
false. - Question
questiontextRequired - The question to answer using the Knowledge Graph.
- Query config
query_configobject - Configuration options for Knowledge Graph queries, including search parameters and citation settings.
Outputs
dataobject- Service response.
Example output
{
"data": {
"answer": "example",
"question": "example",
"references": {
"files": [],
"web": []
},
"sources": [],
"subqueries": []
}
}Chat
Chat completion.
Inputs
- Model
modeltextRequired - The [ID of the model](https://dev.writer.com/home/models) to use for creating the chat completion. This can be a Palmyra model such as `palmyra-x5` or `palmyra-x4`, or the ID of an [external model](https://dev.writer.com/home/external-models) configured for your organization.
- Messages
messageslistRequired - An array of message objects that form the conversation history or context for the model to respond to. The array must contain at least one message.
- Max tokens
max_tokensnumber - Defines the maximum number of tokens (words and characters) that the model can generate in the response. This can be adjusted to allow for longer or shorter responses as needed. The maximum value varies by model. See the [models overview](/home/models) for more information about the maximum number of tokens for each model.
- Temperature
temperaturenumber - Controls the randomness or creativity of the model's responses. A higher temperature results in more varied and less predictable text, while a lower temperature produces more deterministic and conservative outputs.Default:
1. - Top p
top_pnumber - Sets the threshold for "nucleus sampling," a technique to focus the model's token generation on the most likely subset of tokens. Only tokens with cumulative probability above this threshold are considered, controlling the trade-off between creativity and coherence.
- N
nnumber - Specifies the number of completions (responses) to generate from the model in a single request. This parameter allows for generating multiple responses, offering a variety of potential replies from which to choose.
- Stop
stoplist - A token or sequence of tokens that, when generated, will cause the model to stop producing further content. This can be a single token or an array of tokens, acting as a signal to end the output.
- Logprobs
logprobstrue/false - Specifies whether to return log probabilities of the output tokens.Default:
false. - Tools
toolslist - An array containing tool definitions for tools that the model can use to generate responses. The tool definitions use JSON schema. You can define your own functions or use one of the built-in `graph`, `llm`, or `web_search` tools. Note that you can only use one built-in tool type in the array (only one of `graph`, `llm`, or `web_search`). You can pass multiple [custom tools](https://dev.writer.com/home/tool-calling) of type `function` in the same request.
- Tool choice
tool_choiceobject - Configure how the model will call functions: - `auto`: allows the model to automatically choose the tool to use, or not call a tool - `none`: disables tool calling; the model will instead generate a message - `required`: requires the model to call one or more tools You can also use a JSON object to force the model to call a specific tool. For example, `{"type": "function", "function": {"name": "get_current_weather"}}` requires the model to call the `get_current_weather` function, regardless of the prompt.
- Response format
response_formatobject - The response format to use for the chat completion, available with `palmyra-x4` and `palmyra-x5`. `text` is the default response format. [JSON Schema](https://json-schema.org/) is supported for structured responses. If you specify `json_schema`, you must also provide a `json_schema` object.
Outputs
dataobject- Service response.
Example output
{
"data": {
"choices": [],
"created": 1,
"id": "example",
"model": "example",
"object": "chat.completion",
"service_tier": "example",
"system_fingerprint": "example",
"usage": {
"completion_tokens": 1,
"completion_tokens_details": {
"reasoning_tokens": 1
},
"prompt_token_details": {
"cached_tokens": 1
},
"prompt_tokens": 1,
"total_tokens": 1
}
}
}Create application job
Generate from application (async).
Inputs
- Application
application_idtextRequired - Application id.
- Inputs
inputslistRequired - A list of input objects to generate content for.
Outputs
dataobject- Service response.
Example output
{
"data": {
"created_at": "2026-11-01T12:00:00Z",
"id": "example",
"status": "in_progress"
}
}Create graph
Create graph.
Inputs
- Name
nametext - The name of the Knowledge Graph (max 255 characters). Omitting this field leaves the name unchanged.
- Description
descriptiontext - A description of the Knowledge Graph (max 255 characters). Omitting this field leaves the description unchanged.
- Team ids
team_idslist - Optional list of team IDs to deploy the Knowledge Graph to. Omit the field or pass an empty array to create an org-wide Knowledge Graph (accessible to every team in the organization), which is the default. Provide one or more team IDs to scope the Knowledge Graph to those teams. Only applies when using an org-scoped API key; requests made with a team-scoped API key ignore this field and always assign the graph to that key's team.
Outputs
dataobject- Service response.
Example output
{
"data": {
"created_at": "2026-11-01T12:00:00Z",
"description": "example",
"id": "example",
"name": "example",
"team_ids": [],
"urls": []
}
}Delete file
Delete file.
Inputs
- File
file_idtextRequired - File id.
Outputs
dataobject- Service response.
Example output
{
"data": {
"deleted": false,
"id": "example"
}
}Delete graph
Delete graph.
Inputs
- Graph
graph_idtextRequired - Graph id.
Outputs
dataobject- Service response.
Example output
{
"data": {
"deleted": false,
"id": "example"
}
}Download file
Download file.
Inputs
- File
file_idtextRequired - File id.
Outputs
dataobject- Service response.
Example output
{
"data": {
"content_base64": "example",
"content_type": "example"
}
}Generate from application
Generate from application.
Inputs
- Application
application_idtextRequired - Application id.
- Inputs
inputslistRequired - Inputs.
Outputs
dataobject- Service response.
Example output
{
"data": {
"suggestion": "example",
"title": "example"
}
}Generate text
Text generation.
Inputs
- Model
modeltextRequired - The [ID of the model](https://dev.writer.com/home/models) to use for generating text. This can be a Palmyra model such as `palmyra-x5` or `palmyra-x4`, or the ID of an [external model](https://dev.writer.com/home/external-models) configured for your organization.
- Prompt
prompttextRequired - The input text that the model will process to generate a response.
- Max tokens
max_tokensnumber - The maximum number of tokens that the model can generate in the response.
- Temperature
temperaturenumber - Controls the randomness of the model's outputs. Higher values lead to more random outputs, while lower values make the model more deterministic.
- Top p
top_pnumber - Used to control the nucleus sampling, where only the most probable tokens with a cumulative probability of top_p are considered for sampling, providing a way to fine-tune the randomness of predictions.
- Stop
stoplist - Specifies stopping conditions for the model's output generation. This can be an array of strings or a single string that the model will look for as a signal to stop generating further tokens.
- Best of
best_ofnumber - Specifies the number of completions to generate and return the best one. Useful for generating multiple outputs and choosing the best based on some criteria.
- Random seed
random_seednumber - A seed used to initialize the random number generator for the model, ensuring reproducibility of the output when the same inputs are provided.
Outputs
dataobject- Service response.
Example output
{
"data": {
"choices": [],
"model": "example"
}
}Get application
Application details.
Inputs
- Application
application_idtextRequired - Application id.
Outputs
dataobject- Detailed application object including its input configuration.
Example output
{
"data": {
"created_at": "2026-11-01T12:00:00Z",
"id": "example",
"inputs": [],
"last_deployed_at": "2026-11-01T12:00:00Z",
"name": "example",
"status": "deployed",
"type": "generation",
"updated_at": "2026-11-01T12:00:00Z"
}
}Get application job
Retrieve a single job.
Inputs
- Job id
job_idtextRequired - Job id.
Outputs
dataobject- Service response.
Example output
{
"data": {
"application_id": "example",
"completed_at": "2026-11-01T12:00:00Z",
"created_at": "2026-11-01T12:00:00Z",
"data": {
"suggestion": "example",
"title": "example"
},
"error": "example",
"id": "example",
"status": "in_progress",
"updated_at": "2026-11-01T12:00:00Z"
}
}Get file
Retrieve file.
Inputs
- File
file_idtextRequired - File id.
Outputs
dataobject- Service response.
Example output
{
"data": {
"created_at": "2026-11-01T12:00:00Z",
"graph_ids": [],
"id": "example",
"name": "example",
"status": "example"
}
}Get graph
Retrieve graph.
Inputs
- Graph
graph_idtextRequired - Graph id.
Outputs
dataobject- Service response.
Example output
{
"data": {
"created_at": "2026-11-01T12:00:00Z",
"description": "example",
"file_status": {
"completed": 1,
"failed": 1,
"in_progress": 1,
"total": 1
},
"id": "example",
"name": "example",
"team_ids": [],
"type": "manual",
"urls": []
}
}List application graphs
Retrieve graphs.
Inputs
- Application
application_idtextRequired - Application id.
Outputs
dataobject- Service response.
Example output
{
"data": {
"graph_ids": []
}
}List application jobs
Retrieve all jobs.
Inputs
- Application
application_idtextRequired - Application id.
- Status
statustext - The status of the job.One of:
in_progress(In progress),failed,completed. - Offset
offsetnumber - Offset.
- Limit
limitnumber - Limit.
Outputs
dataobject- Service response.
Example output
{
"data": {
"pagination": {
"limit": 1,
"offset": 1
},
"result": [],
"totalCount": 1
}
}List applications
List applications.
Inputs
- Order
ordertext - Order.One of:
asc,desc. Default:desc. - Before
beforetext - Before.
- After
aftertext - After.
- Limit
limitnumber - Limit.Default:
50. - Type
typetext - The type of no-code application.One of:
generation. Default:generation.
Outputs
dataobject- Response object containing a paginated list of applications.
Example output
{
"data": {
"data": [],
"first_id": "example",
"has_more": false,
"last_id": "example"
}
}List files
List files.
Inputs
- Before
beforetext - Before.
- After
aftertext - After.
- Limit
limitnumber - Limit.Default:
50. - Order
ordertext - Order.One of:
asc,desc. Default:desc. - Graph
graph_idtext - Graph id.
- Status
statustext - Status.One of:
in_progress(In progress),completed,failed. - File types
file_typestext - File types.
Outputs
dataobject- Service response.
Example output
{
"data": {
"data": [],
"first_id": "example",
"has_more": false,
"last_id": "example"
}
}List graphs
List graphs.
Inputs
- Order
ordertext - Order.One of:
asc,desc. Default:desc. - Before
beforetext - Before.
- After
aftertext - After.
- Limit
limitnumber - Limit.Default:
50.
Outputs
dataobject- Service response.
Example output
{
"data": {
"data": [],
"first_id": "example",
"has_more": false,
"last_id": "example"
}
}List models
List models.
Inputs
None.
Outputs
dataobject- Service response.
Example output
{
"data": {
"models": []
}
}Update graph
Update graph.
Inputs
- Graph
graph_idtextRequired - Graph id.
- Name
nametext - The name of the Knowledge Graph (max 255 characters). Omitting this field leaves the name unchanged.
- Description
descriptiontext - A description of the Knowledge Graph (max 255 characters). Omitting this field leaves the description unchanged.
- Urls
urlslist - An array of web connector URLs to update for this Knowledge Graph. You can only connect URLs to Knowledge Graphs with the type `web`. To clear the list of URLs, set this field to an empty array.
- Team ids
team_idslist - Optional list of team IDs the Knowledge Graph is deployed to. Omitting this field leaves the current team assignment unchanged. Passing an array replaces the whole team assignment: an empty array makes the graph org-wide, one or more team IDs scope it to exactly those teams. Not accepted from team-scoped API keys.
Outputs
dataobject- Service response.
Example output
{
"data": {
"created_at": "2026-11-01T12:00:00Z",
"description": "example",
"id": "example",
"name": "example",
"team_ids": [],
"urls": []
}
}