Download OpenAPI specification:Download
App Services manages access and synchronization between Couchbase Lite and Couchbase Capella. The App Services Admin REST API is used to administer user accounts and roles, and to run administrative tasks in superuser mode.
This will get the information about the current user.
db required | string Example: db1 The name of the database to run the operation against. |
{- "authentication_handlers": [
- "string"
], - "ok": true,
- "userCtx": {
- "channels": { },
- "name": "string"
}
}
Generates a login session for a user and returns the session ID and cookie name for that session. If no TTL is provided, then the default of 24 hours will be used.
A session cannot be generated for an non-existent user or the GUEST
user.
db required | string Example: db1 The name of the database to run the operation against. |
The body can depend on if using the Public or Admin APIs.
name | string User name to generate the session for. |
ttl | integer Time until the session expires. Uses default value of 24 hours if left blank. |
{- "name": "string",
- "ttl": 0
}
{- "session_id": "c5af80a039db4ed9d2b6865576b6999935282689",
- "expires": "2022-01-21T15:24:44Z",
- "cookie_name": "SyncGatewaySession"
}
Retrieve session information such as the user the session belongs too and what channels that user can access.
db required | string Example: db1 The name of the database to run the operation against. |
sessionid required | string The ID of the session to target. |
{- "authentication_handlers": [
- "string"
], - "ok": true,
- "userCtx": {
- "channels": { },
- "name": "string"
}
}
Invalidates the session provided so that anyone using it is logged out and is prevented from future use.
db required | string Example: db1 The name of the database to run the operation against. |
sessionid required | string The ID of the session to target. |
{- "error": "not_found",
- "reason": "no such database \"invalid-db\""
}
Invalidates all the sessions that a user has.
Will still return a 200
status code if the user has no sessions.
db required | string Example: db1 The name of the database to run the operation against. |
name required | string The name of the user. |
{- "error": "not_found",
- "reason": "no such database \"invalid-db\""
}
Invalidates the session only if it belongs to the user.
db required | string Example: db1 The name of the database to run the operation against. |
name required | string The name of the user. |
sessionid required | string The ID of the session to target. |
{- "error": "not_found",
- "reason": "no such database \"invalid-db\""
}
Retrieve a single users information.
db required | string Example: db1 The name of the database to run the operation against. |
name required | string The name of the user. |
{- "name": "string",
- "password": "string",
- "admin_channels": [
- "string"
], - "all_channels": [
- "string"
], - "collection_access": {
- "scopename1": {
- "collectionname1": {
- "admin_channels": [
- "string"
], - "all_channels": [
- "string"
], - "jwt_channels": [
- "string"
], - "jwt_last_updated": "2019-08-24T14:15:22Z"
}, - "collectionname2": {
- "admin_channels": [
- "string"
], - "all_channels": [
- "string"
], - "jwt_channels": [
- "string"
], - "jwt_last_updated": "2019-08-24T14:15:22Z"
}
}, - "scopename2": {
- "collectionname1": {
- "admin_channels": [
- "string"
], - "all_channels": [
- "string"
], - "jwt_channels": [
- "string"
], - "jwt_last_updated": "2019-08-24T14:15:22Z"
}, - "collectionname2": {
- "admin_channels": [
- "string"
], - "all_channels": [
- "string"
], - "jwt_channels": [
- "string"
], - "jwt_last_updated": "2019-08-24T14:15:22Z"
}
}
}, - "email": "string",
- "disabled": true,
- "admin_roles": [
- "string"
], - "roles": [
- "string"
], - "jwt_roles": [
- "string"
], - "jwt_channels": [
- "string"
], - "jwt_issuer": "string",
- "jwt_last_updated": "2019-08-24T14:15:22Z"
}
If the user does not exist, create a new user otherwise update the existing user.
db required | string Example: db1 The name of the database to run the operation against. |
name required | string The name of the user. |
Properties associated with a user
name | string The name of the user. User names can only have alphanumeric ASCII characters and underscores. |
password | string The password of the user. Mandatory. unless |
admin_channels | Array of strings A list of channels to explicitly grant to the user for the default collection. |
object A set of access grants by scope and collection. | |
string The email address of the user. | |
disabled | boolean If true, the user will not be able to login to the account as it is disabled. |
admin_roles | Array of strings A list of roles to explicitly grant to the user. |
{- "name": "string",
- "password": "string",
- "admin_channels": [
- "string"
], - "collection_access": {
- "scopename1": {
- "collectionname1": {
- "admin_channels": [
- "string"
]
}, - "collectionname2": {
- "admin_channels": [
- "string"
]
}
}, - "scopename2": {
- "collectionname1": {
- "admin_channels": [
- "string"
]
}, - "collectionname2": {
- "admin_channels": [
- "string"
]
}
}
}, - "email": "string",
- "disabled": true,
- "admin_roles": [
- "string"
]
}
{- "error": "not_found",
- "reason": "no such database \"invalid-db\""
}
Delete a user from the database.
db required | string Example: db1 The name of the database to run the operation against. |
name required | string The name of the user. |
{- "error": "not_found",
- "reason": "no such database \"invalid-db\""
}
Retrieves all the roles that are in the database.
db required | string Example: db1 The name of the database to run the operation against. |
deleted | boolean Default: false Enum: true false Indicates that roles marked as deleted should be included in the result. |
[- "Administrator",
- "Moderator"
]
Create a new role using the request body to specify the properties on the role.
db required | string Example: db1 The name of the database to run the operation against. |
Properties associated with a role
name | string The name of the role. Role names can only have alphanumeric ASCII characters and underscores. |
admin_channels | Array of strings The channels that users in the role are able to access for the default collection. |
object A set of access grants by scope and collection. |
{- "name": "string",
- "admin_channels": [
- "string"
], - "collection_access": {
- "scopename1": {
- "collectionname1": {
- "admin_channels": [
- "string"
]
}, - "collectionname2": {
- "admin_channels": [
- "string"
]
}
}, - "scopename2": {
- "collectionname1": {
- "admin_channels": [
- "string"
]
}, - "collectionname2": {
- "admin_channels": [
- "string"
]
}
}
}
}
{- "error": "not_found",
- "reason": "no such database \"invalid-db\""
}
Required Sync Gateway RBAC roles:
db required | string Example: db1 The name of the database to run the operation against. |
{- "error": "not_found",
- "reason": "no such database \"invalid-db\""
}
Retrieve a single roles properties.
db required | string Example: db1 The name of the database to run the operation against. |
name required | string The name of the role. |
{- "name": "string",
- "admin_channels": [
- "string"
], - "all_channels": [
- "string"
], - "collection_access": {
- "scopename1": {
- "collectionname1": {
- "admin_channels": [
- "string"
], - "all_channels": [
- "string"
], - "jwt_channels": [
- "string"
], - "jwt_last_updated": "2019-08-24T14:15:22Z"
}, - "collectionname2": {
- "admin_channels": [
- "string"
], - "all_channels": [
- "string"
], - "jwt_channels": [
- "string"
], - "jwt_last_updated": "2019-08-24T14:15:22Z"
}
}, - "scopename2": {
- "collectionname1": {
- "admin_channels": [
- "string"
], - "all_channels": [
- "string"
], - "jwt_channels": [
- "string"
], - "jwt_last_updated": "2019-08-24T14:15:22Z"
}, - "collectionname2": {
- "admin_channels": [
- "string"
], - "all_channels": [
- "string"
], - "jwt_channels": [
- "string"
], - "jwt_last_updated": "2019-08-24T14:15:22Z"
}
}
}
}
If the role does not exist, create a new role otherwise update the existing role.
db required | string Example: db1 The name of the database to run the operation against. |
name required | string The name of the role. |
Properties associated with a role
name | string The name of the role. Role names can only have alphanumeric ASCII characters and underscores. |
admin_channels | Array of strings The channels that users in the role are able to access for the default collection. |
object A set of access grants by scope and collection. |
{- "name": "string",
- "admin_channels": [
- "string"
], - "collection_access": {
- "scopename1": {
- "collectionname1": {
- "admin_channels": [
- "string"
]
}, - "collectionname2": {
- "admin_channels": [
- "string"
]
}
}, - "scopename2": {
- "collectionname1": {
- "admin_channels": [
- "string"
]
}, - "collectionname2": {
- "admin_channels": [
- "string"
]
}
}
}
}
{- "error": "not_found",
- "reason": "no such database \"invalid-db\""
}
Delete a role from the database.
db required | string Example: db1 The name of the database to run the operation against. |
name required | string The name of the role. |
{- "error": "not_found",
- "reason": "no such database \"invalid-db\""
}
Check if the role exists by checking the status code.
db required | string Example: db1 The name of the database to run the operation against. |
name required | string The name of the role. |
{- "error": "not_found",
- "reason": "no such database \"invalid-db\""
}