For the complete documentation index, see llms.txt. This page is also available as Markdown.

Keys

Get Keys

get

Get all your keys.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Query parameters
offsetintegerOptional

Number of keys to skip.

Default: 0
limitinteger · min: 1 · max: 100Optional

Maximum number of keys to return.

Default: 10
sort_bystring · enumOptional

Field to sort by.

Default: idPossible values:
sort_orderstring · enumOptional

Sort order.

Default: ascPossible values:
Responses
200

Successful Response

application/json
objectconst: listOptional

Type of the object.

Default: list
totalintegerRequired

Total number of keys.

offsetintegerRequired

Offset of the keys list.

limitintegerRequired

Limit of the keys list.

Other propertiesanyOptional
get/v1/keys
GET /v1/keys HTTP/1.1
Host: albert.api.etalab.gouv.fr
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "object": "list",
  "total": 1,
  "offset": 1,
  "limit": 1,
  "data": [
    {
      "object": "key",
      "id": 1,
      "name": "text",
      "value": "text",
      "user_id": 1,
      "expires": 1,
      "created": 1,
      "ANY_ADDITIONAL_PROPERTY": "anything"
    }
  ],
  "ANY_ADDITIONAL_PROPERTY": "anything"
}

Create Key

post

Create a new API key for the authenticated user.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Body

The key creation request.

namestring · min: 1Required

Name of the key.

Example: key-1
expiresinteger · nullableOptional

Expiration time, as Unix timestamp. If None, uses the configured maximum key lifetime when set, otherwise the key never expires.

Other propertiesanyOptional
Responses
201

Successful Response

application/json
objectconst: keyOptional

Type of the object.

Default: key
idintegerRequired

ID of the key.

namestringRequired

Name of the key.

valuestringRequired

Value of the key.

user_idintegerRequired

ID of the user that owns the key.

expiresinteger · nullableOptional

Time of expiration, as Unix timestamp. If None, the key never expires.

createdintegerRequired

Time of creation, as Unix timestamp.

Other propertiesanyOptional
post/v1/keys
POST /v1/keys HTTP/1.1
Host: albert.api.etalab.gouv.fr
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 65

{
  "name": "key-1",
  "expires": 1,
  "ANY_ADDITIONAL_PROPERTY": "anything"
}
{
  "object": "key",
  "id": 1,
  "name": "text",
  "value": "text",
  "user_id": 1,
  "expires": 1,
  "created": 1,
  "ANY_ADDITIONAL_PROPERTY": "anything"
}
Deprecated

Get Keys

get

Get all your keys.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Query parameters
offsetintegerOptional

Number of keys to skip.

Default: 0
limitinteger · min: 1 · max: 100Optional

Maximum number of keys to return.

Default: 10
sort_bystring · enumOptional

Field to sort by.

Default: idPossible values:
sort_orderstring · enumOptional

Sort order.

Default: ascPossible values:
Responses
200

Successful Response

application/json
objectconst: listOptional

Type of the object.

Default: list
totalintegerRequired

Total number of keys.

offsetintegerRequired

Offset of the keys list.

limitintegerRequired

Limit of the keys list.

Other propertiesanyOptional
get/v1/me/keys
GET /v1/me/keys HTTP/1.1
Host: albert.api.etalab.gouv.fr
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "object": "list",
  "total": 1,
  "offset": 1,
  "limit": 1,
  "data": [
    {
      "object": "key",
      "id": 1,
      "name": "text",
      "value": "text",
      "user_id": 1,
      "expires": 1,
      "created": 1,
      "ANY_ADDITIONAL_PROPERTY": "anything"
    }
  ],
  "ANY_ADDITIONAL_PROPERTY": "anything"
}
Deprecated

Create Key

post

Create a new API key for the authenticated user.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Body

The key creation request.

namestring · min: 1Required

Name of the key.

Example: key-1
expiresinteger · nullableOptional

Expiration time, as Unix timestamp. If None, uses the configured maximum key lifetime when set, otherwise the key never expires.

Other propertiesanyOptional
Responses
201

Successful Response

application/json
objectconst: keyOptional

Type of the object.

Default: key
idintegerRequired

ID of the key.

namestringRequired

Name of the key.

valuestringRequired

Value of the key.

user_idintegerRequired

ID of the user that owns the key.

expiresinteger · nullableOptional

Time of expiration, as Unix timestamp. If None, the key never expires.

