This endpoint is responsible for handling tenants.
Content-Type | application/json |
---|---|
Authorization | Bearer <token> |
_allTenantsMeta.page | int | page number, starting from zero |
---|---|---|
_allTenantsMeta.perPage | int | number of items returned per |
_allTenantsMeta.sortField | str | field used to sort the returned items, defaults to id |
_allTenantsMeta.sortOrder | str | asc or desc, defaults to asc |
$ curl "https://api.canyan.io/graphql" \
-X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <your-token-here>" \
--data @- <<EOF
{"query": "{
allTenants {
id
name
}
meta: _allTenantsMeta(page: 0, perPage: 10, sortField: \"id\", sortOrder: \"asc\") {
count
}
}" }
EOF
allTenants.id | objectid | Identifier of the tenant |
---|---|---|
allTenants.name | string | Name of the tenant |
meta.count | int | Results count |
HTTP/1.1 200 OK
Content-Type: application/json
{
"data": {
"allTenants": [
{
"id": "fabio",
"name": "Fabio's tenant"
},
{
"id": "alex",
"name": "Alex's tenant"
},
{
"id": "paolo",
"name": "Paolo's tenant"
}
],
"meta": {
"count": 3
}
}
}
Content-Type | application/json |
---|---|
Authorization | Bearer <token> |
allTenants.filter.id | id | id of the tenant |
---|---|---|
allTenants.filter.ids | array | array of ids to fetch |
$ curl "https://api.canyan.io/graphql" \
-X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <your-token-here>" \
--data @- <<EOF
{"query": "{
allTenants(filter: {id: \"alex\"} ) {
id
name
}
}" }
EOF
allTenants.id | objectid | Identifier of the tenant. |
---|---|---|
allTenants.name | string | Name of the tenant. |
HTTP/1.1 200 OK
Content-Type: application/json
{
"data": {
"allTenants": [
{
"id": "alex",
"name": "Alex's tenant"
}
]
}
}
Content-Type | application/json |
---|---|
Authorization | Bearer <token> |
createTenant.id | objectid | Identifier of the tenant |
---|---|---|
createTenant.name | string | Name of the tenant |
$ curl "https://api.canyan.io/graphql" \
-X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <your-token-here>" \
--data @- <<EOF
{"query": "mutation {
createTenant( id:\"alex\", name:\"Alex's awesome tenant\") {
id
name
}
}"
}
EOF
createTenant.id | objectid | Identifier of the tenant |
---|---|---|
createTenant.name | string | Name of the tenant |
HTTP/1.1 200 OK
Content-Type: application/json
{
"data": {
"createTenant": [
{
"id": "alex",
"name": "Alex's awesome tenant"
}
]
}
}
Content-Type | application/json |
---|---|
Authorization | Bearer <token> |
updateTenant.id | objectid | Identifier of the tenant |
---|---|---|
updateTenant.name | string | Name of the tenant |
$ curl "https://api.canyan.io/graphql" \
-X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <your-token-here>" \
--data @- <<EOF
{"query": "mutation {
updateTenant( id:\"alex\", name:\"Updated awesome tenant\") {
id
name
}
}"
}
EOF
updateTenant.id | objectid | Identifier of the tenant. |
---|---|---|
updateTenant.name | string | Name of the tenant. |
HTTP/1.1 200 OK
Content-Type: application/json
{
"data": {
"updateTenant": [
{
"id": "alex",
"name": "Updated awesome tenant"
}
]
}
}
Content-Type | application/json |
---|---|
Authorization | Bearer <token> |
deleteTenant.id | objectid | Identifier of the tenant |
---|
$ curl "https://api.canyan.io/graphql" \
-X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <your-token-here>" \
--data @- <<EOF
{"query": "mutation {
deleteTenant( id:\"alex\") {
id
name
}
}"
}
EOF
deleteTenant.id | objectid | Identifier of the tenant. |
---|---|---|
deleteTenant.name | string | Name of the tenant. |
HTTP/1.1 200 OK
Content-Type: application/json
{
"data": {
"deleteTenant": {
"id": "alex",
"name": "Alex2's tenant"
}
}
}