Skip to content
getgeolens.com

Create My Api Key

POST
/auth/api-keys/
curl --request POST \
--url https://example.com/auth/api-keys/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "name": "example", "expires_at": "2026-04-15T12:00:00Z", "scope": "full" }'

Create an API key for the current user.

The raw key is returned only in this response and cannot be retrieved again.

Media type application/json
ApiKeyCreateRequest
object
name
required
Name

Human-readable label for the API key

string
>= 1 characters <= 255 characters
expires_at
Any of:
string format: date-time
scope
Scope

Privilege scope (#875). ‘full’ impersonates the owner completely, the pre-existing behavior. ‘read_only’ authenticates GET, HEAD and OPTIONS requests only; any other method is refused with 403.

string
default: full
Allowed values: full read_only

Successful Response

Media type application/json
ApiKeyCreateResponse
object
id
required
Id
string format: uuid
key
required
Key

The API key secret (shown only once)

string
fingerprint
required
Fingerprint

Non-secret key identifier (prefix and last four characters)

string
name
required
Name
string
expires_at
Any of:
string format: date-time
scope
required
Scope

Privilege scope: ‘full’ or ‘read_only’ (#875)

string
created_at
required
Created At
string format: date-time
Example generated
{
"id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"key": "example",
"fingerprint": "example",
"name": "example",
"expires_at": "2026-04-15T12:00:00Z",
"scope": "example",
"created_at": "2026-04-15T12:00:00Z"
}

Bad request — invalid query parameters or payload

Media type application/problem+json
ProblemDetail
object
type
Type
string
default: about:blank
title
required
Title
string
status
required
Status
integer
detail
required
Any of:
string
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Unauthorized — missing or invalid credentials

Media type application/problem+json
ProblemDetail
object
type
Type
string
default: about:blank
title
required
Title
string
status
required
Status
integer
detail
required
Any of:
string
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Forbidden — caller lacks access to this resource

Media type application/problem+json
ProblemDetail
object
type
Type
string
default: about:blank
title
required
Title
string
status
required
Status
integer
detail
required
Any of:
string
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Not found

Media type application/problem+json
ProblemDetail
object
type
Type
string
default: about:blank
title
required
Title
string
status
required
Status
integer
detail
required
Any of:
string
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Validation error

Media type application/problem+json
ProblemDetail
object
type
Type
string
default: about:blank
title
required
Title
string
status
required
Status
integer
detail
required
Any of:
string
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Too many requests — retry after the advertised interval

Media type application/problem+json
ProblemDetail
object
type
Type
string
default: about:blank
title
required
Title
string
status
required
Status
integer
detail
required
Any of:
string
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}
Retry-After
integer

Seconds until the request may be retried

Internal server error

Media type application/problem+json
ProblemDetail
object
type
Type
string
default: about:blank
title
required
Title
string
status
required
Status
integer
detail
required
Any of:
string
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Service unavailable — the database could not serve the request

Media type application/problem+json
ProblemDetail
object
type
Type
string
default: about:blank
title
required
Title
string
status
required
Status
integer
detail
required
Any of:
string
Example
{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}