---
agentTools:
  projectIndex: https://shipyard.readme.io/llms.txt
---

# Create Blueprint

Create a new Blueprint in the target Organization

### Request Body

The payload is a JSON definition of a Blueprint. Several things to note about the payload are below.

1. `state` value options are `1` (Disabled), `2` (Draft), and `3` (Enabled).
2. `pallet_type` value options are `2` (Python), `3` (Bash), and `7` (Node).
3. `program` value options are `python3`, `bash`, and `node` and should correspond with `pallet_type`.
4. `type` for a `spec_list` object value options are `1` (String), `2` (Integer), `3` (Floating), `4` (Boolean), `5` (Date), `6` (Select), `7` (Password), `8` (External file). For `select` input types, the `type_spec` field will be an array of objects containing `name` and `value` fields and a default selection must be made corresponding to one of the object `name` fields.
5. `number_of_retries` can be between 0 and 24.
6. `ttr` can be between 0 and 3600 in increments of 300.
7. `runtime_timeout` can be between 300 and 3600.
8. `exclude_exit_code_ranges` may contain an array of arrays each with two integers between 1 and 255 - in the example below, the exit codes 1, 3, 4, and 5 are ignored.
9. `external_file` holds a `temp` field with an object with `id` and `url` keys - these are populated using the `RequestID` and `ExternalFile` values from the **Create External File** response.

Here's an example Blueprint JSON payload.

