GoodMemGoodMem

Service Identities

Production service identity lifecycle.

Methods on this page are called through client.service_identities.

client.service_identities.create

client.service_identities.create(request: CreateServiceIdentityRequest, requestOptions?: RequestOptions): Promise<ServiceIdentityResponseShape>

Creates one production-workload identity owned by the authenticated human. No API key, role, grant, or authentication mapping is created implicitly.

HTTP: POST /v1/service-identities

Parameters

ParameterTypeDescription
requestCreateServiceIdentityRequestRequest body.
requestOptionsRequestOptions optionalPer-call signal, timeout, or headers.

Returns: Promise&lt;ServiceIdentityResponseShape&gt;

Example

const identity = await client.serviceIdentities.create({
  displayName: "production-indexer",
  description: "Indexes newly uploaded memories",
  labels: { environment: "production" },
});

client.service_identities.delete

client.service_identities.delete(id: string, requestOptions?: RequestOptions): Promise<void>

Permanently soft-deletes the principal. Its stored credentials remain audit records but can no longer authenticate because their subject is deleted. Repeating an authorized delete succeeds without rewriting audit data.

HTTP: DELETE /v1/service-identities/&#123;id&#125;

Parameters

ParameterTypeDescription
idstringService-identity UUID
requestOptionsRequestOptions optionalPer-call signal, timeout, or headers.

Returns: Promise&lt;void&gt;

Example

await client.serviceIdentities.delete(
  transferredIdentity.serviceIdentity.serviceIdentityId,
);

client.service_identities.get

client.service_identities.get(id: string, options?: ServiceIdentitiesGetOptions, requestOptions?: RequestOptions): Promise<ServiceIdentityResponseShape>

Returns a service identity after applying READ_SERVICE_IDENTITY authority. includeDeleted permits an authorized caller to inspect a permanent tombstone; it does not grant additional authority.

HTTP: GET /v1/service-identities/&#123;id&#125;

Parameters

ParameterTypeDescription
idstringService-identity UUID
optionsServiceIdentitiesGetOptions optionalOptional query parameters.
requestOptionsRequestOptions optionalPer-call signal, timeout, or headers.

Returns: Promise&lt;ServiceIdentityResponseShape&gt;

Example

const fetchedIdentity = await client.serviceIdentities.get(identity.serviceIdentityId);

client.service_identities.list

client.service_identities.list(options?: ServiceIdentitiesListOptions, requestOptions?: RequestOptions): Promise<Page<ServiceIdentityResponseShape>>

Requires LIST_SERVICE_IDENTITY on the GoodMem instance and READ_SERVICE_IDENTITY on each returned row. Owner and label filters, lifecycle filtering, authorization, and keyset pagination execute in PostgreSQL. LABEL FILTERS: Label filters accept either label.<key>=<value> or label[key]=value (for example, label.environment=production or label[environment]=production).

HTTP: GET /v1/service-identities

Parameters

ParameterTypeDescription
optionsServiceIdentitiesListOptions optionalOptional query parameters.
requestOptionsRequestOptions optionalPer-call signal, timeout, or headers.

Returns: Promise&lt;Page&lt;ServiceIdentityResponseShape&gt;&gt;

Example

for await (const item of await client.serviceIdentities.list({ maxResults: 25 })) {
  console.log(item.serviceIdentityId, item.displayName);
}

client.service_identities.transferOwnership

client.service_identities.transferOwnership(id: string, request: TransferOwnershipRequest, requestOptions?: RequestOptions): Promise<TransferServiceIdentityOwnershipResponseShape>

Transfers administrative ownership to another active principal. A service identity cannot own itself. The service identity's subject, immutable creator, credentials, grants, and roles are unchanged.

HTTP: POST /v1/service-identities/&#123;id&#125;:transferOwnership

Parameters

ParameterTypeDescription
idstringService-identity UUID
requestTransferOwnershipRequestRequest body.
requestOptionsRequestOptions optionalPer-call signal, timeout, or headers.

Returns: Promise&lt;TransferServiceIdentityOwnershipResponseShape&gt;

Example

const transferredIdentity = await client.serviceIdentities.transferOwnership(
  updatedIdentity.serviceIdentityId,
  { newOwnerId: "70e025f6-76ca-4cbe-b8fc-7dab8e84590a" },
);

client.service_identities.update

client.service_identities.update(id: string, request: UpdateServiceIdentityRequest, requestOptions?: RequestOptions): Promise<ServiceIdentityResponseShape>

Updates only fields present in the request. Empty description clears that optional field. Ownership changes use the dedicated transfer endpoint.

HTTP: PUT /v1/service-identities/&#123;id&#125;

Parameters

ParameterTypeDescription
idstringService-identity UUID
requestUpdateServiceIdentityRequestRequest body.
requestOptionsRequestOptions optionalPer-call signal, timeout, or headers.

Returns: Promise&lt;ServiceIdentityResponseShape&gt;

Example

const updatedIdentity = await client.serviceIdentities.update(
  fetchedIdentity.serviceIdentityId,
  { description: "Indexes production knowledge sources" },
);

Data Models

Interfaces

CreateServiceIdentityRequest

