> 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.

# Trigger a playbook via webhook

POST /api/webhooks/orgs/{orgSlug}/playbooks/{playbookSlug}

Public endpoint. External callers (no WorkOS JWT) authenticate via a per-playbook HMAC secret in `X-Webhook-Secret` and supply an `X-Idempotency-Key`. Creates (or replays) a playbook run for the targeted project. Idempotency is exactly-once across retries and concurrent deliveries.

Reference: https://docs.cloudraker.com/api/raker-one-api/webhooks/post-webhooks-orgs-by-org-slug-playbooks-by-playbook-slug

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: RakerOne API
  version: 1.0.0
paths:
  /webhooks/orgs/{orgSlug}/playbooks/{playbookSlug}:
    post:
      operationId: post-webhooks-orgs-by-org-slug-playbooks-by-playbook-slug
      summary: Trigger a playbook via webhook
      description: >-
        Public endpoint. External callers (no WorkOS JWT) authenticate via a
        per-playbook HMAC secret in `X-Webhook-Secret` and supply an
        `X-Idempotency-Key`. Creates (or replays) a playbook run for the
        targeted project. Idempotency is exactly-once across retries and
        concurrent deliveries.
      tags:
        - subpackage_webhooks
      parameters:
        - name: orgSlug
          in: path
          required: true
          schema:
            type: string
        - name: playbookSlug
          in: path
          required: true
          schema:
            type: string
        - name: X-Webhook-Secret
          in: header
          description: Per-playbook HMAC secret authenticating the caller.
          required: true
          schema:
            type: string
        - name: X-Idempotency-Key
          in: header
          description: Caller-supplied key making delivery exactly-once across retries.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Replayed delivery — the run already exists.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JsonObject'
        '400':
          description: Bad request — invalid JSON/body or missing idempotency key.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Invalid webhook secret.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: >-
            Webhook rejected — unknown org/playbook, disabled, or kill switch
            engaged.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: Idempotency key reused with a different payload or target.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '413':
          description: Payload too large.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: >-
            Unprocessable — target resolution failed (e.g. project/template not
            found).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
servers:
  - url: /api
    description: Current origin
  - url: https://app.raker.one/api
    description: Production
components:
  schemas:
    JsonObject:
      type: object
      additionalProperties:
        description: Any type
      description: An arbitrary JSON object.
      title: JsonObject
    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

```

## Examples

### Example 1



**Request**

```json
{}
```

**Response**

```json
{
  "runId": "a3f1c9d2-4b7e-4e8a-9f3b-2d5c6e7f8a90",
  "status": "created",
  "message": "Playbook run successfully triggered",
  "timestamp": "2024-06-15T12:45:30Z"
}
```

**SDK Code**

```python
import requests

url = "https://api/webhooks/orgs/orgSlug/playbooks/playbookSlug"

