---
updatedAt: 2026-05-28T12:07:53.000Z
agentTools:
  projectIndex: https://docs.phacetlabs.com/llms.txt
---

# Create Session

Creates a new Session within the specified Table. Provide an optional name to label the Session; if omitted, a default name will be used.

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "paths": {
    "/api/v2/tables/{tableId}/sessions": {
      "post": {
        "description": "Creates a new Session within the specified Table. Provide an optional name to label the Session; if omitted, a default name will be used.",
        "operationId": "createSession",
        "parameters": [
          {
            "name": "tableId",
            "required": true,
            "in": "path",
            "description": "The unique identifier of the Table",
            "schema": {
              "format": "uuid",
              "example": "123e4567-e89b-12d3-a456-426614174000"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSessionRequestDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successfully created the Session",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionResponseDto"
                },
                "example": {
                  "id": "123e4567-e89b-12d3-a456-426614174001",
                  "name": "Session 1",
                  "createdAt": "2024-01-15T10:30:00.000Z",
                  "updatedAt": "2024-03-10T11:00:00.000Z"
                }
              }
            }
          },
          "400": {
            "description": "Returned when the request is invalid. The response body will contain a list of validation errors",
            "content": {
              "application/json": {
                "example": {
                  "message": "The value must be a string",
                  "errorKey": "BadRequestError"
                }
              }
            }
          },
          "401": {
            "description": "Returned when the request is unauthorized.",
            "content": {
              "application/json": {
                "example": {
                  "message": "Unknown API key",
                  "errorKey": "UnauthorizedError"
                }
              }
            }
          },
          "404": {
            "description": "Returned when the requested resource could not be found within your organization",
            "content": {
              "application/json": {
                "example": {
                  "message": "The resource you are trying to access does not exist or is not accessible by your organization",
                  "errorKey": "NotFoundError"
                }
              }
            }
          },
          "500": {
            "description": "Returned when an error occurs on the server.",
            "content": {
              "application/json": {
                "example": {
                  "message": "An unexpected error occurred. Please try again later.",
                  "errorKey": "InternalServerError"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "Create Session",
        "tags": [
          "Sessions"
        ]
      }
    }
  },
  "info": {
    "title": "Phacet API",
    "description": "Phacet API (current version with project support)",
    "version": "2.0",
    "contact": {}
  },
  "servers": [
    {
      "url": "https://api.phacetlabs.com",
      "description": "Production"
    }
  ],
  "components": {
    "securitySchemes": {
      "bearer": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "type": "http"
      }
    },
    "schemas": {
      "SessionResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The unique identifier of the Session",
            "example": "123e4567-e89b-12d3-a456-426614174000",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "description": "The name of the Session",
            "example": "Session 1"
          },
          "createdAt": {
            "type": "string",
            "description": "The ISO 8601 timestamp when the Session was created",
            "example": "2024-01-15T10:30:00.000Z",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "description": "The ISO 8601 timestamp when the Session was updated",
            "example": "2024-01-15T10:30:00.000Z",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "name",
          "createdAt",
          "updatedAt"
        ]
      },
      "CreateSessionRequestDto": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Optional display name for the Session. Leading and trailing whitespace will be trimmed automatically.",
            "example": "Session 1"
          }
        }
      }
    }
  }
}
```