Creates a service identity owned by the authenticated human. It does not create credentials, roles, or grants.

FieldTypeRequiredDescription
serviceIdentityIdstring | nullnoOptional client-provided UUID; generated by the server when omitted.
displayNamestringyesGlobally unique, nonblank operator-facing name.
descriptionstring | nullnoOptional operator description.
labelsRecord&lt;string, string&gt; | nullnoOptional labels for organization and filtering. At most 20 entries; keys and values contain at most 255 characters; keys use [a-z0-9._-].

ListServiceIdentitiesResponse

One authorization-filtered page of service identities.

FieldTypeRequiredDescription
serviceIdentitiesArray&lt;ServiceIdentityResponse&gt;yesOUTPUT_ONLY; service identities in stable keyset order.
nextTokenstring | nullnoOUTPUT_ONLY; opaque continuation token, omitted after the final page.

ServiceIdentityResponse

A durable production workload identity. Credentials, grants, and roles are separate resources and are not included.

FieldTypeRequiredDescription
serviceIdentityIdstringyesOUTPUT_ONLY; immutable service-identity UUID.
displayNamestringyesOUTPUT_ONLY; unique operator-facing display name.
descriptionstring | nullnoOUTPUT_ONLY; optional operator description.
ownerPrincipalIdstringyesOUTPUT_ONLY; current administrative owner principal UUID.
creatorPrincipalIdstringyesOUTPUT_ONLY; immutable HUMAN creator-principal UUID.
labelsRecord&lt;string, string&gt;yesOUTPUT_ONLY; mutable labels. At most 20 entries; keys and values contain at most 255 characters; keys use [a-z0-9._-].
deletedAtnumber | nullnoOUTPUT_ONLY; permanent deletion time in milliseconds, absent while active.
deletedByIdstring | nullnoOUTPUT_ONLY; exact deleting actor UUID, absent while active.
createdAtnumberyesOUTPUT_ONLY; creation time in milliseconds since the epoch.
updatedAtnumberyesOUTPUT_ONLY; most recent mutation time in milliseconds since the epoch.
createdByIdstringyesOUTPUT_ONLY; exact creating actor UUID.
updatedByIdstringyesOUTPUT_ONLY; exact actor UUID for the most recent mutation.

TransferServiceIdentityOwnershipResponse

The service identity after its administrative ownership transfer.

FieldTypeRequiredDescription
serviceIdentityServiceIdentityResponseyesOUTPUT_ONLY; updated service identity.

UpdateServiceIdentityRequest

Updates explicitly present profile fields. Empty description clears it; omitted fields remain unchanged. Ownership is changed only through the transfer endpoint.

FieldTypeRequiredDescription
displayNamestring | nullnoReplacement display name. A present blank value is invalid.
descriptionstring | nullnoReplacement description. An empty string clears the description.
replaceLabelsRecord&lt;string, string&gt; | nullnoComplete replacement label map; an empty map clears all labels and is mutually exclusive with mergeLabels. At most 20 entries; keys and values contain at most 255 characters; keys use [a-z0-9._-].
mergeLabelsRecord&lt;string, string&gt; | nullnoLabels to upsert; must contain at least one entry and is mutually exclusive with replaceLabels. The final stored map may contain at most 20 entries; keys and values contain at most 255 characters; keys use [a-z0-9._-].

Response Shapes

Response shape types model values returned by the SDK after forward-compatible unknown enum strings are coerced to null.

ListServiceIdentitiesResponseShape

FieldTypeRequiredDescription
serviceIdentitiesArray&lt;ServiceIdentityResponseShape&gt;yesOUTPUT_ONLY; service identities in stable keyset order.
nextTokenstring | nullnoOUTPUT_ONLY; opaque continuation token, omitted after the final page.

ServiceIdentityResponseShape

FieldTypeRequiredDescription
serviceIdentityIdstringyesOUTPUT_ONLY; immutable service-identity UUID.
displayNamestringyesOUTPUT_ONLY; unique operator-facing display name.
descriptionstring | nullnoOUTPUT_ONLY; optional operator description.
ownerPrincipalIdstringyesOUTPUT_ONLY; current administrative owner principal UUID.
creatorPrincipalIdstringyesOUTPUT_ONLY; immutable HUMAN creator-principal UUID.
labelsRecord&lt;string, string&gt;yesOUTPUT_ONLY; mutable labels. At most 20 entries; keys and values contain at most 255 characters; keys use [a-z0-9._-].
deletedAtnumber | nullnoOUTPUT_ONLY; permanent deletion time in milliseconds, absent while active.
deletedByIdstring | nullnoOUTPUT_ONLY; exact deleting actor UUID, absent while active.
createdAtnumberyesOUTPUT_ONLY; creation time in milliseconds since the epoch.
updatedAtnumberyesOUTPUT_ONLY; most recent mutation time in milliseconds since the epoch.
createdByIdstringyesOUTPUT_ONLY; exact creating actor UUID.
updatedByIdstringyesOUTPUT_ONLY; exact actor UUID for the most recent mutation.

TransferServiceIdentityOwnershipResponseShape

FieldTypeRequiredDescription
serviceIdentityServiceIdentityResponseShapeyesOUTPUT_ONLY; updated service identity.