> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.cloudraker.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.cloudraker.com/_mcp/server.

# Create an action definition

POST /api/actions
Content-Type: application/json

Creates a draft custom action definition (extract, generate, or fill). The slug is immutable and may not shadow a builtin or an existing custom action.

Reference: https://docs.cloudraker.com/api/raker-one-api/actions/post-actions

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: RakerOne API
  version: 1.0.0
paths:
  /actions:
    post:
      operationId: post-actions
      summary: Create an action definition
      description: >-
        Creates a draft custom action definition (extract, generate, or fill).
        The slug is immutable and may not shadow a builtin or an existing custom
        action.
      tags:
        - subpackage_actions
      parameters:
        - name: Authorization
          in: header
          description: >-
            WorkOS session JWT or an organization API key, sent as
            `Authorization: Bearer <token>`.
          required: true
          schema:
            type: string
      responses:
        '201':
          description: The created definition.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ActionDefinitionResource'
        '400':
          description: Bad request — the body or parameters failed validation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized — missing or invalid bearer token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Actions_postActions_Request'
servers:
  - url: /api
    description: Current origin
  - url: https://app.raker.one/api
    description: Production
components:
  schemas:
    ActionsPostRequestBodyContentApplicationJsonSchemaOneOf0GenerationTemplate:
      type: object
      properties:
        source:
          type: string
          enum:
            - library
        templateId:
          type: string
      required:
        - source
        - templateId
      title: >-
        ActionsPostRequestBodyContentApplicationJsonSchemaOneOf0GenerationTemplate
    ActionsPostRequestBodyContentApplicationJsonSchemaOneOf0GenerationCardinality:
      type: string
      enum:
        - one-per-record
        - all-records
      title: >-
        ActionsPostRequestBodyContentApplicationJsonSchemaOneOf0GenerationCardinality
    ActionsPostRequestBodyContentApplicationJsonSchemaOneOf0GenerationOutputFormat:
      type: string
      enum:
        - pdf
        - docx
      title: >-
        ActionsPostRequestBodyContentApplicationJsonSchemaOneOf0GenerationOutputFormat
    ActionsPostRequestBodyContentApplicationJsonSchemaOneOf0GenerationOutputWatermark:
      type: object
      properties:
        text:
          type: string
        color:
          type: string
      required:
        - text
      title: >-
        ActionsPostRequestBodyContentApplicationJsonSchemaOneOf0GenerationOutputWatermark
    ActionsPostRequestBodyContentApplicationJsonSchemaOneOf0GenerationOutput:
      type: object
      properties:
        format:
          $ref: >-
            #/components/schemas/ActionsPostRequestBodyContentApplicationJsonSchemaOneOf0GenerationOutputFormat
        filenameTemplate:
          type: string
        tags:
          type: array
          items:
            type: string
          default: []
        watermark:
          $ref: >-
            #/components/schemas/ActionsPostRequestBodyContentApplicationJsonSchemaOneOf0GenerationOutputWatermark
      required:
        - format
        - filenameTemplate
      title: ActionsPostRequestBodyContentApplicationJsonSchemaOneOf0GenerationOutput
    ActionsPostRequestBodyContentApplicationJsonSchemaOneOf0Generation:
      type: object
      properties:
        template:
          oneOf:
            - $ref: >-
                #/components/schemas/ActionsPostRequestBodyContentApplicationJsonSchemaOneOf0GenerationTemplate
            - type: 'null'
        cardinality:
          $ref: >-
            #/components/schemas/ActionsPostRequestBodyContentApplicationJsonSchemaOneOf0GenerationCardinality
        output:
          $ref: >-
            #/components/schemas/ActionsPostRequestBodyContentApplicationJsonSchemaOneOf0GenerationOutput
      required:
        - template
        - cardinality
        - output
      title: ActionsPostRequestBodyContentApplicationJsonSchemaOneOf0Generation
    ActionsPostActionsRequest0:
      type: object
      properties:
        kind:
          type: string
          enum:
            - generate
        name:
          type: string
        slug:
          type: string
        description:
          type: string
          default: ''
        icon:
          type:
            - string
            - 'null'
        generation:
          $ref: >-
            #/components/schemas/ActionsPostRequestBodyContentApplicationJsonSchemaOneOf0Generation
      required:
        - kind
        - name
        - slug
        - generation
      title: ActionsPostActionsRequest0
    ActionsPostRequestBodyContentApplicationJsonSchemaOneOf1FillForm:
      type: object
      properties:
        source:
          type: string
          enum:
            - library
        templateId:
          type: string
      required:
        - source
        - templateId
      title: ActionsPostRequestBodyContentApplicationJsonSchemaOneOf1FillForm
    ActionsPostRequestBodyContentApplicationJsonSchemaOneOf1FillBinding0:
      type: object
      properties:
        kind:
          type: string
          enum:
            - record-type
        objectDefinitionId:
          type: string
      required:
        - kind
        - objectDefinitionId
      title: ActionsPostRequestBodyContentApplicationJsonSchemaOneOf1FillBinding0
    ActionsPostRequestBodyContentApplicationJsonSchemaOneOf1FillBinding1:
      type: object
      properties:
        kind:
          type: string
          enum:
            - free-form
      required:
        - kind
      title: ActionsPostRequestBodyContentApplicationJsonSchemaOneOf1FillBinding1
    ActionsPostRequestBodyContentApplicationJsonSchemaOneOf1FillBinding:
      oneOf:
        - $ref: >-
            #/components/schemas/ActionsPostRequestBodyContentApplicationJsonSchemaOneOf1FillBinding0
        - $ref: >-
            #/components/schemas/ActionsPostRequestBodyContentApplicationJsonSchemaOneOf1FillBinding1
      title: ActionsPostRequestBodyContentApplicationJsonSchemaOneOf1FillBinding
    ActionsPostRequestBodyContentApplicationJsonSchemaOneOf1FillMappingsItemsValue0:
      type: object
      properties:
        kind:
          type: string
          enum:
            - path
        path:
          type: string
      required:
        - kind
        - path
      title: >-
        ActionsPostRequestBodyContentApplicationJsonSchemaOneOf1FillMappingsItemsValue0
    ActionsPostRequestBodyContentApplicationJsonSchemaOneOf1FillMappingsItemsValue1:
      type: object
      properties:
        kind:
          type: string
          enum:
            - template
        template:
          type: string
      required:
        - kind
        - template
      title: >-
        ActionsPostRequestBodyContentApplicationJsonSchemaOneOf1FillMappingsItemsValue1
    ActionsPostRequestBodyContentApplicationJsonSchemaOneOf1FillMappingsItemsValue:
      oneOf:
        - $ref: >-
            #/components/schemas/ActionsPostRequestBodyContentApplicationJsonSchemaOneOf1FillMappingsItemsValue0
        - $ref: >-
            #/components/schemas/ActionsPostRequestBodyContentApplicationJsonSchemaOneOf1FillMappingsItemsValue1
      title: >-
        ActionsPostRequestBodyContentApplicationJsonSchemaOneOf1FillMappingsItemsValue
    ActionsPostRequestBodyContentApplicationJsonSchemaOneOf1FillMappingsItemsControl:
      type: string
      enum:
        - text
        - checkbox
        - date
        - number
        - currency
        - multiline
      title: >-
        ActionsPostRequestBodyContentApplicationJsonSchemaOneOf1FillMappingsItemsControl
    ActionsPostRequestBodyContentApplicationJsonSchemaOneOf1FillMappingsItems:
      type: object
      properties:
        key:
          type: string
        value:
          $ref: >-
            #/components/schemas/ActionsPostRequestBodyContentApplicationJsonSchemaOneOf1FillMappingsItemsValue
        description:
          type: string
          default: ''
        control:
          $ref: >-
            #/components/schemas/ActionsPostRequestBodyContentApplicationJsonSchemaOneOf1FillMappingsItemsControl
        format:
          type: string
      required:
        - key
        - value
        - control
      title: >-
        ActionsPostRequestBodyContentApplicationJsonSchemaOneOf1FillMappingsItems
    ActionsPostRequestBodyContentApplicationJsonSchemaOneOf1FillCardinality:
      type: string
      enum:
        - one-per-record
        - all-records-merged
      title: ActionsPostRequestBodyContentApplicationJsonSchemaOneOf1FillCardinality
    ActionsPostRequestBodyContentApplicationJsonSchemaOneOf1FillOutputFormat:
      type: string
      enum:
        - auto
        - pdf
        - png
      title: ActionsPostRequestBodyContentApplicationJsonSchemaOneOf1FillOutputFormat
    ActionsPostRequestBodyContentApplicationJsonSchemaOneOf1FillOutput:
      type: object
      properties:
        format:
          $ref: >-
            #/components/schemas/ActionsPostRequestBodyContentApplicationJsonSchemaOneOf1FillOutputFormat
        filenameTemplate:
          type: string
        tags:
          type: array
          items:
            type: string
          default: []
      required:
        - format
        - filenameTemplate
      title: ActionsPostRequestBodyContentApplicationJsonSchemaOneOf1FillOutput
    ActionsPostRequestBodyContentApplicationJsonSchemaOneOf1Fill:
      type: object
      properties:
        form:
          oneOf:
            - $ref: >-
                #/components/schemas/ActionsPostRequestBodyContentApplicationJsonSchemaOneOf1FillForm
            - type: 'null'
        binding:
          $ref: >-
            #/components/schemas/ActionsPostRequestBodyContentApplicationJsonSchemaOneOf1FillBinding
        mappings:
          type: array
          items:
            $ref: >-
              #/components/schemas/ActionsPostRequestBodyContentApplicationJsonSchemaOneOf1FillMappingsItems
          default: []
        confidenceThreshold:
          type:
            - number
            - 'null'
          format: double
        cardinality:
          $ref: >-
            #/components/schemas/ActionsPostRequestBodyContentApplicationJsonSchemaOneOf1FillCardinality
        output:
          $ref: >-
            #/components/schemas/ActionsPostRequestBodyContentApplicationJsonSchemaOneOf1FillOutput
      required:
        - form
        - binding
        - cardinality
        - output
      title: ActionsPostRequestBodyContentApplicationJsonSchemaOneOf1Fill
    ActionsPostActionsRequest1:
      type: object
      properties:
        kind:
          type: string
          enum:
            - fill
        name:
          type: string
        slug:
          type: string
        description:
          type: string
          default: ''
        icon:
          type:
            - string
            - 'null'
        fill:
          $ref: >-
            #/components/schemas/ActionsPostRequestBodyContentApplicationJsonSchemaOneOf1Fill
      required:
        - kind
        - name
        - slug
        - fill
      title: ActionsPostActionsRequest1
    ActionsPostRequestBodyContentApplicationJsonSchemaOneOf2Output0:
      type: object
      properties:
        kind:
          type: string
          enum:
            - record-type
        objectDefinitionId:
          type: string
      required:
        - kind
        - objectDefinitionId
      title: ActionsPostRequestBodyContentApplicationJsonSchemaOneOf2Output0
    ActionsPostRequestBodyContentApplicationJsonSchemaOneOf2OutputOneOf1FieldsItemsType:
      type: string
      enum:
        - text
        - long_text
        - number
        - currency
        - boolean
        - date
        - datetime
        - select
        - multi_select
        - email
        - phone
        - url
        - address
      title: >-
        ActionsPostRequestBodyContentApplicationJsonSchemaOneOf2OutputOneOf1FieldsItemsType
    ActionsPostRequestBodyContentApplicationJsonSchemaOneOf2OutputOneOf1FieldsItemsOptionsItemsColor:
      type: string
      enum:
        - gray
        - green
        - turquoise
        - sky
        - blue
        - purple
        - pink
        - red
        - orange
        - yellow
      title: >-
        ActionsPostRequestBodyContentApplicationJsonSchemaOneOf2OutputOneOf1FieldsItemsOptionsItemsColor
    ActionsPostRequestBodyContentApplicationJsonSchemaOneOf2OutputOneOf1FieldsItemsOptionsItems:
      type: object
      properties:
        value:
          type: string
        label:
          type: string
        color:
          $ref: >-
            #/components/schemas/ActionsPostRequestBodyContentApplicationJsonSchemaOneOf2OutputOneOf1FieldsItemsOptionsItemsColor
        position:
          type: number
          format: double
      required:
        - value
        - label
        - color
        - position
      title: >-
        ActionsPostRequestBodyContentApplicationJsonSchemaOneOf2OutputOneOf1FieldsItemsOptionsItems
    ActionsPostRequestBodyContentApplicationJsonSchemaOneOf2OutputOneOf1FieldsItems:
      type: object
      properties:
        key:
          type: string
        label:
          type: string
        type:
          $ref: >-
            #/components/schemas/ActionsPostRequestBodyContentApplicationJsonSchemaOneOf2OutputOneOf1FieldsItemsType
        description:
          type: string
          default: ''
        icon:
          type:
            - string
            - 'null'
        groupId:
          type:
            - string
            - 'null'
        position:
          type: number
          format: double
          default: 0
        required:
          type: boolean
          default: false
        unique:
          type: boolean
          default: false
        options:
          type: array
          items:
            $ref: >-
              #/components/schemas/ActionsPostRequestBodyContentApplicationJsonSchemaOneOf2OutputOneOf1FieldsItemsOptionsItems
        settings:
          type: object
          additionalProperties:
            description: Any type
        defaultValue:
          description: Any type
        archived:
          type: boolean
          default: false
      required:
        - key
        - label
        - type
      title: >-
        ActionsPostRequestBodyContentApplicationJsonSchemaOneOf2OutputOneOf1FieldsItems
    ActionsPostRequestBodyContentApplicationJsonSchemaOneOf2Output1:
      type: object
      properties:
        kind:
          type: string
          enum:
            - inline
        fields:
          type: array
          items:
            $ref: >-
              #/components/schemas/ActionsPostRequestBodyContentApplicationJsonSchemaOneOf2OutputOneOf1FieldsItems
        labelFieldKey:
          type: string
      required:
        - kind
        - fields
        - labelFieldKey
      title: ActionsPostRequestBodyContentApplicationJsonSchemaOneOf2Output1
    ActionsPostRequestBodyContentApplicationJsonSchemaOneOf2Output:
      oneOf:
        - $ref: >-
            #/components/schemas/ActionsPostRequestBodyContentApplicationJsonSchemaOneOf2Output0
        - $ref: >-
            #/components/schemas/ActionsPostRequestBodyContentApplicationJsonSchemaOneOf2Output1
      title: ActionsPostRequestBodyContentApplicationJsonSchemaOneOf2Output
    ActionsPostRequestBodyContentApplicationJsonSchemaOneOf2ExecutionModeOneOf0Cardinality:
      type: string
      enum:
        - one-per-input
        - one-total
      title: >-
        ActionsPostRequestBodyContentApplicationJsonSchemaOneOf2ExecutionModeOneOf0Cardinality
    ActionsPostRequestBodyContentApplicationJsonSchemaOneOf2ExecutionMode0:
      type: object
      properties:
        type:
          type: string
          enum:
            - extract-schema
        cardinality:
          $ref: >-
            #/components/schemas/ActionsPostRequestBodyContentApplicationJsonSchemaOneOf2ExecutionModeOneOf0Cardinality
      required:
        - type
        - cardinality
      title: ActionsPostRequestBodyContentApplicationJsonSchemaOneOf2ExecutionMode0
    ActionsPostRequestBodyContentApplicationJsonSchemaOneOf2ExecutionMode1:
      type: object
      properties:
        type:
          type: string
          enum:
            - extract-table-documents
      required:
        - type
      title: ActionsPostRequestBodyContentApplicationJsonSchemaOneOf2ExecutionMode1
    ActionsPostRequestBodyContentApplicationJsonSchemaOneOf2ExecutionMode:
      oneOf:
        - $ref: >-
            #/components/schemas/ActionsPostRequestBodyContentApplicationJsonSchemaOneOf2ExecutionMode0
        - $ref: >-
            #/components/schemas/ActionsPostRequestBodyContentApplicationJsonSchemaOneOf2ExecutionMode1
      title: ActionsPostRequestBodyContentApplicationJsonSchemaOneOf2ExecutionMode
    ActionsPostRequestBodyContentApplicationJsonSchemaOneOf2ExecutionModelProvider:
      type: string
      enum:
        - workers-ai
        - anthropic
        - aws-bedrock
        - azure-openai
        - google-vertex-ai
        - huggingface
        - openai
        - perplexity-ai
        - replicate
        - groq
        - cohere
        - google-ai-studio
        - mistral
        - grok
        - openrouter
        - deepseek
        - cerebras
        - cartesia
        - elevenlabs
        - adobe-firefly
      title: >-
        ActionsPostRequestBodyContentApplicationJsonSchemaOneOf2ExecutionModelProvider
    ActionsPostRequestBodyContentApplicationJsonSchemaOneOf2ExecutionModel:
      type: object
      properties:
        provider:
          $ref: >-
            #/components/schemas/ActionsPostRequestBodyContentApplicationJsonSchemaOneOf2ExecutionModelProvider
        model:
          type: string
      required:
        - provider
        - model
      title: ActionsPostRequestBodyContentApplicationJsonSchemaOneOf2ExecutionModel
    ActionsPostRequestBodyContentApplicationJsonSchemaOneOf2Execution:
      type: object
      properties:
        mode:
          $ref: >-
            #/components/schemas/ActionsPostRequestBodyContentApplicationJsonSchemaOneOf2ExecutionMode
        model:
          $ref: >-
            #/components/schemas/ActionsPostRequestBodyContentApplicationJsonSchemaOneOf2ExecutionModel
          default:
            provider: anthropic
            model: claude-sonnet-4-6
        instructions:
          type: string
      required:
        - mode
        - instructions
      title: ActionsPostRequestBodyContentApplicationJsonSchemaOneOf2Execution
    ActionsPostActionsRequest2:
      type: object
      properties:
        kind:
          type: string
          enum:
            - extract
          default: extract
        name:
          type: string
        slug:
          type: string
        description:
          type: string
          default: ''
        icon:
          type:
            - string
            - 'null'
        output:
          $ref: >-
            #/components/schemas/ActionsPostRequestBodyContentApplicationJsonSchemaOneOf2Output
        execution:
          $ref: >-
            #/components/schemas/ActionsPostRequestBodyContentApplicationJsonSchemaOneOf2Execution
      required:
        - name
        - slug
        - output
        - execution
      title: ActionsPostActionsRequest2
    Actions_postActions_Request:
      oneOf:
        - $ref: '#/components/schemas/ActionsPostActionsRequest0'
        - $ref: '#/components/schemas/ActionsPostActionsRequest1'
        - $ref: '#/components/schemas/ActionsPostActionsRequest2'
      title: Actions_postActions_Request
    JsonObject:
      type: object
      additionalProperties:
        description: Any type
      description: An arbitrary JSON object.
      title: JsonObject
    ActionDefinitionResource:
      type: object
      properties:
        definition:
          $ref: '#/components/schemas/JsonObject'
      required:
        - definition
      description: A custom action definition.
      title: ActionDefinitionResource
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Machine-readable error code (e.g. `invalid_body`, `not_found`).
        issues:
          type: array
          items:
            description: Any type
          description: Schema-validation issues, present when `error` is `invalid_body`.
      required:
        - error
      description: Standard API error response.
      title: ErrorResponse
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        WorkOS session JWT or an organization API key, sent as `Authorization:
        Bearer <token>`.