createdintegerRequired

Time of creation, as Unix timestamp.

Other propertiesanyOptional
post/v1/me/keys
POST /v1/me/keys HTTP/1.1
Host: albert.api.etalab.gouv.fr
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 65

{
  "name": "key-1",
  "expires": 1,
  "ANY_ADDITIONAL_PROPERTY": "anything"
}
{
  "object": "key",
  "id": 1,
  "name": "text",
  "value": "text",
  "user_id": 1,
  "expires": 1,
  "created": 1,
  "ANY_ADDITIONAL_PROPERTY": "anything"
}

Get Key

get

Get one of your API keys by ID.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
key_idintegerRequired

The ID of the key to get.

Responses
200

Successful Response

application/json
objectconst: keyOptional

Type of the object.

Default: key
idintegerRequired

ID of the key.

namestringRequired

Name of the key.

valuestringRequired

Value of the key.

user_idintegerRequired

ID of the user that owns the key.

expiresinteger · nullableOptional

Time of expiration, as Unix timestamp. If None, the key never expires.

createdintegerRequired

Time of creation, as Unix timestamp.

Other propertiesanyOptional
get/v1/keys/{key_id}
GET /v1/keys/{key_id} HTTP/1.1
Host: albert.api.etalab.gouv.fr
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "object": "key",
  "id": 1,
  "name": "text",
  "value": "text",
  "user_id": 1,
  "expires": 1,
  "created": 1,
  "ANY_ADDITIONAL_PROPERTY": "anything"
}

Delete Key

delete

Delete an API key.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
key_idintegerRequired

The ID of the key to delete.

Responses
200

Successful Response

application/json
objectconst: keyOptional

Type of the object.

Default: key
idintegerRequired

ID of the key.

namestringRequired

Name of the key.

valuestringRequired

Value of the key.

user_idintegerRequired

ID of the user that owns the key.

expiresinteger · nullableOptional

Time of expiration, as Unix timestamp. If None, the key never expires.

createdintegerRequired

Time of creation, as Unix timestamp.

Other propertiesanyOptional
delete/v1/keys/{key_id}
DELETE /v1/keys/{key_id} HTTP/1.1
Host: albert.api.etalab.gouv.fr
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "object": "key",
  "id": 1,
  "name": "text",
  "value": "text",
  "user_id": 1,
  "expires": 1,
  "created": 1,
  "ANY_ADDITIONAL_PROPERTY": "anything"
}
Deprecated

Get Key

get

Get one of your API keys by ID.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
key_idintegerRequired

The ID of the key to get.

Responses
200

Successful Response

application/json
objectconst: keyOptional

Type of the object.

Default: key
idintegerRequired

ID of the key.

namestringRequired

Name of the key.

valuestringRequired

Value of the key.

user_idintegerRequired

ID of the user that owns the key.

expiresinteger · nullableOptional

Time of expiration, as Unix timestamp. If None, the key never expires.

createdintegerRequired

Time of creation, as Unix timestamp.

Other propertiesanyOptional
get/v1/me/keys/{key_id}
GET /v1/me/keys/{key_id} HTTP/1.1
Host: albert.api.etalab.gouv.fr
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "object": "key",
  "id": 1,
  "name": "text",
  "value": "text",
  "user_id": 1,
  "expires": 1,
  "created": 1,
  "ANY_ADDITIONAL_PROPERTY": "anything"
}
Deprecated

Delete Key

delete

Delete an API key.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
key_idintegerRequired

The ID of the key to delete.

Responses
200

Successful Response

application/json
objectconst: keyOptional

Type of the object.

Default: key
idintegerRequired

ID of the key.

namestringRequired

Name of the key.

valuestringRequired

Value of the key.

user_idintegerRequired

ID of the user that owns the key.

expiresinteger · nullableOptional

Time of expiration, as Unix timestamp. If None, the key never expires.

createdintegerRequired

Time of creation, as Unix timestamp.

Other propertiesanyOptional
delete/v1/me/keys/{key_id}
DELETE /v1/me/keys/{key_id} HTTP/1.1
Host: albert.api.etalab.gouv.fr
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "object": "key",
  "id": 1,
  "name": "text",
  "value": "text",
  "user_id": 1,
  "expires": 1,
  "created": 1,
  "ANY_ADDITIONAL_PROPERTY": "anything"
}

Last updated

Was this helpful?