Creating Actions
Create an Action
Define a reusable action with multiple steps.
Endpoint
POST
/actions/v1curl -X POST https://api.case.dev/actions/v1 \
-H "Authorization: Bearer sk_case_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"name": "Deposition Analysis Pipeline",
"description": "Summarize deposition and extract key admissions",
"webhook_id": "webhook_abc123",
"definition": {
"steps": [
{
"id": "summarize",
"service": "workflows",
"workflow_id": "workflow_uuid",
"input": {
"text": "{{input.transcript}}"
},
"options": {
"max_tokens": 2000
}
},
{
"id": "extract_admissions",
"service": "llm",
"input": {
"text": "From this summary, extract key admissions: {{steps.summarize.output.text}}"
},
"options": {
"model": "anthropic/claude-sonnet-4.5",
"max_tokens": 500
}
}
]
}
}'Action Payload (JSON & YAML)
Use either format when creating actions. JSON is perfect for programmatic calls, while YAML is great for declarative infrastructure.
Request Fields
name(required): Action namedescription(optional): What the action doeswebhook_id(optional): Webhook endpoint to notify on completiondefinition(required): Action steps configurationsteps(required): Array of steps to execute
Understanding Input & Output Data
Actions receive an input object every time you execute them. Each top-level key becomes addressable inside your steps with {{input.<field>}}, and step outputs become available via {{steps.<step_id>.output}}.
Example execution payload:
File paths and storage
- Use vault steps to persist output files. The
filenamefield accepts full paths, so you can nest content by case, date, or any taxonomy. For example:"filename": "{{input.case_id}}/reports/{{timestamp}}-summary.json". - Any data you store on a step (e.g., LLM responses) can be reused later via
{{steps.<id>.output}}. Combine this with vault storage to write summaries, transcripts, or structured JSON directly to{{input.case_id}}/.... - Need external assets? Pass URLs or S3 keys in the
inputobject (liketranscript_urlabove) and consume them inside steps with{{input.transcript_url}}.
Accessing outputs
- Every step produces an
outputobject. LLM steps surface text insteps.<id>.output.content, workflows expose structured JSON, and vault uploads return metadata such as object IDs. - When the action finishes, the final API response will include the last step outputs plus a
step_resultsmap so you can inspect or download generated files programmatically.
Example Request
Example Response
Next Steps
- Learn about Action Steps to understand available services
- See Variable Interpolation for passing data between steps
- Check out Complete Examples for real-world actions