@lap v0.3
# Machine-readable API spec. Each @endpoint block is one API call.
@api License Manager API
@base https://apiexamples.vtexcommercestable.com.br
@version 1.0
@auth ApiKey X-VTEX-API-AppKey in header | ApiKey X-VTEX-API-AppToken in header | ApiKey VtexIdclientAutCookie in header
@endpoints 13
@toc api(13)

@endpoint GET /api/license-manager/users/{userId}
@desc Get admin user information by user ID
@required {Content-Type: str=application/json # Type of the content being sent., Accept: str=application/json # HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand., userId: str # ID from queried user.}
@returns(200) {id: str, name: str, email: str} # Success
@errors {400: Bad Request, 405: Method Not Allowed - A null `userId` sends the request to a path that is not allowed.}

@endpoint DELETE /api/license-manager/users/{userId}
@desc Delete admin user
@required {Content-Type: str=application/json # Type of the content being sent., Accept: str=application/json # HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand., userId: str # ID from queried user.}
@returns(200) OK
@errors {400: Bad Request}

@endpoint POST /api/license-manager/users
@desc Create admin user
@required {email: str # Email of the user.}
@optional {name: str # Name of the user.}
@returns(200) {id: str, email: str, name: str} # Success
@errors {400: Bad Request}
@example_request {"name":"Jane","email":"jane@mail.com"}

@endpoint GET /api/license-manager/site/pvt/logins/list/paged
@desc Get list of admin users
@required {Content-Type: str=application/json # Type of the content being sent., Accept: str=application/json # HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand.}
@optional {numItems: int # Number of items in the returned page., pageNumber: int # Which page from the whole list will be returned., sort: str # Chooses the field that the list will be sorted by., sortType: str # Defines the sorting order. `ASC` is used for ascendant order. `DSC` is used for descendant order.}
@returns(200) {items: [map], paging: map{page: int, perPage: int, total: int, pages: int}} # Success

@endpoint PUT /api/license-manager/users/{userId}/roles
@desc Add roles to admin user or API Key
@required {userId: str # ID of the user.}
@returns(204) Success - A no-content response, but the roles were added successfully.
@errors {400: Bad Request - A userId or role list with invalid format. The message on the body of the response will contain further information., 500: Unexpected error - One possible reason is that the userId is not present on the database.}
@example_request [9000,9111,9333,9444]

@endpoint GET /api/license-manager/users/{userId}/roles
@desc Get roles by admin user ID or API Key
@required {Content-Type: str=application/json # Type of the content being sent., Accept: str=application/json # HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand., userId: str # ID of the user.}
@returns(200) Success

@endpoint DELETE /api/license-manager/users/{userId}/roles/{roleId}
@desc Remove role from admin user or API Key
@required {Content-Type: str=application/json # Type of the content being sent., Accept: str=application/json # HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand., userId: str # ID of the user., roleId: str # ID of the role which will be removed from the user.}
@returns(204) Success - A no-content response, but the role deletion was performed successfully.
@errors {400: Bad Request - A userId or role list with invalid format. The message on the body of the response will contain further information., 405: Method Not Allowed}

@endpoint GET /api/license-manager/site/pvt/roles/list/paged
@desc Get list of roles
@required {Content-Type: str=application/json # Type of the content being sent., Accept: str=application/json # HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand.}
@optional {numItems: int # Number of items in the returned page., pageNumber: int # Which page from the whole list will be returned., sort: str # Chooses the field that the list will be sorted by., sortType: str # Defines the sorting order. `ASC` is used for ascendant order. `DSC` is used for descendant order.}
@returns(200) {items: [map], paging: map{page: int, perPage: int, total: int, pages: int}} # Success

@endpoint POST /api/vlm/appkeys
@desc Create new API Key
@required {label: str # Label of the API key.}
@returns(200) {id: str, appKey: str, appToken: str?, label: str, createdIn: str(date-time), isActive: bool} # Success
@example_request {"label":"my new API Key"}

@endpoint GET /api/vlm/appkeys
@desc Get API keys from account
@required {Content-Type: str=application/json # Type of the content being sent.}
@returns(200) Success

@endpoint PUT /api/vlm/appkeys/{id}
@desc Update API Key
@required {id: str # ID from the API Key which will be updated, isActive: bool # Defines if the API key is active (`true`) or not (`false`).}
@returns(200) Success
@errors {400: Bad Request}
@example_request {"isActive":false}

@endpoint GET /api/vlm/account/stores
@desc Get stores
@returns(200) Success

@endpoint GET /api/vlm/account
@desc Get information about account
@returns(200) {isActive: bool, id: str, name: str, accountName: str, lv: str?, isOperating: bool, defaultUrl: str?, district: str?, country: str?, complement: str?, companyName: str, cnpj: str?, haveParentAccount: bool, parentAccountId: str?, parentAccountName: str?, city: str?, address: str?, logo: str?, hasLogo: bool, number: str?, postalCode: str?, state: str?, telephone: str, tradingName: str, licenses: [map], sponsor: map{name: str, email: str, phone: str}, contact: map{name: str, email: str, phone: str}, operationDate: str(date-time)?, inactivationDate: str(date-time)?, creationDate: str(date-time), hosts: [str], sites: [map], appKey: map{token: str?, name: str?}, appKeys: [map]} # Success

@end
