> ## Documentation Index
> Fetch the complete documentation index at: https://docs.explo.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Blueprint

This endpoint creates a new blueprint.

### Body

<ParamField body="customer_id" type="string" required>
  This is your unique identifier for your customer
</ParamField>

<ParamField body="blueprint_name" type="string" required>
  This is what the blueprint will be named
</ParamField>

<ParamField body="tables" type="object" required>
  List of tables and column information associated with the customer

  <Expandable title="table">
    <ParamField body="table_name" type="string" required>
      Name of the table. Query will be "SELECT \* FROM table\_name"
    </ParamField>

    <ParamField body="schema_id" type="number" required>
      Schema this table is attached to.
    </ParamField>

    <ParamField body="query" type="string">
      Query to override the default "SELECT \* FROM table\_name". Optional
      parameter.
    </ParamField>

    <ParamField body="columns" type="object" required>
      List of columns in this table

      <Expandable title="column">
        <ParamField body="name" type="string" required>
          Name of table column
        </ParamField>

        <ParamField body="type" type="string" required>
          The type of the column. Has to be one of INTEGER, FLOAT, BOOLEAN,
          STRING, DATETIME, TIMESTAMP, or DATE
        </ParamField>

        <ParamField body="display_name" type="string">
          Display name for column. If not provided, name will be used
        </ParamField>

        <ParamField body="can_be_grouped" type="boolean" default="true">
          If column can be used to group data in charts
        </ParamField>
      </Expandable>
    </ParamField>

    <ParamField body="dataset_name" type="string">
      Name of dataset supplied to customers. If null, table\_name will be used
    </ParamField>

    <ParamField body="description" type="string">
      Description of dataset for customers
    </ParamField>
  </Expandable>
</ParamField>

### Response

<ResponseField name="success" type="number">
  Indicates whether the call was successful. 1 if successful, 0 if not.
</ResponseField>

<ResponseField name="blueprint_id" type="number">
  The id of the new blueprint
</ResponseField>

<RequestExample>
  ```bash Example Request theme={null}
  curl --location --request POST 'https://api.explo.co/api/create_blueprint/' \
  --header 'Content-Type: application/json' \
  --header 'Explo-Authorization: Token <token>' \
  --data-raw '{
      "customer_id": "8698a0e4-009d-4b2d-8a41-d7f35cf08b98",
      "blueprint_name": "Customer 1 Blueprint",
      "tables": [
          {
              "table_name": "location",
              "schema_id": 1,
              "query": "select *,2 as hello from location",
              "columns": [
                  {
                      "name": "id",
                      "type": "INTEGER"
                  },
                  {
                      "name": "host_id",
                      "type": "INTEGER"
                  },
                  {
                      "name": "host_name",
                      "display_name": "Host Name",
                      "type": "STRING",
                      "can_be_grouped": false
                  }
              ]
          }
      ]
  }'
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "success": 1,
    "blueprint_id": 10
  }
  ```
</ResponseExample>
