Tenants

API for managing tenants CRUD operations


Parameters

Name In Type Required Description
bitmask query string false Filtering tenants by a valid bitmask

Request example

1
2
3
4

curl -X GET https://authn-tenants.prod.k8s.masmovil.com/tenants?bitmask='v1::1' \
  -H "Accept: application/json"

Responses

Code Meaning Description Schema
200 OK OK [tenant]
400 Bad Request Invalid request goError

200 - instance of tenant

Custom schema example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
[
  {
    "tenant_id": 16,
    "position_of_bit": 8,
    "org": "guuk",
    "name": "guuk",
    "iam": "authz.guuk",
    "tier": 3
  }
]
Name Type Required Description
tenant_id integer false none
position_of_bit integer false none
org string false none
name string false none
iam string false none
tier integer false none

Parameters

Name In Type Required Description
body body inboundTenant true Tenant to add

Request body - instance of inboundTenant

1
2
3
4
{
  "org": "123e4567-e89b-12d3-a456-426614174000",
  "name": "J24352718"
}
Name Type Required Description
org string(uuid) true none
name string true none

Request example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10

curl -X POST https://authn-tenants.prod.k8s.masmovil.com/tenants \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer {access-token}" \
 --data-raw "{
  'org': '123e4567-e89b-12d3-a456-426614174000',
  'name': 'J24352718'
}" 

Responses

Code Meaning Description Schema
201 Created item created createdTenant
400 Bad Request invalid input, object invalid goError
409 Conflict tenant already exists goError
500 Internal Server Error Internal Server Error goError

Parameters

Name In Type Required Description
tenantID path integer true ‘none’

Request example

1
2
3
4

curl -X GET https://authn-tenants.prod.k8s.masmovil.com/tenants/{tenantID} \
  -H "Accept: application/json"

Responses

Code Meaning Description Schema
200 OK OK tenant
400 Bad Request Invalid tenant id goError
404 Not Found Tenant not found goError
500 Internal Server Error Internal Server Error goError

Parameters

Name In Type Required Description
tenantID path integer true ‘none’
body body inboundTenant true ‘none’

Request body - instance of inboundTenant

1
2
3
4
{
  "org": "123e4567-e89b-12d3-a456-426614174000",
  "name": "J24352718"
}
Name Type Required Description
org string(uuid) true none
name string true none

Request example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10

curl -X PUT https://authn-tenants.prod.k8s.masmovil.com/tenants/{tenantID} \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer {access-token}" \
 --data-raw "{
  'org': '123e4567-e89b-12d3-a456-426614174000',
  'name': 'J24352718'
}" 

Responses

Code Meaning Description Schema
200 OK OK tenant
400 Bad Request Invalid tenant goError
404 Not Found Tenant not found goError
500 Internal Server Error Internal Server Error goError

Parameters

Name In Type Required Description
tenantID path integer true ‘none’

Request example

1
2
3
4
5

curl -X DELETE https://authn-tenants.prod.k8s.masmovil.com/tenants/{tenantID} \
  -H "Accept: application/json" \
  -H "Authorization: Bearer {access-token}"

Responses

Code Meaning Description Schema
204 No Content OK None
400 Bad Request Invalid tenant goError
404 Not Found Tenant not found goError
500 Internal Server Error Internal Server Error goError

Endpoints

Tenants