Spaces API
Spaces API documentation for .NET SDK
All URIs are relative to *http://localhost:8080*
| Method | HTTP request | Description |
|---|---|---|
| CreateSpace | POST /v1/spaces | Create a new Space |
| DeleteSpace | DELETE /v1/spaces/{id} | Delete a space |
| GetSpace | GET /v1/spaces/{id} | Get a space by ID |
| ListSpaces | GET /v1/spaces | List spaces |
| UpdateSpace | PUT /v1/spaces/{id} | Update a space |
CreateSpace
Space CreateSpace (SpaceCreationRequest spaceCreationRequest)
Create a new Space
Creates a new space with the provided name, labels, and embedder configuration. A space is a container for organizing related memories. OWNER DEFAULTS: Owner defaults to authenticated user unless owner_id is provided (requires CREATE_SPACE_ANY if differs). EMBEDDER DEFAULTS: If no embedders are specified, a system-default embedder is attached. DUPLICATE DETECTION: Returns ALREADY_EXISTS if another space exists with identical {owner_id, name} (case-sensitive). Requires CREATE_SPACE_OWN permission (or CREATE_SPACE_ANY for admin users). This operation is NOT idempotent.
Example
using System.Collections.Generic;
using System.Diagnostics;
using System.Net.Http;
using Pairsystems.Goodmem.Client.Api;
using Pairsystems.Goodmem.Client.Client;
using Pairsystems.Goodmem.Client.Model;
namespace Example
{
public class CreateSpaceExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "[http://localhost";](http://localhost";)
// create instances of HttpClient, HttpClientHandler to be reused later with different Api classes
HttpClient httpClient = new HttpClient();
HttpClientHandler httpClientHandler = new HttpClientHandler();
var apiInstance = new SpacesApi(httpClient, config, httpClientHandler);
var spaceCreationRequest = new SpaceCreationRequest(); // SpaceCreationRequest | Space configuration details
try
{
// Create a new Space
Space result = apiInstance.CreateSpace(spaceCreationRequest);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling SpacesApi.CreateSpace: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}Using the CreateSpaceWithHttpInfo variant
This returns an ApiResponse object which contains the response data, status code and headers.
try
{
// Create a new Space
`ApiResponse<Space>` response = apiInstance.CreateSpaceWithHttpInfo(spaceCreationRequest);
Debug.Write("Status Code: " + response.StatusCode);
Debug.Write("Response Headers: " + response.Headers);
Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exception when calling SpacesApi.CreateSpaceWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| spaceCreationRequest | SpaceCreationRequest | Space configuration details |
Return type
Authorization
No authorization required
HTTP request headers
- Content-Type: application/json
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 201 | Successfully created space | - |
| 400 | Invalid request - missing required fields or invalid format | - |
| 401 | Unauthorized - invalid or missing API key | - |
| 403 | Forbidden - insufficient permissions to create spaces | - |
| 409 | Conflict - space with same name already exists for this owner | - |
DeleteSpace
void DeleteSpace (string id)
Delete a space
Permanently deletes a space and all associated content. This operation cannot be undone. CASCADE DELETION: Removes the space record and cascades deletion to associated memories, chunks, and embedder associations. Requires DELETE_SPACE_OWN permission for spaces you own (or DELETE_SPACE_ANY for admin users). This operation is safe to retry - may return NOT_FOUND if already deleted.
Example
using System.Collections.Generic;
using System.Diagnostics;
using System.Net.Http;
using Pairsystems.Goodmem.Client.Api;
using Pairsystems.Goodmem.Client.Client;
using Pairsystems.Goodmem.Client.Model;
namespace Example
{
public class DeleteSpaceExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "[http://localhost";](http://localhost";)
// create instances of HttpClient, HttpClientHandler to be reused later with different Api classes
HttpClient httpClient = new HttpClient();
HttpClientHandler httpClientHandler = new HttpClientHandler();
var apiInstance = new SpacesApi(httpClient, config, httpClientHandler);
var id = 550e8400-e29b-41d4-a716-446655440000; // string | The unique identifier of the space to delete
try
{
// Delete a space
apiInstance.DeleteSpace(id);
}
catch (ApiException e)
{
Debug.Print("Exception when calling SpacesApi.DeleteSpace: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}Using the DeleteSpaceWithHttpInfo variant
This returns an ApiResponse object which contains the response data, status code and headers.
try
{
// Delete a space
apiInstance.DeleteSpaceWithHttpInfo(id);
}
catch (ApiException e)
{
Debug.Print("Exception when calling SpacesApi.DeleteSpaceWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | string | The unique identifier of the space to delete |
Return type
void (empty response body)
Authorization
No authorization required
HTTP request headers
- Content-Type: Not defined
- Accept: Not defined
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 204 | Space successfully deleted | - |
| 400 | Invalid request - space ID in invalid format | - |
| 401 | Unauthorized - invalid or missing API key | - |
| 403 | Forbidden - insufficient permissions to delete this space | - |
| 404 | Not found - space with the specified ID does not exist | - |
GetSpace
Space GetSpace (string id)
Get a space by ID
Retrieves a specific space by its unique identifier. Returns the complete space information, including name, labels, embedder configuration, and metadata. PUBLIC SPACE ACCESS: When public_read=true, any authenticated user can retrieve the space metadata, bypassing ownership checks. Otherwise, requires ownership or DISPLAY_SPACE_ANY permission. Requires DISPLAY_SPACE_OWN permission for owned spaces (or DISPLAY_SPACE_ANY for admin users to view any space). This is a read-only operation safe to retry.
Example
using System.Collections.Generic;
using System.Diagnostics;
using System.Net.Http;
using Pairsystems.Goodmem.Client.Api;
using Pairsystems.Goodmem.Client.Client;
using Pairsystems.Goodmem.Client.Model;
namespace Example
{
public class GetSpaceExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "[http://localhost";](http://localhost";)
// create instances of HttpClient, HttpClientHandler to be reused later with different Api classes
HttpClient httpClient = new HttpClient();
HttpClientHandler httpClientHandler = new HttpClientHandler();
var apiInstance = new SpacesApi(httpClient, config, httpClientHandler);
var id = 550e8400-e29b-41d4-a716-446655440000; // string | The unique identifier of the space to retrieve
try
{
// Get a space by ID
Space result = apiInstance.GetSpace(id);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling SpacesApi.GetSpace: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}Using the GetSpaceWithHttpInfo variant
This returns an ApiResponse object which contains the response data, status code and headers.
try
{
// Get a space by ID
`ApiResponse<Space>` response = apiInstance.GetSpaceWithHttpInfo(id);
Debug.Write("Status Code: " + response.StatusCode);
Debug.Write("Response Headers: " + response.Headers);
Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exception when calling SpacesApi.GetSpaceWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | string | The unique identifier of the space to retrieve |
Return type
Authorization
No authorization required
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successfully retrieved space | - |
| 400 | Invalid request - space ID in invalid format | - |
| 401 | Unauthorized - invalid or missing API key | - |
| 403 | Forbidden - insufficient permissions to view this space | - |
| 404 | Not found - space with the specified ID does not exist | - |
ListSpaces
ListSpacesResponse ListSpaces (string? ownerId = null, string? nameFilter = null, int? maxResults = null, string? nextToken = null, string? sortBy = null, string? sortOrder = null, string? label = null)
List spaces
Retrieves a list of spaces accessible to the caller, with optional filtering by owner, labels, and name. Results are paginated with a maximum number of spaces per response. PERMISSION-BASED FILTERING: With LIST_SPACE_ANY and owner_id omitted, returns all visible spaces; otherwise returns caller-owned spaces only. DEFAULT SORT: Results ordered by created_at DESCENDING unless specified otherwise. MAX_RESULTS CLAMPING: max_results defaults to 50 and is clamped to [1, 1000] range. Requires LIST_SPACE_OWN or LIST_SPACE_ANY permission.
Example
using System.Collections.Generic;
using System.Diagnostics;
using System.Net.Http;
using Pairsystems.Goodmem.Client.Api;
using Pairsystems.Goodmem.Client.Client;
using Pairsystems.Goodmem.Client.Model;
namespace Example
{
public class ListSpacesExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "[http://localhost";](http://localhost";)
// create instances of HttpClient, HttpClientHandler to be reused later with different Api classes
HttpClient httpClient = new HttpClient();
HttpClientHandler httpClientHandler = new HttpClientHandler();
var apiInstance = new SpacesApi(httpClient, config, httpClientHandler);
var ownerId = 550e8400-e29b-41d4-a716-446655440000; // string? | Filter spaces by owner ID. With LIST_SPACE_ANY permission and owner_id omitted, returns all visible spaces. Otherwise returns caller-owned spaces only. Specifying owner_id without LIST_SPACE_ANY returns PERMISSION_DENIED. (optional)
var nameFilter = Research*; // string? | Filter spaces by name using glob pattern matching (optional)
var maxResults = 20; // int? | Maximum number of results to return in a single page (defaults to 50, clamped to [1, 1000]) (optional)
var nextToken = eyJzdGFydCI6MjAsIm93bmVySWQiOiJiMzMwM2QwYS0...; // string? | Pagination token for retrieving the next set of results (optional)
var sortBy = name; // string? | Field to sort by: 'created_at' or 'name' (default: 'created_at'). Unsupported values return INVALID_ARGUMENT. (optional)
var sortOrder = ASCENDING; // string? | Sort order (ASCENDING or DESCENDING, default: DESCENDING) (optional)
var label = ?label.project=AI&label.team=NLP; // string? | Filter by label value. Multiple label filters can be specified (e.g., ?label.project=AI&label.team=NLP) (optional)
try
{
// List spaces
ListSpacesResponse result = apiInstance.ListSpaces(ownerId, nameFilter, maxResults, nextToken, sortBy, sortOrder, label);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling SpacesApi.ListSpaces: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}Using the ListSpacesWithHttpInfo variant
This returns an ApiResponse object which contains the response data, status code and headers.
try
{
// List spaces
`ApiResponse<ListSpacesResponse>` response = apiInstance.ListSpacesWithHttpInfo(ownerId, nameFilter, maxResults, nextToken, sortBy, sortOrder, label);
Debug.Write("Status Code: " + response.StatusCode);
Debug.Write("Response Headers: " + response.Headers);
Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exception when calling SpacesApi.ListSpacesWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| ownerId | string? | Filter spaces by owner ID. With LIST_SPACE_ANY permission and owner_id omitted, returns all visible spaces. Otherwise returns caller-owned spaces only. Specifying owner_id without LIST_SPACE_ANY returns PERMISSION_DENIED. | [optional] |
| nameFilter | string? | Filter spaces by name using glob pattern matching | [optional] |
| maxResults | int? | Maximum number of results to return in a single page (defaults to 50, clamped to [1, 1000]) | [optional] |
| nextToken | string? | Pagination token for retrieving the next set of results | [optional] |
| sortBy | string? | Field to sort by: 'created_at' or 'name' (default: 'created_at'). Unsupported values return INVALID_ARGUMENT. | [optional] |
| sortOrder | string? | Sort order (ASCENDING or DESCENDING, default: DESCENDING) | [optional] |
| label | string? | Filter by label value. Multiple label filters can be specified (e.g., ?label.project=AI&label.team=NLP) | [optional] |
Return type
Authorization
No authorization required
HTTP request headers
- Content-Type: Not defined
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successfully retrieved spaces | - |
| 400 | Invalid request - invalid filter parameters or pagination token | - |
| 401 | Unauthorized - invalid or missing API key | - |
| 403 | Forbidden - insufficient permissions to list spaces | - |
UpdateSpace
Space UpdateSpace (string id, UpdateSpaceRequest updateSpaceRequest)
Update a space
Updates an existing space with new values for the specified fields. Only name, publicRead, and labels can be updated. Fields not included in the request remain unchanged. IMMUTABLE FIELDS: space_embedders, default_chunking_config, and owner_id cannot be modified after creation. NAME UNIQUENESS: Name must be unique per owner - returns ALREADY_EXISTS if name conflicts with existing space. Requires UPDATE_SPACE_OWN permission for spaces you own (or UPDATE_SPACE_ANY for admin users). This operation is idempotent.
Example
using System.Collections.Generic;
using System.Diagnostics;
using System.Net.Http;
using Pairsystems.Goodmem.Client.Api;
using Pairsystems.Goodmem.Client.Client;
using Pairsystems.Goodmem.Client.Model;
namespace Example
{
public class UpdateSpaceExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "[http://localhost";](http://localhost";)
// create instances of HttpClient, HttpClientHandler to be reused later with different Api classes
HttpClient httpClient = new HttpClient();
HttpClientHandler httpClientHandler = new HttpClientHandler();
var apiInstance = new SpacesApi(httpClient, config, httpClientHandler);
var id = 550e8400-e29b-41d4-a716-446655440000; // string | The unique identifier of the space to update
var updateSpaceRequest = new UpdateSpaceRequest(); // UpdateSpaceRequest | Space update details
try
{
// Update a space
Space result = apiInstance.UpdateSpace(id, updateSpaceRequest);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling SpacesApi.UpdateSpace: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}Using the UpdateSpaceWithHttpInfo variant
This returns an ApiResponse object which contains the response data, status code and headers.
try
{
// Update a space
`ApiResponse<Space>` response = apiInstance.UpdateSpaceWithHttpInfo(id, updateSpaceRequest);
Debug.Write("Status Code: " + response.StatusCode);
Debug.Write("Response Headers: " + response.Headers);
Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exception when calling SpacesApi.UpdateSpaceWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}Parameters
| Name | Type | Description | Notes |
|---|---|---|---|
| id | string | The unique identifier of the space to update | |
| updateSpaceRequest | UpdateSpaceRequest | Space update details |
Return type
Authorization
No authorization required
HTTP request headers
- Content-Type: application/json
- Accept: application/json
HTTP response details
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successfully updated space | - |
| 400 | Invalid request - ID format or update parameters invalid | - |
| 401 | Unauthorized - invalid or missing API key | - |
| 403 | Forbidden - insufficient permissions to update this space | - |
| 404 | Not found - space with the specified ID does not exist | - |
| 409 | Conflict - name conflicts with existing space for this owner | - |