Skip to main content

Service Account Keys

Manage bearer-token keys for a service account. A key authenticates API requests — create one to get a token, delete it to revoke access. Keys can optionally be single-use or time-limited.

GET

/api/v1/service-accounts/{serviceAccountId}/keys

List all keys for a service account.

Parameters

Parameter

Type

Description

serviceAccountId

string

Required. Service account ID. Obtain this from the LucidLink app under Settings → Keys.

serviceAccountId

Type

string

Description

Required. Service account ID. Obtain this from the LucidLink app under Settings → Keys.

Responses

Status

Description

200

Keys retrieved successfully.

401

Invalid or missing credentials.

404

Service account does not exist.

200

Description

Keys retrieved successfully.

401

Description

Invalid or missing credentials.

404

Description

Service account does not exist.

401 response

{    "error": {        "message": "Invalid or expired token"    }}

404 response

{    "error": {        "message": "Resource not found or user has no access privilege"    }}
POST

/api/v1/service-accounts/{serviceAccountId}/keys

Create a new key for a service account.

Parameters

Parameter

Type

Description

serviceAccountId

string

Required. Service account ID. Obtain this from the LucidLink app under Settings → Keys.

serviceAccountId

Type

string

Description

Required. Service account ID. Obtain this from the LucidLink app under Settings → Keys.

Request body

Field

Type

Description

isSingleUse

boolean

When true, the token is invalidated after its first use.

expiresAt

string

Expiry date-time for the token (ISO 8601). Omit for a non-expiring token.

isSingleUse

Type

boolean

Description

When true, the token is invalidated after its first use.

expiresAt

Type

string

Description

Expiry date-time for the token (ISO 8601). Omit for a non-expiring token.

Responses

Status

Description

201

Key created successfully. The token is returned only once — store it securely.

400

1. isSingleUse must be a boolean value. 2. expiresAt must be a Date instance.

401

Invalid or missing credentials.

404

Service account does not exist.

201

Description

Key created successfully. The token is returned only once — store it securely.

400

Description

1. isSingleUse must be a boolean value. 2. expiresAt must be a Date instance.

401

Description

Invalid or missing credentials.

404

Description

Service account does not exist.

401 response

{    "error": {        "message": "Invalid or expired token"    }}

404 response

{    "error": {        "message": "Resource not found or user has no access privilege"    }}
DELETE

/api/v1/service-accounts/{serviceAccountId}/keys/{keyId}

Delete a key, immediately revoking its token.

Parameters

Parameter

Type

Description

serviceAccountId

string

Required. Service account ID. Obtain this from the LucidLink app under Settings → Keys.

keyId

string

Required.

serviceAccountId

Type

string

Description

Required. Service account ID. Obtain this from the LucidLink app under Settings → Keys.

keyId

Type

string

Description

Required.

Responses

Status

Description

200

Key deleted successfully.

401

Invalid or missing credentials.

404

Service account or key does not exist.

200

Description

Key deleted successfully.

401

Description

Invalid or missing credentials.

404

Description

Service account or key does not exist.

401 response

{    "error": {        "message": "Invalid or expired token"    }}

404 response

{    "error": {        "message": "Resource not found or user has no access privilege"    }}