Base URL: /hub/api, Version: 0.9.0dev
The REST API for JupyterHub
Path | Operation | Description |
---|---|---|
/ | GET |
Get JupyterHub version |
/authorizations/cookie/{cookie_name}/{cookie_value} | GET |
Identify a user from a cookie |
/authorizations/token | POST |
Request a new API token |
/authorizations/token/{token} | GET |
Identify a user or service from an API token |
/groups | GET |
List groups |
/groups/{name} | DELETE |
Delete a group |
GET |
Get a group by name |
|
POST |
Create a group |
|
/groups/{name}/users | DELETE |
Remove users from a group |
POST |
Add users to a group |
|
/info | GET |
Get detailed info about JupyterHub |
/oauth2/authorize | GET |
OAuth 2.0 authorize endpoint |
/oauth2/token | POST |
Request an OAuth2 token |
/proxy | GET |
Get the proxy's routing table |
PATCH |
Notify the Hub about a new proxy |
|
POST |
Force the Hub to sync with the proxy |
|
/services | GET |
List services |
/services/{name} | GET |
Get a service by name |
/shutdown | POST |
Shutdown the Hub |
/user | GET |
Return authenticated user's model |
/users | GET |
List users |
POST |
Create multiple users |
|
/users/{name} | DELETE |
Delete a user |
GET |
Get a user by name |
|
PATCH |
Modify a user |
|
POST |
Create a single user |
|
/users/{name}/activity | POST |
Notify Hub of activity for a given user. |
/users/{name}/server | DELETE |
Stop a user's server |
POST |
Start a user's single-user notebook server |
|
/users/{name}/servers/{server_name} | DELETE |
Stop a user's named-server |
POST |
Start a user's single-user named-server notebook server |
|
/users/{name}/tokens | GET |
List tokens for the user |
POST |
Create a new token for the user |
|
/users/{name}/tokens/{token_id} | DELETE |
Delete (revoke) a token by id |
GET |
Get the model for a token by id |
Authorization
header
This endpoint is not authenticated for the purpose of clients and user to identify the JupyterHub version before setting up authentication.
Uses default content-types: application/json
The JupyterHub version
The version of JupyterHub itself
Uses default content-types: application/json
The list of groups
name | group name |
path | string |
Uses default content-types: application/json
The group has been deleted
name | group name |
path | string |
Uses default content-types: application/json
The group has been created
Uses default content-types: application/json
The users to remove from the group
List of usernames to remove from the group
name | group name |
path | string |
Uses default content-types: application/json
The users have been removed from the group
Uses default content-types: application/json
The users to add to the group
List of usernames to add to the group
name | group name |
path | string |
Uses default content-types: application/json
The users have been added to the group
Detailed JupyterHub information, including Python version, JupyterHub's version and executable path, and which Authenticator and Spawner are active.
Uses default content-types: application/json
Detailed JupyterHub info
The version of JupyterHub itself
The Python version, as returned by sys.version
The path to sys.executable running JupyterHub
The Python class currently active for JupyterHub Authentication
The version of the currently active Authenticator
The Python class currently active for spawning single-user notebook servers
The version of the currently active Spawner
Request an OAuth2 token from an authorization code. This request completes the OAuth process.
application/x-www-form-urlencoded
client_id | The client id |
formData | string | |
client_secret | The client secret |
formData | string | |
grant_type | The grant type (always 'authorization_code') |
formData | string | |
code | The code provided by the authorization redirect |
formData | string | |
redirect_uri | The redirect url |
formData | string |
Uses default content-types: application/json
JSON response including the token
The new API token for the user
Will always be 'Bearer'
A convenience alias for getting the routing table directly from the proxy
Uses default content-types: application/json
Routing table
configurable-http-proxy routing table (see configurable-http-proxy docs for details)
Notifies the Hub of a new proxy to use.
Uses default content-types: application/json
Any values that have changed for the new proxy. All keys are optional.
IP address of the new proxy
Port of the new proxy
Protocol of new proxy, if changed
CONFIGPROXY_AUTH_TOKEN for the new proxy
Uses default content-types: application/json
Success
Uses default content-types: application/json
Success
Uses default content-types: application/json
The service list
Uses default content-types: application/json
Whether the proxy should be shutdown as well (default from Hub config)
Whether users' notebook servers should be shutdown as well (default from Hub config)
Uses default content-types: application/json
Shutdown successful
Unexpeced value for proxy or servers
Uses default content-types: application/json
The authenticated user's model is returned.
Uses default content-types: application/json
The Hub's user list
Uses default content-types: application/json
list of usernames to create on the Hub
whether the created users should be admins
Uses default content-types: application/json
The users have been created
The created users
name | username |
path | string |
Uses default content-types: application/json
The user has been deleted
Change a user's name or admin status
Uses default content-types: application/json
Updated user info. At least one key to be updated (name or admin) is required.
the new name (optional, if another key is updated i.e. admin)
update admin (optional, if another key is updated i.e. name)
name | username |
path | string |
Uses default content-types: application/json
The updated user info
name | username |
path | string |
Uses default content-types: application/json
The user has been created
Notify the Hub of activity by the user, e.g. accessing a service or (more likely) actively using a server.
Uses default content-types: application/json
{
"last_activity": "2019-02-06T12:54:14Z",
"servers": {
"": {
"last_activity": "2019-02-06T12:54:14Z"
},
"gpu": {
"last_activity": "2019-02-06T12:54:14Z"
}
}
}
Timestamp of last-seen activity for this user. Only needed if this is not activity associated with using a given server.
Register activity for specific servers by name. The keys of this dict are the names of servers. The default server has an empty name ('').
Activity for a single server.
Timestamp of last-seen activity on this server.
name | username |
path | string |
Uses default content-types: application/json
Authentication/Authorization error
No such user
name | username |
path | string |
Uses default content-types: application/json
The user's notebook server has not yet stopped as it is taking a while to stop
The user's notebook server has stopped
Uses default content-types: application/json
Spawn options can be passed as a JSON body
when spawning via the API instead of spawn form.
The structure of the options
will depend on the Spawner's configuration.
The body itself will be available as user_options
for the
Spawner.
name | username |
path | string |
Uses default content-types: application/json
The user's notebook server has started
The user's notebook server has not yet started, but has been requested
Uses default content-types: application/json
Whether to fully remove the server, rather than just stop it. Removing a server deletes things like the state of the stopped server. Default: false.
name | username |
path | string | |
server_name | name given to a named-server |
path | string |
Uses default content-types: application/json
The user's notebook named-server has not yet stopped as it is taking a while to stop
The user's notebook named-server has stopped
Uses default content-types: application/json
Spawn options can be passed as a JSON body when spawning via the API instead of spawn form. The structure of the options will depend on the Spawner's configuration.
name | username |
path | string | |
server_name | name given to a named-server |
path | string |
Uses default content-types: application/json
The user's notebook named-server has started
The user's notebook named-server has not yet started, but has been requested
name | username |
path | string |
Uses default content-types: application/json
The list of tokens
Authentication/Authorization error
No such user
Uses default content-types: application/json
lifetime (in seconds) after which the requested token will expire.
A note attached to the token for future bookkeeping
name | username |
path | string |
Uses default content-types: application/json
The newly created token
Body must be a JSON dict or empty
name | username |
path | string | |
token_id | path | string |
Uses default content-types: application/json
The token has been deleted
name | username |
path | string | |
token_id | path | string |
Uses default content-types: application/json
The info for the new token
The group's name
The names of users who are members of this group
The server's name. The user's default server has an empty name ('')
Whether the server is ready for traffic. Will always be false when any transition is pending.
The currently pending action, if any. A server is not ready if an action is pending.
The URL where the server can be accessed (typically /user/:name/:server.name/).
The URL for an event-stream to retrieve events during a spawn.
UTC timestamp when the server was last started.
UTC timestamp last-seen activity on this server.
Arbitrary internal state from this server's spawner. Only available on the hub's users list or get-user-by-name method, and only if a hub admin. None otherwise.
User specified options for the user's spawned instance of a single-user server.
The service's name
Whether the service is an admin
The internal url where the service is running
The proxied URL prefix to the service's url
The PID of the service process (if managed)
The command used to start the service (if managed)
Additional information a deployment can attach to a service. JupyterHub does not use this field.
The token itself. Only present in responses to requests for a new token.
The id of the API token. Used for modifying or deleting the token.
The user that owns a token (undefined if owned by a service)
The service that owns the token (undefined of owned by a user)
A note about the token, typically describing what it was created for.
Timestamp when this token was created
Timestamp when this token expires. Null if there is no expiry.
Timestamp of last-seen activity using this token. Can be null if token has never been used.
The user's name
Whether the user is an admin
The names of groups where this user is a member
The user's notebook server's base URL, if running; null if not.
The currently pending action, if any
Timestamp of last-seen activity from the user
The active servers for this user.