# Get the physical projection schema of each live search index

`GET /profiles/{profileId}/schema`



[AI Search API guide](https://docs.contextual.io/legacy/tenants/tenant-apis/ai-search-api.md)

```json
{
  "openapi": "3.0.3",
  "info": {
    "title": "AI Search Api",
    "description": " ",
    "version": "1.7.5"
  },
  "security": [
    {
      "jwt": []
    }
  ],
  "servers": [
    {
      "url": "https://ai-search.{tenantId}.my.contextual.io/api/v1",
      "variables": {
        "tenantId": {
          "default": "YOUR-TENANT-ID"
        }
      }
    }
  ],
  "paths": {
    "/profiles/{profileId}/schema": {
      "get": {
        "tags": [
          "Profiles"
        ],
        "summary": "Get the physical projection schema of each live search index",
        "parameters": [
          {
            "name": "profileId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 3,
              "maxLength": 64,
              "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
            }
          }
        ],
        "deprecated": false,
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProfileSchemaView"
                }
              }
            }
          },
          "400": {
            "description": "Invalid organization or authorization context",
            "content": {}
          },
          "401": {
            "description": "Missing or invalid authorization header",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/$ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Invalid permissions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/$ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Search profile not found",
            "content": {}
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "jwt": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    },
    "schemas": {
      "ProfileSchemaView": {
        "type": "object",
        "properties": {
          "profileId": {
            "type": "string",
            "minLength": 3,
            "maxLength": 64,
            "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
          },
          "namespaces": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "slot": {
                  "type": "string",
                  "enum": [
                    "current",
                    "next"
                  ]
                },
                "namespace": {
                  "type": "string",
                  "minLength": 1
                },
                "generationId": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,64}$"
                },
                "observation": {
                  "type": "string",
                  "enum": [
                    "observed",
                    "absent",
                    "unavailable"
                  ]
                },
                "observedAt": {
                  "type": "string",
                  "pattern": "^(?:\\d+(?:\\.\\d+?)?|(?:\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?Z))$",
                  "description": "An ISO 8601 date time string",
                  "format": "date-time"
                },
                "columns": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "alias": {
                        "type": "string",
                        "pattern": "^[a-z][a-z0-9_]{0,62}$"
                      },
                      "storage": {
                        "type": "string",
                        "enum": [
                          "string",
                          "int",
                          "uint",
                          "float",
                          "bool",
                          "datetime",
                          "string[]",
                          "int[]",
                          "uint[]",
                          "float[]",
                          "other"
                        ]
                      },
                      "type": {
                        "type": "string",
                        "enum": [
                          "string",
                          "number",
                          "integer",
                          "boolean",
                          "datetime",
                          "string[]",
                          "number[]",
                          "integer[]"
                        ]
                      },
                      "status": {
                        "type": "string",
                        "enum": [
                          "active",
                          "constrained",
                          "conflict",
                          "pending",
                          "retired",
                          "reserved"
                        ]
                      }
                    },
                    "required": [
                      "alias",
                      "status"
                    ],
                    "additionalProperties": false
                  }
                },
                "skipped": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "integer",
                      "exclusiveMinimum": 0,
                      "maximum": 9007199254740991
                    },
                    "firstAt": {
                      "type": "string",
                      "pattern": "^(?:\\d+(?:\\.\\d+?)?|(?:\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?Z))$",
                      "description": "An ISO 8601 date time string",
                      "format": "date-time"
                    },
                    "lastAt": {
                      "type": "string",
                      "pattern": "^(?:\\d+(?:\\.\\d+?)?|(?:\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?Z))$",
                      "description": "An ISO 8601 date time string",
                      "format": "date-time"
                    },
                    "last": {
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "projection-value"
                            },
                            "alias": {
                              "type": "string",
                              "pattern": "^[a-z][a-z0-9_]{0,62}$"
                            },
                            "storage": {
                              "type": "string",
                              "enum": [
                                "string",
                                "int",
                                "uint",
                                "float",
                                "bool",
                                "datetime",
                                "string[]",
                                "int[]",
                                "uint[]",
                                "float[]",
                                "other"
                              ]
                            },
                            "received": {
                              "type": "string",
                              "enum": [
                                "string",
                                "boolean",
                                "integer",
                                "negative-integer",
                                "unsafe-integer",
                                "fraction",
                                "non-finite",
                                "array",
                                "object",
                                "null"
                              ]
                            },
                            "providerStatus": {
                              "type": "integer",
                              "minimum": -9007199254740991,
                              "maximum": 9007199254740991
                            }
                          },
                          "required": [
                            "kind",
                            "alias",
                            "storage",
                            "received"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "projection-expression"
                            }
                          },
                          "required": [
                            "kind"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "record-content"
                            }
                          },
                          "required": [
                            "kind"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "type": "string",
                              "const": "drained"
                            },
                            "cutoff": {
                              "type": "string",
                              "pattern": "^(?:\\d+(?:\\.\\d+?)?|(?:\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?Z))$",
                              "description": "An ISO 8601 date time string",
                              "format": "date-time"
                            }
                          },
                          "required": [
                            "kind",
                            "cutoff"
                          ],
                          "additionalProperties": false
                        }
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "count",
                    "firstAt",
                    "lastAt",
                    "last"
                  ],
                  "additionalProperties": false
                }
              },
              "required": [
                "slot",
                "namespace",
                "generationId",
                "observation",
                "columns"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "profileId",
          "namespaces"
        ],
        "additionalProperties": false
      },
      "$ErrorResponse": {
        "type": "object",
        "properties": {
          "code": {
            "type": [
              "string",
              "number"
            ]
          },
          "message": {
            "type": "string"
          },
          "errors": {
            "type": "array",
            "items": {}
          }
        },
        "required": [
          "code",
          "message"
        ],
        "additionalProperties": false
      }
    }
  }
}
```