payload = {}
headers = {
    "X-Webhook-Secret": "X-Webhook-Secret",
    "X-Idempotency-Key": "X-Idempotency-Key",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://api/webhooks/orgs/orgSlug/playbooks/playbookSlug';
const options = {
  method: 'POST',
  headers: {
    'X-Webhook-Secret': 'X-Webhook-Secret',
    'X-Idempotency-Key': 'X-Idempotency-Key',
    'Content-Type': 'application/json'
  },
  body: '{}'
};

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/webhooks/orgs/orgSlug/playbooks/playbookSlug"

	payload := strings.NewReader("{}")

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

	req.Header.Add("X-Webhook-Secret", "X-Webhook-Secret")
	req.Header.Add("X-Idempotency-Key", "X-Idempotency-Key")
	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/webhooks/orgs/orgSlug/playbooks/playbookSlug")

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

request = Net::HTTP::Post.new(url)
request["X-Webhook-Secret"] = 'X-Webhook-Secret'
request["X-Idempotency-Key"] = 'X-Idempotency-Key'
request["Content-Type"] = 'application/json'
request.body = "{}"

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/webhooks/orgs/orgSlug/playbooks/playbookSlug")
  .header("X-Webhook-Secret", "X-Webhook-Secret")
  .header("X-Idempotency-Key", "X-Idempotency-Key")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api/webhooks/orgs/orgSlug/playbooks/playbookSlug', [
  'body' => '{}',
  'headers' => [
    'Content-Type' => 'application/json',
    'X-Idempotency-Key' => 'X-Idempotency-Key',
    'X-Webhook-Secret' => 'X-Webhook-Secret',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api/webhooks/orgs/orgSlug/playbooks/playbookSlug");
var request = new RestRequest(Method.POST);
request.AddHeader("X-Webhook-Secret", "X-Webhook-Secret");
request.AddHeader("X-Idempotency-Key", "X-Idempotency-Key");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "X-Webhook-Secret": "X-Webhook-Secret",
  "X-Idempotency-Key": "X-Idempotency-Key",
  "Content-Type": "application/json"
]
let parameters = [] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api/webhooks/orgs/orgSlug/playbooks/playbookSlug")! 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()
```

### Example 2



**Request**

```json
{}
```

**Response**

```json
{
  "runId": "a3f1c9d2-4b7e-4e8a-9f3b-2d5c6e7f8a90",
  "status": "created",
  "message": "Playbook run successfully triggered",
  "timestamp": "2024-06-15T12:45:30Z"
}
```

**SDK Code**

```python
import requests

url = "https://api/webhooks/orgs/orgSlug/playbooks/playbookSlug"

payload = {}
headers = {
    "X-Webhook-Secret": "X-Webhook-Secret",
    "X-Idempotency-Key": "X-Idempotency-Key",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://api/webhooks/orgs/orgSlug/playbooks/playbookSlug';
const options = {
  method: 'POST',
  headers: {
    'X-Webhook-Secret': 'X-Webhook-Secret',
    'X-Idempotency-Key': 'X-Idempotency-Key',
    'Content-Type': 'application/json'
  },
  body: '{}'
};

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/webhooks/orgs/orgSlug/playbooks/playbookSlug"

	payload := strings.NewReader("{}")

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

	req.Header.Add("X-Webhook-Secret", "X-Webhook-Secret")
	req.Header.Add("X-Idempotency-Key", "X-Idempotency-Key")
	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/webhooks/orgs/orgSlug/playbooks/playbookSlug")

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

request = Net::HTTP::Post.new(url)
request["X-Webhook-Secret"] = 'X-Webhook-Secret'
request["X-Idempotency-Key"] = 'X-Idempotency-Key'
request["Content-Type"] = 'application/json'
request.body = "{}"

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/webhooks/orgs/orgSlug/playbooks/playbookSlug")
  .header("X-Webhook-Secret", "X-Webhook-Secret")
  .header("X-Idempotency-Key", "X-Idempotency-Key")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api/webhooks/orgs/orgSlug/playbooks/playbookSlug', [
  'body' => '{}',
  'headers' => [
    'Content-Type' => 'application/json',
    'X-Idempotency-Key' => 'X-Idempotency-Key',
    'X-Webhook-Secret' => 'X-Webhook-Secret',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api/webhooks/orgs/orgSlug/playbooks/playbookSlug");
var request = new RestRequest(Method.POST);
request.AddHeader("X-Webhook-Secret", "X-Webhook-Secret");
request.AddHeader("X-Idempotency-Key", "X-Idempotency-Key");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "X-Webhook-Secret": "X-Webhook-Secret",
  "X-Idempotency-Key": "X-Idempotency-Key",
  "Content-Type": "application/json"
]
let parameters = [] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api/webhooks/orgs/orgSlug/playbooks/playbookSlug")! 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()
```

### Example 3



**Request**

```json
{}
```

**Response**

```json
{
  "runId": "a3f1c9d2-4b7e-4e8a-9f3b-2d5c6e7f8a90",
  "status": "created",
  "message": "Playbook run successfully triggered",
  "timestamp": "2024-06-15T12:45:30Z"
}
```

**SDK Code**

```python
import requests

url = "https://api/webhooks/orgs/orgSlug/playbooks/playbookSlug"

payload = {}
headers = {
    "X-Webhook-Secret": "X-Webhook-Secret",
    "X-Idempotency-Key": "X-Idempotency-Key",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://api/webhooks/orgs/orgSlug/playbooks/playbookSlug';
const options = {
  method: 'POST',
  headers: {
    'X-Webhook-Secret': 'X-Webhook-Secret',
    'X-Idempotency-Key': 'X-Idempotency-Key',
    'Content-Type': 'application/json'
  },
  body: '{}'
};

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/webhooks/orgs/orgSlug/playbooks/playbookSlug"

	payload := strings.NewReader("{}")

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

	req.Header.Add("X-Webhook-Secret", "X-Webhook-Secret")
	req.Header.Add("X-Idempotency-Key", "X-Idempotency-Key")
	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/webhooks/orgs/orgSlug/playbooks/playbookSlug")

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

request = Net::HTTP::Post.new(url)
request["X-Webhook-Secret"] = 'X-Webhook-Secret'
request["X-Idempotency-Key"] = 'X-Idempotency-Key'
request["Content-Type"] = 'application/json'
request.body = "{}"

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/webhooks/orgs/orgSlug/playbooks/playbookSlug")
  .header("X-Webhook-Secret", "X-Webhook-Secret")
  .header("X-Idempotency-Key", "X-Idempotency-Key")
  .header("Content-Type", "application/json")
  .body("{}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api/webhooks/orgs/orgSlug/playbooks/playbookSlug', [
  'body' => '{}',
  'headers' => [
    'Content-Type' => 'application/json',
    'X-Idempotency-Key' => 'X-Idempotency-Key',
    'X-Webhook-Secret' => 'X-Webhook-Secret',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api/webhooks/orgs/orgSlug/playbooks/playbookSlug");
var request = new RestRequest(Method.POST);
request.AddHeader("X-Webhook-Secret", "X-Webhook-Secret");
request.AddHeader("X-Idempotency-Key", "X-Idempotency-Key");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "X-Webhook-Secret": "X-Webhook-Secret",
  "X-Idempotency-Key": "X-Idempotency-Key",
  "Content-Type": "application/json"
]
let parameters = [] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api/webhooks/orgs/orgSlug/playbooks/playbookSlug")! 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()
```