{ "swagger": "2.0", "info": { "title": "ApiManagementClient", "description": "Use these REST APIs for performing operations on User entity in Azure API Management deployment. The User entity in API Management represents the developers that call the APIs of the products to which they are subscribed.", "version": "2018-01-01" }, "host": "management.azure.com", "schemes": [ "https" ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "security": [ { "azure_auth": [ "user_impersonation" ] } ], "securityDefinitions": { "azure_auth": { "type": "oauth2", "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", "flow": "implicit", "description": "Azure Active Directory OAuth2 Flow.", "scopes": { "user_impersonation": "impersonate your user account" } } }, "paths": { "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/identity": { "get": { "tags": [ "Users" ], "operationId": "User_GetIdentity", "description": "Returns calling user identity information.", "x-ms-examples": { "ApiManagementListUsers": { "$ref": "./examples/ApiManagementGetUserIdentity.json" } }, "parameters": [ { "$ref": "./apimanagement.json#/parameters/ResourceGroupNameParameter" }, { "$ref": "./apimanagement.json#/parameters/ServiceNameParameter" }, { "$ref": "./apimanagement.json#/parameters/ApiVersionParameter" }, { "$ref": "./apimanagement.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Current user APIM id.", "schema": { "$ref": "#/definitions/CurrentUserIdentity" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./apimanagement.json#/definitions/ErrorResponse" } } } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users": { "get": { "tags": [ "Users" ], "operationId": "User_ListByService", "description": "Lists a collection of registered users in the specified service instance.", "x-ms-examples": { "ApiManagementListUsers": { "$ref": "./examples/ApiManagementListUsers.json" } }, "parameters": [ { "$ref": "./apimanagement.json#/parameters/ResourceGroupNameParameter" }, { "$ref": "./apimanagement.json#/parameters/ServiceNameParameter" }, { "name": "$filter", "in": "query", "required": false, "type": "string", "description": "| Field | Supported operators | Supported functions |\n|------------------|------------------------|-----------------------------------|\n| id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |\n| firstName | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |\n| lastName | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |\n| email | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |\n| state | eq | N/A |\n| registrationDate | ge, le, eq, ne, gt, lt | N/A |\n| note | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |" }, { "$ref": "./apimanagement.json#/parameters/TopQueryParameter" }, { "$ref": "./apimanagement.json#/parameters/SkipQueryParameter" }, { "$ref": "./apimanagement.json#/parameters/ApiVersionParameter" }, { "$ref": "./apimanagement.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Lists a collection of User entities.", "schema": { "$ref": "#/definitions/UserCollection" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./apimanagement.json#/definitions/ErrorResponse" } } }, "x-ms-pageable": { "nextLinkName": "nextLink" }, "x-ms-odata": "#/definitions/UserContract" } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{uid}": { "head": { "tags": [ "Users" ], "operationId": "User_GetEntityTag", "description": "Gets the entity state (Etag) version of the user specified by its identifier.", "x-ms-examples": { "ApiManagementHeadUser": { "$ref": "./examples/ApiManagementHeadUser.json" } }, "parameters": [ { "$ref": "./apimanagement.json#/parameters/ResourceGroupNameParameter" }, { "$ref": "./apimanagement.json#/parameters/ServiceNameParameter" }, { "$ref": "#/parameters/UserIdParameter" }, { "$ref": "./apimanagement.json#/parameters/ApiVersionParameter" }, { "$ref": "./apimanagement.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Specified user entity exists and current entity state version is present in the ETag header.", "headers": { "ETag": { "description": "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests.", "type": "string" } } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./apimanagement.json#/definitions/ErrorResponse" } } } }, "get": { "tags": [ "Users" ], "operationId": "User_Get", "description": "Gets the details of the user specified by its identifier.", "x-ms-examples": { "ApiManagementGetUser": { "$ref": "./examples/ApiManagementGetUser.json" } }, "parameters": [ { "$ref": "./apimanagement.json#/parameters/ResourceGroupNameParameter" }, { "$ref": "./apimanagement.json#/parameters/ServiceNameParameter" }, { "$ref": "#/parameters/UserIdParameter" }, { "$ref": "./apimanagement.json#/parameters/ApiVersionParameter" }, { "$ref": "./apimanagement.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Gets the specified user entity.", "schema": { "$ref": "#/definitions/UserContract" }, "headers": { "ETag": { "description": "Current entity state version. Should be treated as opaque and used to make conditional HTTP requests.", "type": "string" } } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./apimanagement.json#/definitions/ErrorResponse" } } } }, "put": { "tags": [ "Users" ], "operationId": "User_CreateOrUpdate", "description": "Creates or Updates a user.", "x-ms-examples": { "ApiManagementCreateUserBasic": { "$ref": "./examples/ApiManagementCreateUserBasic.json" } }, "parameters": [ { "$ref": "./apimanagement.json#/parameters/ResourceGroupNameParameter" }, { "$ref": "./apimanagement.json#/parameters/ServiceNameParameter" }, { "$ref": "#/parameters/UserIdParameter" }, { "name": "parameters", "in": "body", "required": true, "schema": { "$ref": "#/definitions/UserCreateParameters" }, "description": "Create or update parameters." }, { "$ref": "./apimanagement.json#/parameters/IfMatchOptionalParameter" }, { "$ref": "./apimanagement.json#/parameters/ApiVersionParameter" }, { "$ref": "./apimanagement.json#/parameters/SubscriptionIdParameter" } ], "responses": { "201": { "description": "User was successfully created.", "schema": { "$ref": "#/definitions/UserContract" } }, "200": { "description": "User was successfully updated.", "schema": { "$ref": "#/definitions/UserContract" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./apimanagement.json#/definitions/ErrorResponse" } } } }, "patch": { "tags": [ "Users" ], "operationId": "User_Update", "description": "Updates the details of the user specified by its identifier.", "x-ms-examples": { "ApiManagementUpdateUserBasic": { "$ref": "./examples/ApiManagementUpdateUserBasic.json" } }, "parameters": [ { "$ref": "./apimanagement.json#/parameters/ResourceGroupNameParameter" }, { "$ref": "./apimanagement.json#/parameters/ServiceNameParameter" }, { "$ref": "#/parameters/UserIdParameter" }, { "name": "parameters", "in": "body", "required": true, "schema": { "$ref": "#/definitions/UserUpdateParameters" }, "description": "Update parameters." }, { "$ref": "./apimanagement.json#/parameters/IfMatchRequiredParameter" }, { "$ref": "./apimanagement.json#/parameters/ApiVersionParameter" }, { "$ref": "./apimanagement.json#/parameters/SubscriptionIdParameter" } ], "responses": { "204": { "description": "The user details were successfully updated." }, "default": { "description": "*** Error Responses: ***\n\n * 405 Administrator user cannot be modified\n\n * 4XX Error response giving details why the operation failed.", "schema": { "$ref": "./apimanagement.json#/definitions/ErrorResponse" } } } }, "delete": { "tags": [ "Users" ], "operationId": "User_Delete", "description": "Deletes specific user.", "x-ms-examples": { "ApiManagementDeleteUser": { "$ref": "./examples/ApiManagementDeleteUser.json" } }, "parameters": [ { "$ref": "./apimanagement.json#/parameters/ResourceGroupNameParameter" }, { "$ref": "./apimanagement.json#/parameters/ServiceNameParameter" }, { "$ref": "#/parameters/UserIdParameter" }, { "name": "deleteSubscriptions", "in": "query", "required": false, "type": "boolean", "description": "Whether to delete user's subscription or not." }, { "name": "notify", "in": "query", "required": false, "type": "boolean", "description": "Send an Account Closed Email notification to the User." }, { "$ref": "./apimanagement.json#/parameters/IfMatchRequiredParameter" }, { "$ref": "./apimanagement.json#/parameters/ApiVersionParameter" }, { "$ref": "./apimanagement.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "The user details were successfully deleted." }, "204": { "description": "The user details were successfully deleted." }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./apimanagement.json#/definitions/ErrorResponse" } } } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{uid}/generateSsoUrl": { "post": { "tags": [ "Users" ], "operationId": "User_GenerateSsoUrl", "description": "Retrieves a redirection URL containing an authentication token for signing a given user into the developer portal.", "x-ms-examples": { "ApiManagementUsersGenerateSsoUrl": { "$ref": "./examples/ApiManagementUsersGenerateSsoUrl.json" } }, "parameters": [ { "$ref": "./apimanagement.json#/parameters/ResourceGroupNameParameter" }, { "$ref": "./apimanagement.json#/parameters/ServiceNameParameter" }, { "$ref": "#/parameters/UserIdParameter" }, { "$ref": "./apimanagement.json#/parameters/ApiVersionParameter" }, { "$ref": "./apimanagement.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "The response body contains the single sign-on URL.", "schema": { "x-ms-client-flatten": true, "$ref": "#/definitions/GenerateSsoUrlResult" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./apimanagement.json#/definitions/ErrorResponse" } } } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{uid}/groups": { "get": { "tags": [ "UserGroups" ], "operationId": "UserGroup_List", "description": "Lists all user groups.", "x-ms-examples": { "ApiManagementListUserGroups": { "$ref": "./examples/ApiManagementListUserGroups.json" } }, "parameters": [ { "$ref": "./apimanagement.json#/parameters/ResourceGroupNameParameter" }, { "$ref": "./apimanagement.json#/parameters/ServiceNameParameter" }, { "$ref": "#/parameters/UserIdParameter" }, { "name": "$filter", "in": "query", "required": false, "type": "string", "description": "| Field | Supported operators | Supported functions |\n|-------------|------------------------|---------------------------------------------|\n| id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |\n| name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |\n| description | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |" }, { "$ref": "./apimanagement.json#/parameters/TopQueryParameter" }, { "$ref": "./apimanagement.json#/parameters/SkipQueryParameter" }, { "$ref": "./apimanagement.json#/parameters/ApiVersionParameter" }, { "$ref": "./apimanagement.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Lists a collection of Group entities.", "schema": { "$ref": "./apimgroups.json#/definitions/GroupCollection" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./apimanagement.json#/definitions/ErrorResponse" } } }, "x-ms-pageable": { "nextLinkName": "nextLink" }, "x-ms-odata": "./apimgroups.json#/definitions/GroupContract" } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{uid}/subscriptions": { "get": { "tags": [ "UserSubscriptions" ], "operationId": "UserSubscription_List", "description": "Lists the collection of subscriptions of the specified user.", "x-ms-examples": { "ApiManagementListUserSubscriptions": { "$ref": "./examples/ApiManagementListUserSubscriptions.json" } }, "parameters": [ { "$ref": "./apimanagement.json#/parameters/ResourceGroupNameParameter" }, { "$ref": "./apimanagement.json#/parameters/ServiceNameParameter" }, { "$ref": "#/parameters/UserIdParameter" }, { "name": "$filter", "in": "query", "required": false, "type": "string", "description": "| Field | Supported operators | Supported functions |\n|--------------|------------------------|---------------------------------------------|\n| id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |\n| name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |\n| stateComment | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |\n| userId | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |\n| productId | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |\n| state | eq | |" }, { "$ref": "./apimanagement.json#/parameters/TopQueryParameter" }, { "$ref": "./apimanagement.json#/parameters/SkipQueryParameter" }, { "$ref": "./apimanagement.json#/parameters/ApiVersionParameter" }, { "$ref": "./apimanagement.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "Lists a collection of Subscription entities.", "schema": { "$ref": "./apimsubscriptions.json#/definitions/SubscriptionCollection" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./apimanagement.json#/definitions/ErrorResponse" } } }, "x-ms-pageable": { "nextLinkName": "nextLink" }, "x-ms-odata": "./apimsubscriptions.json#/definitions/SubscriptionContract" } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{uid}/identities": { "get": { "tags": [ "UserIdentities" ], "operationId": "UserIdentities_List", "description": "Lists all user identities.", "x-ms-examples": { "ApiManagementListUsersIdentities": { "$ref": "./examples/ApiManagementListUsersIdentities.json" } }, "parameters": [ { "$ref": "./apimanagement.json#/parameters/ResourceGroupNameParameter" }, { "$ref": "./apimanagement.json#/parameters/ServiceNameParameter" }, { "$ref": "#/parameters/UserIdParameter" }, { "$ref": "./apimanagement.json#/parameters/ApiVersionParameter" }, { "$ref": "./apimanagement.json#/parameters/SubscriptionIdParameter" } ], "x-ms-pageable": { "nextLinkName": "nextLink" }, "responses": { "200": { "description": "Lists of User Identities.", "schema": { "$ref": "#/definitions/UserIdentityCollection" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./apimanagement.json#/definitions/ErrorResponse" } } } } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{uid}/token": { "post": { "tags": [ "Users" ], "operationId": "User_GetSharedAccessToken", "description": "Gets the Shared Access Authorization Token for the User.", "x-ms-examples": { "ApiManagementUsersGetToken": { "$ref": "./examples/ApiManagementUsersGetToken.json" } }, "parameters": [ { "$ref": "./apimanagement.json#/parameters/ResourceGroupNameParameter" }, { "$ref": "./apimanagement.json#/parameters/ServiceNameParameter" }, { "$ref": "#/parameters/UserIdParameter" }, { "name": "parameters", "in": "body", "required": true, "schema": { "$ref": "#/definitions/UserTokenParameters" }, "description": "Create Authorization Token parameters." }, { "$ref": "./apimanagement.json#/parameters/ApiVersionParameter" }, { "$ref": "./apimanagement.json#/parameters/SubscriptionIdParameter" } ], "responses": { "200": { "description": "The response body contains the authorization token for the user.", "schema": { "x-ms-client-flatten": true, "$ref": "#/definitions/UserTokenResult" } }, "default": { "description": "Error response describing why the operation failed.", "schema": { "$ref": "./apimanagement.json#/definitions/ErrorResponse" } } } } } }, "definitions": { "GenerateSsoUrlResult": { "properties": { "value": { "type": "string", "description": "Redirect Url containing the SSO URL value." } }, "description": "Generate SSO Url operations response details." }, "UserCollection": { "properties": { "value": { "type": "array", "items": { "$ref": "#/definitions/UserContract" }, "description": "Page values." }, "nextLink": { "type": "string", "description": "Next page link if any." } }, "description": "Paged Users list representation." }, "UserContract": { "properties": { "properties": { "x-ms-client-flatten": true, "$ref": "#/definitions/UserContractProperties", "description": "User entity contract properties." } }, "allOf": [ { "$ref": "./apimanagement.json#/definitions/Resource" } ], "description": "User details." }, "UserContractProperties": { "properties": { "firstName": { "type": "string", "description": "First name." }, "lastName": { "type": "string", "description": "Last name." }, "email": { "type": "string", "description": "Email address." }, "registrationDate": { "type": "string", "format": "date-time", "description": "Date of user registration. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard.\n" }, "groups": { "readOnly": true, "type": "array", "items": { "$ref": "./apimgroups.json#/definitions/GroupContractProperties" }, "description": "Collection of groups user is part of." } }, "allOf": [ { "$ref": "#/definitions/UserEntityBaseParameters" } ], "description": "User profile." }, "UserCreateParameters": { "properties": { "properties": { "x-ms-client-flatten": true, "$ref": "#/definitions/UserCreateParameterProperties", "description": "User entity create contract properties." } }, "description": "User create details." }, "UserCreateParameterProperties": { "properties": { "email": { "type": "string", "description": "Email address. Must not be empty and must be unique within the service instance.", "minLength": 1, "maxLength": 254 }, "firstName": { "type": "string", "description": "First name.", "minLength": 1, "maxLength": 100 }, "lastName": { "type": "string", "description": "Last name.", "minLength": 1, "maxLength": 100 }, "password": { "type": "string", "description": "User Password. If no value is provided, a default password is generated." }, "confirmation": { "type": "string", "description": "Determines the type of confirmation e-mail that will be sent to the newly created user.", "enum": [ "signup", "invite" ], "x-ms-enum": { "name": "Confirmation", "modelAsString": true, "values": [ { "value": "signup", "description": "Send an e-mail to the user confirming they have successfully signed up." }, { "value": "invite", "description": "Send an e-mail inviting the user to sign-up and complete registration." } ] } } }, "allOf": [ { "$ref": "#/definitions/UserEntityBaseParameters" } ], "required": [ "email", "firstName", "lastName" ], "description": "Parameters supplied to the Create User operation." }, "UserEntityBaseParameters": { "properties": { "state": { "type": "string", "description": "Account state. Specifies whether the user is active or not. Blocked users are unable to sign into the developer portal or call any APIs of subscribed products. Default state is Active.", "enum": [ "active", "blocked", "pending", "deleted" ], "default": "active", "x-ms-enum": { "name": "UserState", "modelAsString": true, "values": [ { "value": "active", "description": "User state is active." }, { "value": "blocked", "description": "User is blocked. Blocked users cannot authenticate at developer portal or call API." }, { "value": "pending", "description": "User account is pending. Requires identity confirmation before it can be made active." }, { "value": "deleted", "description": "User account is closed. All identities and related entities are removed." } ] } }, "note": { "type": "string", "description": "Optional note about a user set by the administrator." }, "identities": { "type": "array", "items": { "$ref": "#/definitions/UserIdentityContract" }, "description": "Collection of user identities." } }, "description": "User Entity Base Parameters set." }, "UserIdentityCollection": { "properties": { "value": { "type": "array", "items": { "$ref": "#/definitions/UserIdentityContract" }, "description": "User Identity values." }, "count": { "type": "integer", "format": "int64", "description": "Total record count number across all pages." }, "nextLink": { "type": "string", "description": "Next page link if any." } }, "description": "List of Users Identity list representation." }, "UserIdentityContract": { "properties": { "provider": { "type": "string", "description": "Identity provider name." }, "id": { "type": "string", "description": "Identifier value within provider." } }, "description": "User identity details." }, "UserTokenParameters": { "properties": { "keyType": { "type": "string", "description": "The Key to be used to generate token for user.", "enum": [ "primary", "secondary" ], "default": "primary", "x-ms-enum": { "name": "KeyType", "modelAsString": false } }, "expiry": { "type": "string", "format": "date-time", "description": "The Expiry time of the Token. Maximum token expiry time is set to 30 days. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard.\n" } }, "required": [ "keyType", "expiry" ], "description": "Parameters supplied to the Get User Token operation." }, "UserTokenResult": { "properties": { "value": { "type": "string", "description": "Shared Access Authorization token for the User." } }, "description": "Get User Token response details." }, "UserUpdateParameters": { "properties": { "properties": { "x-ms-client-flatten": true, "$ref": "#/definitions/UserUpdateParametersProperties", "description": "User entity update contract properties." } }, "description": "User update parameters." }, "UserUpdateParametersProperties": { "properties": { "email": { "type": "string", "description": "Email address. Must not be empty and must be unique within the service instance.", "minLength": 1, "maxLength": 254 }, "password": { "type": "string", "description": "User Password." }, "firstName": { "type": "string", "description": "First name.", "minLength": 1, "maxLength": 100 }, "lastName": { "type": "string", "description": "Last name.", "minLength": 1, "maxLength": 100 } }, "allOf": [ { "$ref": "#/definitions/UserEntityBaseParameters" } ], "description": "Parameters supplied to the Update User operation." }, "CurrentUserIdentity": { "properties": { "id": { "type": "string", "description": "API Management service user id." } } } }, "parameters": { "UserIdParameter": { "name": "uid", "in": "path", "required": true, "type": "string", "description": "User identifier. Must be unique in the current API Management service instance.", "minLength": 1, "maxLength": 80, "pattern": "(^[\\w]+$)|(^[\\w][\\w\\-]+[\\w]$)", "x-ms-parameter-location": "method" } } }