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
| Parameter | Type | Description |
|---|---|---|
request | CreateServiceIdentityRequest | Request body. |
requestOptions | RequestOptions optional | Per-call signal, timeout, or headers. |
Returns: Promise<ServiceIdentityResponseShape>
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/{id}
Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Service-identity UUID |
requestOptions | RequestOptions optional | Per-call signal, timeout, or headers. |
Returns: Promise<void>
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/{id}
Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Service-identity UUID |
options | ServiceIdentitiesGetOptions optional | Optional query parameters. |
requestOptions | RequestOptions optional | Per-call signal, timeout, or headers. |
Returns: Promise<ServiceIdentityResponseShape>
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
| Parameter | Type | Description |
|---|---|---|
options | ServiceIdentitiesListOptions optional | Optional query parameters. |
requestOptions | RequestOptions optional | Per-call signal, timeout, or headers. |
Returns: Promise<Page<ServiceIdentityResponseShape>>
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/{id}:transferOwnership
Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Service-identity UUID |
request | TransferOwnershipRequest | Request body. |
requestOptions | RequestOptions optional | Per-call signal, timeout, or headers. |
Returns: Promise<TransferServiceIdentityOwnershipResponseShape>
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/{id}
Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Service-identity UUID |
request | UpdateServiceIdentityRequest | Request body. |
requestOptions | RequestOptions optional | Per-call signal, timeout, or headers. |
Returns: Promise<ServiceIdentityResponseShape>
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.
| Field | Type | Required | Description |
|---|---|---|---|
serviceIdentityId | string | null | no | Optional client-provided UUID; generated by the server when omitted. |
displayName | string | yes | Globally unique, nonblank operator-facing name. |
description | string | null | no | Optional operator description. |
labels | Record<string, string> | null | no | Optional 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.
| Field | Type | Required | Description |
|---|---|---|---|
serviceIdentities | Array<ServiceIdentityResponse> | yes | OUTPUT_ONLY; service identities in stable keyset order. |
nextToken | string | null | no | OUTPUT_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.
| Field | Type | Required | Description |
|---|---|---|---|
serviceIdentityId | string | yes | OUTPUT_ONLY; immutable service-identity UUID. |
displayName | string | yes | OUTPUT_ONLY; unique operator-facing display name. |
description | string | null | no | OUTPUT_ONLY; optional operator description. |
ownerPrincipalId | string | yes | OUTPUT_ONLY; current administrative owner principal UUID. |
creatorPrincipalId | string | yes | OUTPUT_ONLY; immutable HUMAN creator-principal UUID. |
labels | Record<string, string> | yes | OUTPUT_ONLY; mutable labels. At most 20 entries; keys and values contain at most 255 characters; keys use [a-z0-9._-]. |
deletedAt | number | null | no | OUTPUT_ONLY; permanent deletion time in milliseconds, absent while active. |
deletedById | string | null | no | OUTPUT_ONLY; exact deleting actor UUID, absent while active. |
createdAt | number | yes | OUTPUT_ONLY; creation time in milliseconds since the epoch. |
updatedAt | number | yes | OUTPUT_ONLY; most recent mutation time in milliseconds since the epoch. |
createdById | string | yes | OUTPUT_ONLY; exact creating actor UUID. |
updatedById | string | yes | OUTPUT_ONLY; exact actor UUID for the most recent mutation. |
TransferServiceIdentityOwnershipResponse
The service identity after its administrative ownership transfer.
| Field | Type | Required | Description |
|---|---|---|---|
serviceIdentity | ServiceIdentityResponse | yes | OUTPUT_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.
| Field | Type | Required | Description |
|---|---|---|---|
displayName | string | null | no | Replacement display name. A present blank value is invalid. |
description | string | null | no | Replacement description. An empty string clears the description. |
replaceLabels | Record<string, string> | null | no | Complete 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._-]. |
mergeLabels | Record<string, string> | null | no | Labels 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
| Field | Type | Required | Description |
|---|---|---|---|
serviceIdentities | Array<ServiceIdentityResponseShape> | yes | OUTPUT_ONLY; service identities in stable keyset order. |
nextToken | string | null | no | OUTPUT_ONLY; opaque continuation token, omitted after the final page. |
ServiceIdentityResponseShape
| Field | Type | Required | Description |
|---|---|---|---|
serviceIdentityId | string | yes | OUTPUT_ONLY; immutable service-identity UUID. |
displayName | string | yes | OUTPUT_ONLY; unique operator-facing display name. |
description | string | null | no | OUTPUT_ONLY; optional operator description. |
ownerPrincipalId | string | yes | OUTPUT_ONLY; current administrative owner principal UUID. |
creatorPrincipalId | string | yes | OUTPUT_ONLY; immutable HUMAN creator-principal UUID. |
labels | Record<string, string> | yes | OUTPUT_ONLY; mutable labels. At most 20 entries; keys and values contain at most 255 characters; keys use [a-z0-9._-]. |
deletedAt | number | null | no | OUTPUT_ONLY; permanent deletion time in milliseconds, absent while active. |
deletedById | string | null | no | OUTPUT_ONLY; exact deleting actor UUID, absent while active. |
createdAt | number | yes | OUTPUT_ONLY; creation time in milliseconds since the epoch. |
updatedAt | number | yes | OUTPUT_ONLY; most recent mutation time in milliseconds since the epoch. |
createdById | string | yes | OUTPUT_ONLY; exact creating actor UUID. |
updatedById | string | yes | OUTPUT_ONLY; exact actor UUID for the most recent mutation. |
TransferServiceIdentityOwnershipResponseShape
| Field | Type | Required | Description |
|---|---|---|---|
serviceIdentity | ServiceIdentityResponseShape | yes | OUTPUT_ONLY; updated service identity. |