> For a complete page index, fetch https://developer.close.com/llms.txt

# Create a playbook

POST https://api.close.com/api/v1/playbook/
Content-Type: application/json

Create a new playbook for the organization.

Reference: https://developer.close.com/api/resources/playbooks/create

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: Close API
  version: 1.0.0
paths:
  /playbook/:
    post:
      operationId: create
      summary: Create a playbook
      description: Create a new playbook for the organization.
      tags:
        - subpackage_playbooks
      parameters:
        - name: Authorization
          in: header
          description: Basic authentication
          required: true
          schema:
            type: string
      responses:
        '201':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Playbook'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                description: Any type
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                description: Any type
        '404':
          description: Not found
          content:
            application/json:
              schema:
                description: Any type
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreatePlaybook'
servers:
  - url: https://api.close.com/api/v1
components:
  schemas:
    CreatePlaybook:
      type: object
      properties:
        custom_field_ids:
          type: array
          items:
            type: string
          description: >-
            IDs of [Shared Custom
            Fields](/api/resources/custom-fields/shared-fields) to associate
            with this Playbook.
        description:
          type:
            - string
            - 'null'
          description: Description of the playbook.
        name:
          type: string
        outcome_ids:
          type: array
          items:
            type: string
          description: >-
            IDs of [Outcomes](/api/resources/outcomes/) that should be
            associated with this Playbook.
        summary_guidance:
          type:
            - string
            - 'null'
          description: >-
            Guidance for AI summaries of calls and meetings associated with this
            Playbook.
      required:
        - name
      title: CreatePlaybook
    Playbook:
      type: object
      properties:
        archived_at:
          type:
            - string
            - 'null'
          format: date-time
        archived_by_id:
          type:
            - string
            - 'null'
        created_at:
          type: string
          format: date-time
        created_by_id:
          type: string
        custom_field_ids:
          type: array
          items:
            type: string
        description:
          type:
            - string
            - 'null'
        id:
          type: string
        name:
          type: string
        organization_id:
          type: string
        outcome_ids:
          type: array
          items:
            type: string
        position:
          type:
            - integer
            - 'null'
        summary_guidance:
          type:
            - string
            - 'null'
        updated_at:
          type: string
          format: date-time
        updated_by_id:
          type: string
      required:
        - archived_at
        - archived_by_id
        - created_at
        - created_by_id
        - custom_field_ids
        - description
        - id
        - name
        - organization_id
        - outcome_ids
        - position
        - summary_guidance
        - updated_at
        - updated_by_id
      title: Playbook
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: basic
    OAuth2:
      type: http
      scheme: bearer

```

## SDK Code Examples

```python playbooks_create_example
import requests

url = "https://api.close.com/api/v1/playbook/"

payload = {
    "name": "Discovery Call",
    "custom_field_ids": ["cf_aU54Bvr6Rw8UBHh7zRboL3PYhbOVJl3XvwgPm3jgaKq", "cf_v6S011I6MqcbVvB2FA5Nk8dr5MkL8sWuCiG8cUleO9c"],
    "description": "Initial discovery call with prospect.",
    "outcome_ids": ["outcome_030Xl5QwKi7tPRLRtnuef3", "outcome_03oUxZfoO6e2vHmcz1DiHR"],
    "summary_guidance": "Summarize the prospect's pain points and next steps."
}
headers = {
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers, auth=("<CLOSE_API_KEY>", ""))

print(response.json())
```

```javascript playbooks_create_example
const url = 'https://api.close.com/api/v1/playbook/';
const credentials = btoa("<CLOSE_API_KEY>:");

const options = {
  method: 'POST',
  headers: {Authorization: `Basic ${credentials}`, 'Content-Type': 'application/json'},
  body: '{"name":"Discovery Call","custom_field_ids":["cf_aU54Bvr6Rw8UBHh7zRboL3PYhbOVJl3XvwgPm3jgaKq","cf_v6S011I6MqcbVvB2FA5Nk8dr5MkL8sWuCiG8cUleO9c"],"description":"Initial discovery call with prospect.","outcome_ids":["outcome_030Xl5QwKi7tPRLRtnuef3","outcome_03oUxZfoO6e2vHmcz1DiHR"],"summary_guidance":"Summarize the prospect\'s pain points and next steps."}'
};

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

