GoodMem
ReferenceClient SDKs.NET SDK

Spaces API

Spaces API documentation for .NET SDK

All URIs are relative to *http://localhost:8080*

MethodHTTP requestDescription
CreateSpacePOST /v1/spacesCreate a new Space
DeleteSpaceDELETE /v1/spaces/{id}Delete a space
GetSpaceGET /v1/spaces/{id}Get a space by ID
ListSpacesGET /v1/spacesList spaces
UpdateSpacePUT /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

NameTypeDescriptionNotes
spaceCreationRequestSpaceCreationRequestSpace configuration details

Return type

Space

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
201Successfully created space-
400Invalid request - missing required fields or invalid format-
401Unauthorized - invalid or missing API key-
403Forbidden - insufficient permissions to create spaces-
409Conflict - space with same name already exists for this owner-

↑ Back to .NET SDK

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

NameTypeDescriptionNotes
idstringThe 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 codeDescriptionResponse headers
204Space successfully deleted-
400Invalid request - space ID in invalid format-
401Unauthorized - invalid or missing API key-
403Forbidden - insufficient permissions to delete this space-
404Not found - space with the specified ID does not exist-

↑ Back to .NET SDK

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

NameTypeDescriptionNotes
idstringThe unique identifier of the space to retrieve

Return type

Space

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Successfully retrieved space-
400Invalid request - space ID in invalid format-
401Unauthorized - invalid or missing API key-
403Forbidden - insufficient permissions to view this space-
404Not found - space with the specified ID does not exist-

↑ Back to .NET SDK

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

NameTypeDescriptionNotes
ownerIdstring?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]
nameFilterstring?Filter spaces by name using glob pattern matching[optional]
maxResultsint?Maximum number of results to return in a single page (defaults to 50, clamped to [1, 1000])[optional]
nextTokenstring?Pagination token for retrieving the next set of results[optional]
sortBystring?Field to sort by: 'created_at' or 'name' (default: 'created_at'). Unsupported values return INVALID_ARGUMENT.[optional]
sortOrderstring?Sort order (ASCENDING or DESCENDING, default: DESCENDING)[optional]
labelstring?Filter by label value. Multiple label filters can be specified (e.g., ?label.project=AI&label.team=NLP)[optional]

Return type

ListSpacesResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Successfully retrieved spaces-
400Invalid request - invalid filter parameters or pagination token-
401Unauthorized - invalid or missing API key-
403Forbidden - insufficient permissions to list spaces-

↑ Back to .NET SDK

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

NameTypeDescriptionNotes
idstringThe unique identifier of the space to update
updateSpaceRequestUpdateSpaceRequestSpace update details

Return type

Space

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Successfully updated space-
400Invalid request - ID format or update parameters invalid-
401Unauthorized - invalid or missing API key-
403Forbidden - insufficient permissions to update this space-
404Not found - space with the specified ID does not exist-
409Conflict - name conflicts with existing space for this owner-

↑ Back to .NET SDK