```json
{
    "name": "Test Blueprint",
    "synopsis": "Example synopsis",
    "description": "Example description",
    "state": 3,
    "pallet_type": 2,
    "pallet_config": {
        "version": "3.7",
        "command": {
            "program": "python3",
            "file_to_run": "script.py"
        },
        "external_file": {
            "temp": {
                "file_name": "script.py",
                "id": "TEMP",
                "url": "s3://production-shipyard-uploads-tmp/tmp/organizations/TEMP/requests/TEMP.sefv2_TEMP"
            }
        }
    },
    "spec_list": [
        {
            "display_name": "First Input",
            "name": "FIRST_INPUT",
            "type": 1,
            "required": false,
            "placeholder": "Enter a first input",
            "description": "A first input",
            "default": "example_value",
            "type_spec": {
                "multiline": false
            }
        }
    ],
    "retry_strategy": {
        "number_of_retries": 3,
        "ttr": 900
    },
    "runtime_timeout": 2700,
    "exclude_exit_code_ranges": [
        [
            1,
            1
        ],
        [
            3,
            5
        ]
    ]
}
```

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Shipyard API",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://api.app.shipyardapp.com"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Shipyard-API-Key"
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/orgs/{org_id}/blueprints": {
      "post": {
        "summary": "Create Blueprint",
        "description": "Create a new Blueprint in the target Organization",
        "operationId": "create-blueprint",
        "parameters": [
          {
            "name": "org_id",
            "in": "path",
            "description": "UUID of the Organization to create the Blueprint in",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "RAW_BODY": {
                    "type": "string",
                    "description": "The content of the Blueprint definition in string-encoded JSON format"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n    \"data_kind\": \"blueprint\",\n    \"data\": {\n        \"org_id\": \"TEMP\",\n        \"id\": \"TEMP\",\n        \"created_by\": {\n            \"id\": \"TEMP\",\n            \"email\": \"\"\n        },\n        \"updated_by\": {\n            \"id\": \"TEMP\",\n            \"email\": \"\"\n        },\n        \"created_at\": \"2023-12-08T21:01:42.297618768Z\",\n        \"updated_at\": \"2023-12-08T21:01:42.297618768Z\",\n        \"name\": \"Test Blueprint\",\n        \"synopsis\": \"Example synopsis\",\n        \"description\": \"Example description\",\n        \"image_url\": \"\",\n        \"state\": 3,\n        \"pallet_type\": 2,\n        \"pallet_config\": {\n            \"version\": \"3.7\",\n            \"env_vars\": [],\n            \"packages\": [],\n            \"system_packages\": [],\n            \"external_file_url\": \"s3://production-shipyard-uploads/organizations/TEMP/blueprints/TEMP/config/external_files/script.py.sefv2_8082ff1c-30ce-4fe0-b583-96bc21c30a6b?versionId=null\",\n            \"command\": {\n                \"program\": \"python3\",\n                \"file_to_run\": \"script.py\"\n            },\n            \"github\": null\n        },\n        \"spec_list\": [\n            {\n                \"default\": \"example_value\",\n                \"description\": \"A first input\",\n                \"display_name\": \"First Input\",\n                \"id\": \"TEMP\",\n                \"name\": \"FIRST_INPUT\",\n                \"placeholder\": \"Enter a first input\",\n                \"required\": false,\n                \"type\": 1,\n                \"type_spec\": {\n                    \"multiline\": false\n                }\n            }\n        ],\n        \"retry_strategy\": {\n            \"ttr\": 900,\n            \"number_of_retries\": 3\n        },\n        \"category_ids\": null,\n        \"runtime_timeout\": 2700,\n        \"dep_count\": 0,\n        \"exclude_exit_code_ranges\": [\n            [\n                1,\n                1\n            ],\n            [\n                3,\n                5\n            ]\n        ],\n        \"is_free\": false\n    }\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "data_kind": {
                      "type": "string",
                      "example": "blueprint"
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "org_id": {
                          "type": "string",
                          "example": "TEMP"
                        },
                        "id": {
                          "type": "string",
                          "example": "TEMP"
                        },
                        "created_by": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "example": "TEMP"
                            },
                            "email": {
                              "type": "string",
                              "example": ""
                            }
                          }
                        },
                        "updated_by": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string",
                              "example": "TEMP"
                            },
                            "email": {
                              "type": "string",
                              "example": ""
                            }
                          }
                        },
                        "created_at": {
                          "type": "string",
                          "example": "2023-12-08T21:01:42.297618768Z"
                        },
                        "updated_at": {
                          "type": "string",
                          "example": "2023-12-08T21:01:42.297618768Z"
                        },
                        "name": {
                          "type": "string",
                          "example": "Test Blueprint"
                        },
                        "synopsis": {
                          "type": "string",
                          "example": "Example synopsis"
                        },
                        "description": {
                          "type": "string",
                          "example": "Example description"
                        },
                        "image_url": {
                          "type": "string",
                          "example": ""
                        },
                        "state": {
                          "type": "integer",
                          "example": 3,
                          "default": 0
                        },
                        "pallet_type": {
                          "type": "integer",
                          "example": 2,
                          "default": 0
                        },
                        "pallet_config": {
                          "type": "object",
                          "properties": {
                            "version": {
                              "type": "string",
                              "example": "3.7"
                            },
                            "env_vars": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {}
                              }
                            },
                            "packages": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {}
                              }
                            },
                            "system_packages": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {}
                              }
                            },
                            "external_file_url": {
                              "type": "string",
                              "example": "s3://production-shipyard-uploads/organizations/TEMP/blueprints/TEMP/config/external_files/script.py.sefv2_8082ff1c-30ce-4fe0-b583-96bc21c30a6b?versionId=null"
                            },
                            "command": {
                              "type": "object",
                              "properties": {
                                "program": {
                                  "type": "string",
                                  "example": "python3"
                                },
                                "file_to_run": {
                                  "type": "string",
                                  "example": "script.py"
                                }
                              }
                            },
                            "github": {}
                          }
                        },
                        "spec_list": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "default": {
                                "type": "string",
                                "example": "example_value"
                              },
                              "description": {
                                "type": "string",
                                "example": "A first input"
                              },
                              "display_name": {
                                "type": "string",
                                "example": "First Input"
                              },
                              "id": {
                                "type": "string",
                                "example": "TEMP"
                              },
                              "name": {
                                "type": "string",
                                "example": "FIRST_INPUT"
                              },
                              "placeholder": {
                                "type": "string",
                                "example": "Enter a first input"
                              },
                              "required": {
                                "type": "boolean",
                                "example": false,
                                "default": true
                              },
                              "type": {
                                "type": "integer",
                                "example": 1,
                                "default": 0
                              },
                              "type_spec": {
                                "type": "object",
                                "properties": {
                                  "multiline": {
                                    "type": "boolean",
                                    "example": false,
                                    "default": true
                                  }
                                }
                              }
                            }
                          }
                        },
                        "retry_strategy": {
                          "type": "object",
                          "properties": {
                            "ttr": {
                              "type": "integer",
                              "example": 900,
                              "default": 0
                            },
                            "number_of_retries": {
                              "type": "integer",
                              "example": 3,
                              "default": 0
                            }
                          }
                        },
                        "category_ids": {},
                        "runtime_timeout": {
                          "type": "integer",
                          "example": 2700,
                          "default": 0
                        },
                        "dep_count": {
                          "type": "integer",
                          "example": 0,
                          "default": 0
                        },
                        "exclude_exit_code_ranges": {
                          "type": "array",
                          "items": {
                            "type": "array",
                            "items": {
                              "type": "integer",
                              "example": 1,
                              "default": 0
                            }
                          }
                        },
                        "is_free": {
                          "type": "boolean",
                          "example": false,
                          "default": true
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true,
  "_id": "6572604cfc3f31000fe88156:657385deb078ed001181b19e"
}
```