16.1.1.11. Container endpoints

API for managing token containers

GET /container/tokentypes
GET /container/types

Returns a dictionary with the container types as keys and their descriptions and supported token types as values.

{
    type: { description: "Description", token_types: ["hotp", "totp", "push", "daypassword", "sms"] },
    type: { description: "Description", token_types: ["hotp", "totp", "push", "daypassword", "sms"] }
}
GET /container/statetypes

Get the supported state types as dictionary. The types are the keys and the value is a list containing all states that are excluded when the key state is selected.

POST /container/init

Create a new container.

Jsonparam

description: Description for the container

Jsonparam

type: Type of the container. If the type is unknown, an error will be returned

Jsonparam

serial: Optional serial

Jsonparam

user: Optional username to assign the container to. Requires realm param to be present as well.

Jsonparam

realm: Optional realm to assign the container to. Requires user param to be present as well.

GET /container/

Get containers depending on the query parameters. If pagesize and page are not provided, all containers are returned at once.

Query Parameters
  • user – Username of a user assigned to the containers

  • serial – Serial of a single container

  • type – Type of the containers to return

  • token_serial – Serial of a token assigned to the container

  • sortby – Sort by a container attribute (serial or type)

  • sortdir – Sort direction (asc or desc)

  • pagesize – Number of containers per page

  • page – Page number

  • no_token – no_token=1: Do not return tokens assigned to the container

POST /container/(string: container_serial)/description

Set the description of a container.

Param

container_serial: Serial of the container

Jsonparam

description: New description to be set

POST /container/(string: container_serial)/removeall

Remove multiple tokens from a container.

Param

container_serial: serial of the container

Jsonparam

serial: Comma separated list of token serials.

POST /container/(string: container_serial)/unassign

Unassign a user from a container

Param

container_serial: serial of the container

JSON Parameters
  • user – Username of the user

  • realm – Realm of the user

POST /container/(string: container_serial)/lastseen

Updates the date and time for the last_seen property.

Param

container_serial: Serial of the container

POST /container/(string: container_serial)/assign

Assign a container to a user.

Param

container_serial: serial of the container

JSON Parameters
  • user – Username of the user

  • realm – Name of the realm of the user

POST /container/(string: container_serial)/addall

Add multiple tokens to a container.

Param

container_serial: serial of the container

Jsonparam

serial: Comma separated list of token serials

POST /container/(string: container_serial)/remove

Remove a single token from a container.

Param

container_serial: serial of the container

Jsonparam

serial: Serial of the token to remove.

POST /container/(string: container_serial)/states

Set the states of a container.

Jsonparam

states: string of comma separated states

POST /container/(string: container_serial)/realms

Set the realms of a container. Old realms will be deleted.

Param

container_serial: Serial of the container

Jsonparam

realms: comma separated string of realms, e.g. “realm1,realm2”

POST /container/(string: container_serial)/info/(key)

Set the value of a container info key. Overwrites the old value if the key already exists.

Param

container_serial: Serial of the container

Param

key: Key of the container info

Jsonparam

value: Value to set

POST /container/(string: container_serial)/add

Add a single token to a container.

Param

container_serial: serial of the container

Jsonparam

serial: Serial of the token to add.

DELETE /container/(string: container_serial)

Delete a container.

Param

container_serial: serial of the container