Skip to main content

API key


List API keys

Get a list of API keys.

const response = await geocore.ApiKey.find({
groupId: "groupId",
page: 1,
limit: 10,
});

Prerequisites

Successfully get the IdToken with companyAdmin or superAdmin access level from login API.

Parameters

nametypedata typedescription
groupIdoptionalstringCompany ID to get API keys. If user is company admin, then get the current company keys only
pageoptionalnumberPage ordinal number
limitoptionalnumberNumber of records per page
Get API key by ID

Get API key by ID.

const response = await geocore.ApiKey.findById(apiKeyId);

Prerequisites

Successfully get the IdToken with companyAdmin or superAdmin access level from login API.

Parameters

nametypedata typedescription
apiKeyIdrequiredstringAPI key ID
Create API key

Create a API key.

const response = await geocore.ApiKey.create({
groupId: "string",
description: "string",
});

Prerequisites

Successfully get the IdToken with companyAdmin or superAdmin access level from login API.

Parameters

nametypedata typedescription
groupIdoptionalstringCompany ID to create API. If user is company admin, then the current company ID is used
descriptionoptionalstringAPI key description
Update API key

Update an API key.

const response = await geocore.ApiKey.update(
apiKeyId,
{
description: string,
isActive: boolean,
permissions: string[],
}
);

Prerequisites

Successfully get the IdToken with companyAdmin or superAdmin access level from login API.

Parameters

nametypedata typedescription
apiKeyIdrequiredstringAPI key ID
descriptionoptionalstringAPI key description
isActiveoptionalstringAPI key active status
permissionsoptionalstringAPI key permissions
Delete API key

Delete an API key.

const response = await geocore.ApiKey.delete(apiKeyId);

Prerequisites

Successfully get the IdToken with companyAdmin or superAdmin access level from login API.

Parameters

nametypedata typedescription
apiKeyIdrequiredstringAPI key ID