```go playbooks_create_example
package main

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

func main() {

	url := "https://api.close.com/api/v1/playbook/"

	payload := strings.NewReader("{\n  \"name\": \"Discovery Call\",\n  \"custom_field_ids\": [\n    \"cf_aU54Bvr6Rw8UBHh7zRboL3PYhbOVJl3XvwgPm3jgaKq\",\n    \"cf_v6S011I6MqcbVvB2FA5Nk8dr5MkL8sWuCiG8cUleO9c\"\n  ],\n  \"description\": \"Initial discovery call with prospect.\",\n  \"outcome_ids\": [\n    \"outcome_030Xl5QwKi7tPRLRtnuef3\",\n    \"outcome_03oUxZfoO6e2vHmcz1DiHR\"\n  ],\n  \"summary_guidance\": \"Summarize the prospect's pain points and next steps.\"\n}")

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

	req.SetBasicAuth("<CLOSE_API_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 playbooks_create_example
require 'uri'
require 'net/http'

url = URI("https://api.close.com/api/v1/playbook/")

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

request = Net::HTTP::Post.new(url)
request.basic_auth("<CLOSE_API_KEY>", "")
request["Content-Type"] = 'application/json'
request.body = "{\n  \"name\": \"Discovery Call\",\n  \"custom_field_ids\": [\n    \"cf_aU54Bvr6Rw8UBHh7zRboL3PYhbOVJl3XvwgPm3jgaKq\",\n    \"cf_v6S011I6MqcbVvB2FA5Nk8dr5MkL8sWuCiG8cUleO9c\"\n  ],\n  \"description\": \"Initial discovery call with prospect.\",\n  \"outcome_ids\": [\n    \"outcome_030Xl5QwKi7tPRLRtnuef3\",\n    \"outcome_03oUxZfoO6e2vHmcz1DiHR\"\n  ],\n  \"summary_guidance\": \"Summarize the prospect's pain points and next steps.\"\n}"

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

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

HttpResponse<String> response = Unirest.post("https://api.close.com/api/v1/playbook/")
  .basicAuth("<CLOSE_API_KEY>", "")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"Discovery Call\",\n  \"custom_field_ids\": [\n    \"cf_aU54Bvr6Rw8UBHh7zRboL3PYhbOVJl3XvwgPm3jgaKq\",\n    \"cf_v6S011I6MqcbVvB2FA5Nk8dr5MkL8sWuCiG8cUleO9c\"\n  ],\n  \"description\": \"Initial discovery call with prospect.\",\n  \"outcome_ids\": [\n    \"outcome_030Xl5QwKi7tPRLRtnuef3\",\n    \"outcome_03oUxZfoO6e2vHmcz1DiHR\"\n  ],\n  \"summary_guidance\": \"Summarize the prospect's pain points and next steps.\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.close.com/api/v1/playbook/', [
  'body' => '{
  "name": "Discovery Call",
  "custom_field_ids": [
    "cf_aU54Bvr6Rw8UBHh7zRboL3PYhbOVJl3XvwgPm3jgaKq",
    "cf_v6S011I6MqcbVvB2FA5Nk8dr5MkL8sWuCiG8cUleO9c"
  ],
  "description": "Initial discovery call with prospect.",
  "outcome_ids": [
    "outcome_030Xl5QwKi7tPRLRtnuef3",
    "outcome_03oUxZfoO6e2vHmcz1DiHR"
  ],
  "summary_guidance": "Summarize the prospect\'s pain points and next steps."
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
    'auth' => ['<CLOSE_API_KEY>', ''],
]);

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

```csharp playbooks_create_example
using RestSharp;
using RestSharp.Authenticators;

var client = new RestClient("https://api.close.com/api/v1/playbook/");
client.Authenticator = new HttpBasicAuthenticator("<CLOSE_API_KEY>", "");
var request = new RestRequest(Method.POST);

request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": \"Discovery Call\",\n  \"custom_field_ids\": [\n    \"cf_aU54Bvr6Rw8UBHh7zRboL3PYhbOVJl3XvwgPm3jgaKq\",\n    \"cf_v6S011I6MqcbVvB2FA5Nk8dr5MkL8sWuCiG8cUleO9c\"\n  ],\n  \"description\": \"Initial discovery call with prospect.\",\n  \"outcome_ids\": [\n    \"outcome_030Xl5QwKi7tPRLRtnuef3\",\n    \"outcome_03oUxZfoO6e2vHmcz1DiHR\"\n  ],\n  \"summary_guidance\": \"Summarize the prospect's pain points and next steps.\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```