```

## Examples



**Request**

```json
{
  "kind": "generate",
  "name": "Monthly Sales Report Generator",
  "slug": "monthly-sales-report",
  "generation": {
    "template": {
      "source": "library",
      "templateId": "tpl-12345"
    },
    "cardinality": "one-per-record",
    "output": {
      "format": "pdf",
      "filenameTemplate": "sales-report-{{date}}.pdf"
    }
  }
}
```

**Response**

```json
{
  "definition": {}
}
```

**SDK Code**

```python
import requests

url = "https://api/actions"

payload = {
    "kind": "generate",
    "name": "Monthly Sales Report Generator",
    "slug": "monthly-sales-report",
    "generation": {
        "template": {
            "source": "library",
            "templateId": "tpl-12345"
        },
        "cardinality": "one-per-record",
        "output": {
            "format": "pdf",
            "filenameTemplate": "sales-report-{{date}}.pdf"
        }
    }
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api/actions';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"kind":"generate","name":"Monthly Sales Report Generator","slug":"monthly-sales-report","generation":{"template":{"source":"library","templateId":"tpl-12345"},"cardinality":"one-per-record","output":{"format":"pdf","filenameTemplate":"sales-report-{{date}}.pdf"}}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api/actions"

	payload := strings.NewReader("{\n  \"kind\": \"generate\",\n  \"name\": \"Monthly Sales Report Generator\",\n  \"slug\": \"monthly-sales-report\",\n  \"generation\": {\n    \"template\": {\n      \"source\": \"library\",\n      \"templateId\": \"tpl-12345\"\n    },\n    \"cardinality\": \"one-per-record\",\n    \"output\": {\n      \"format\": \"pdf\",\n      \"filenameTemplate\": \"sales-report-{{date}}.pdf\"\n    }\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api/actions")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"kind\": \"generate\",\n  \"name\": \"Monthly Sales Report Generator\",\n  \"slug\": \"monthly-sales-report\",\n  \"generation\": {\n    \"template\": {\n      \"source\": \"library\",\n      \"templateId\": \"tpl-12345\"\n    },\n    \"cardinality\": \"one-per-record\",\n    \"output\": {\n      \"format\": \"pdf\",\n      \"filenameTemplate\": \"sales-report-{{date}}.pdf\"\n    }\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api/actions")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"kind\": \"generate\",\n  \"name\": \"Monthly Sales Report Generator\",\n  \"slug\": \"monthly-sales-report\",\n  \"generation\": {\n    \"template\": {\n      \"source\": \"library\",\n      \"templateId\": \"tpl-12345\"\n    },\n    \"cardinality\": \"one-per-record\",\n    \"output\": {\n      \"format\": \"pdf\",\n      \"filenameTemplate\": \"sales-report-{{date}}.pdf\"\n    }\n  }\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api/actions', [
  'body' => '{
  "kind": "generate",
  "name": "Monthly Sales Report Generator",
  "slug": "monthly-sales-report",
  "generation": {
    "template": {
      "source": "library",
      "templateId": "tpl-12345"
    },
    "cardinality": "one-per-record",
    "output": {
      "format": "pdf",
      "filenameTemplate": "sales-report-{{date}}.pdf"
    }
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api/actions");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"kind\": \"generate\",\n  \"name\": \"Monthly Sales Report Generator\",\n  \"slug\": \"monthly-sales-report\",\n  \"generation\": {\n    \"template\": {\n      \"source\": \"library\",\n      \"templateId\": \"tpl-12345\"\n    },\n    \"cardinality\": \"one-per-record\",\n    \"output\": {\n      \"format\": \"pdf\",\n      \"filenameTemplate\": \"sales-report-{{date}}.pdf\"\n    }\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "kind": "generate",
  "name": "Monthly Sales Report Generator",
  "slug": "monthly-sales-report",
  "generation": [
    "template": [
      "source": "library",
      "templateId": "tpl-12345"
    ],
    "cardinality": "one-per-record",
    "output": [
      "format": "pdf",
      "filenameTemplate": "sales-report-{{date}}.pdf"
    ]
  ]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api/actions")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```